From c44d75c4ec15f44f34ab8d3b2023170c91f16f20 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Mon, 15 Jul 2019 14:30:08 +1000 Subject: [PATCH 01/24] shouldn't have left it like that... --- R/map_layer_mesh.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/map_layer_mesh.R b/R/map_layer_mesh.R index 3760522d..d265b5c0 100644 --- a/R/map_layer_mesh.R +++ b/R/map_layer_mesh.R @@ -67,7 +67,7 @@ add_mesh <- function( l <- list() # fill_colour = "average_z" # fill_colour = "z" - l[["fill_colour"]] <- force( fill_colour ) + # l[["fill_colour"]] <- force( fill_colour ) l[["fill_opacity"]] <- resolve_opacity( fill_opacity ) l[["elevation"]] <- force( elevation ) l[["tooltip"]] <- force( tooltip ) @@ -130,7 +130,7 @@ add_mesh <- function( # geometry_column <- c( "geometry" ) geometry_column <- c( vertex, index ) shape <- rcpp_mesh_geojson( data, l, geometry_column, digits ) - return( shape ) + #return( shape ) } # geometry_column <- c( "geometry" ) ## This is where we woudl also specify 'origin' or 'destination' @@ -255,8 +255,8 @@ add_mesh2 <- function( # geometry_column <- c( "geometry" ) geometry_column <- c( vertex, index ) shape <- rcpp_mesh_geojson2( data, geometry_column ) - return( shape ) - shape[["legend"]] <- list() + # return( shape ) + # shape[["legend"]] <- list() } # geometry_column <- c( "geometry" ) ## This is where we woudl also specify 'origin' or 'destination' From 41d32213a53a5344e14db78fe8851af8d2e24904 Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 27 Jul 2019 20:26:14 +1000 Subject: [PATCH 02/24] deck.gl v7.1.10 --- R/mapdeck_dependencies.R | 2 +- inst/htmlwidgets/lib/deckgl.min.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/R/mapdeck_dependencies.R b/R/mapdeck_dependencies.R index 2e003959..190813fe 100644 --- a/R/mapdeck_dependencies.R +++ b/R/mapdeck_dependencies.R @@ -157,7 +157,7 @@ deckgl_min_js <- function() { list( createHtmlDependency( name = "deckgl", - version = "7.1.3", + version = "7.1.10", src = system.file("htmlwidgets/lib/", package = "mapdeck"), script = c("deckgl.min.js"), all_files = FALSE diff --git a/inst/htmlwidgets/lib/deckgl.min.js b/inst/htmlwidgets/lib/deckgl.min.js index 94cfb77d..9b57aedc 100644 --- a/inst/htmlwidgets/lib/deckgl.min.js +++ b/inst/htmlwidgets/lib/deckgl.min.js @@ -1,4 +1,9 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("h3"),require("S2"));else if("function"==typeof define&&define.amd)define(["h3","S2"],t);else{var n="object"==typeof exports?t(require("h3"),require("S2")):t(e.h3,e.S2);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=158)}([function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.r(t);var i=n(4),r=n(6),a=n(67),o=n(32),s=n(24),u=n(25),c=n(0),l=n(113),f="7.1.3",h=Object(l.a)();var d=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(i.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(r),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(r.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function v(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var p={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function g(e){return"string"==typeof e?p[e.toUpperCase()]||p.WHITE:e}function m(e,t){if(!e)throw new Error(t||"Assertion failed")}var y=n(45);function _(){var e;if(h&&y.b.performance)e=y.b.performance.now();else if(y.a.hrtime){var t=y.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var b={debug:h&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},x={enabled:!1,priority:0};function w(){}var E={};var P=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(i.a)(this,e),this.id=t,this.VERSION=f,this._startTs=_(),this._deltaTs=_(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new d("__probe-".concat(this.id,"__"),x),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(r.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((_()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((_()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){m(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?w:h?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(c.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(161)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:w}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,r=e.scale,a=void 0===r?1:r;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=v(o,i,a);(e=console).log.apply(e,Object(u.a)(t))},o.src=t,w}var s,c=t.nodeName||"";if("img"===c.toLowerCase())return(s=console).log.apply(s,Object(u.a)(v(t,i,a))),w;if("canvas"===c.toLowerCase()){var l=new Image;return l.onload=function(){var e;return(e=console).log.apply(e,Object(u.a)(v(l,i,a)))},l.src=t.toDataURL(),w}return w}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||w})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||w})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=_(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),m(t);var n=e.message,i=e.tag||e.message;if(e.once){if(E[i])return w;E[i]=_()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(u.a)(e.args)))}return w}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(s.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return m(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,i=e.args,r=void 0===i?[]:i,a=e.opts,o={priority:this._normalizePriority(t),message:n,args:r};switch(Object(s.a)(t)){case"string":case"function":void 0!==n&&r.unshift(n),Object.assign(o,{message:t});break;case"object":Object.assign(o,t)}return"function"==typeof o.message&&(o.message=this._shouldLog(o.priority)?o.message():""),m("string"==typeof o.message||"object"===Object(s.a)(o.message)),Object.assign(o,a)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,h||"string"!=typeof r||(a&&(a=g(a),r="[".concat(a,"m").concat(r,"")),o&&(a=g(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();P.VERSION=f;var O=new P({id:"luma"}).enable(),S=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=_(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(_()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}(),A=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new S(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}(),T=(n(99),new(function(){function e(){Object(i.a)(this,e),this.stats=new Map}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new A({id:e})),this.stats.get(e)}}]),e}()));if(o.b.luma&&"7.1.0-beta.1"!==o.b.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(o.b.luma.VERSION," vs ").concat("7.1.0-beta.1"));o.b.luma||(a.a&&O.log(1,"luma.gl ".concat("7.1.0-beta.1"," - ").concat("set luma.log.priority=1 (or higher) to trace rendering"))(),o.b.luma=o.b.luma||{VERSION:"7.1.0-beta.1",version:"7.1.0-beta.1",log:O,stats:T,globals:{modules:{},nodeIO:{}}});o.b.luma;var k=n(51),C=n(22);function M(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var j={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(u.a)(t))},blendEquation:function(e,t){t=M(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(u.a)(t))},blendFunc:function(e,t){t=M(t)&&2===t.length?[].concat(Object(u.a)(t),Object(u.a)(t)):t,e.blendFuncSeparate.apply(e,Object(u.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(u.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(u.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(u.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(u.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(u.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(u.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=M(t)?t:[t,t],i=Object(C.a)(n,2),r=i[0],a=i[1];e.stencilMaskSeparate(1028,r),e.stencilMaskSeparate(1029,a)},stencilFunc:function(e,t){var n=t=M(t)&&3===t.length?[].concat(Object(u.a)(t),Object(u.a)(t)):t,i=Object(C.a)(n,6),r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5];e.stencilFuncSeparate(1028,r,a,o),e.stencilFuncSeparate(1029,s,c,l)},stencilOp:function(e,t){var n=t=M(t)&&3===t.length?[].concat(Object(u.a)(t),Object(u.a)(t)):t,i=Object(C.a)(n,6),r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5];e.stencilOpSeparate(1028,r,a,o),e.stencilOpSeparate(1029,s,c,l)},viewport:function(e,t){return e.viewport.apply(e,Object(u.a)(t))}};function L(e,t){for(var n in Object(k.f)(e,t),t){var i=j[n];i&&i(e,t[n],n)}}var R=n(62),I=n(46);function F(e,t,n){if(Object(I.b)(t))return n(e);var i,r=t.nocatch,a=void 0===r||r;if(Object(I.a)(!t.frameBuffer),Object(R.c)(e),L(e,t),a)i=n(e),Object(R.b)(e);else try{i=n(e)}finally{Object(R.b)(e)}return i}var N="luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",D=null;function B(){var e=n(162);if(!e)throw new Error(N);return e.apply(void 0,arguments)}if(!a.a)try{D=n(163)}catch(e){}var U=function e(){Object(i.a)(this,e)},z=D||o.b,V=(z.WebGLRenderingContext,z.WebGLProgram,z.WebGLShader,z.WebGLBuffer),G=void 0===V?U:V;z.WebGLFramebuffer,z.WebGLRenderbuffer,z.WebGLTexture,z.WebGLUniformLocation,z.WebGLActiveInfo,z.WebGLShaderPrecisionFormat;var W=o.b.WebGL2RenderingContext||function e(){Object(i.a)(this,e)};o.b.Image;function H(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"id";q[e]=q[e]||1;var t=q[e]++;return"".concat(e,"-").concat(t)}function Q(e){return Z("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function J(e){var t=!0;for(var n in e){t=!1;break}return t}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,i=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,i=void 0===n?16:n,r=t.size,a=void 0===r?1:r,o="[",s=0;s0&&(o+=",".concat(s%a==0?" ":"")),o+=$(e[s],t);var u=e.length>i?"...":"]";return"".concat(o).concat(u)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return i?"0":"0.";if(i)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var r=e.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function ee(e,t,n,i){var r="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),a=Object.getPrototypeOf(e);i.forEach(function(e){a.methodName||(a[e]=function(){throw O.removed("Calling removed method ".concat(t,".").concat(e,": "),r)(),new Error(e)})})}function te(e,t,n){var i=n.removedProps,r=void 0===i?{}:i,a=n.deprecatedProps,o=void 0===a?{}:a,s=n.replacedProps,u=void 0===s?{}:s;for(var c in r)if(c in t){var l=r[c]?"".concat(e,".").concat(r[c]):"N/A";O.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];O.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var v in u)if(v in t){var p=u[v];O.deprecated("".concat(e,".").concat(v),"".concat(e,".").concat(p))(),(d=d||Object.assign({},t))[p]=t[v],delete d[v]}return d||t}var ne,ie=a.a&&"undefined"!=typeof document,re=ie&&"complete"===document.readyState;function ae(){return ne||(ne=ie?new Promise(function(e,t){if(ie&&"complete"===document.readyState)return re=!0,void e(document);window.onload=function(){re=!0,e(document)}}):Promise.resolve({})),ne}function oe(e){var t,n=e.canvas,i=e.width,r=e.height,a=e.onError,o=void 0===a?function(){}:a;return"string"==typeof n?(re||o("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:o}),t}function se(e){var t=e.getParameter(7936),n=e.getParameter(7937),i=e.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&e.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||t,renderer:i&&e.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}var ue="Invalid WebGLRenderingContext",ce="Requires WebGL2";function le(e){return Boolean(e&&Number.isFinite(e._version))}function fe(e){return Boolean(e&&2===e._version)}function he(e){Z(le(e),ue)}function de(e){Z(fe(e),ce)}function ve(e){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function pe(e){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var ge="Failed to deduce GL constant from typed array";function me(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(ge)}}function ye(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function _e(e){for(var t=e.data,n=e.width,i=e.height,r=Math.round(n/2),a=Math.round(i/2),o=new Uint8Array(r*a*4),s=0;s1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),he(t);var r=n.id,a=n.userData,o=void 0===a?{}:a;this.gl=t,this.id=r||K(this.constructor.name),this.userData=o,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z(e=be(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=fe(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=fe(this.gl),o={},s=n||Object.keys(r),u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value,v=r[d];if(v&&(!("webgl2"in v)||a)&&(!("extension"in v)||this.gl.getExtension(v.extension))){var p=i?xe(this.gl,d):d;o[p]=this.getParameter(d,e),i&&"GLenum"===v.type&&(o[p]=xe(this.gl,o[p]))}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return o}},{key:"setParameter",value:function(e,t){Z(e=be(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=fe(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=be(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return ee(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(Se)}},{key:"_deleteHandle",value:function(){throw new Error(Se)}},{key:"_bindHandle",value:function(){throw new Error(Se)}},{key:"_getOptsFromHandle",value:function(){throw new Error(Se)}},{key:"_getParameter",value:function(e,t){throw new Error(Se)}},{key:"_setParameter",value:function(e,t){throw new Error(Se)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=T.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;T.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=T.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=T.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}(),Te=n(115);function ke(e,t,n){return(ke=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&Object(Te.a)(r,n.prototype),r}).apply(null,arguments)}var Ce,Me,je,Le={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Re={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Ie=function(){function e(){var t=this;Object(i.a)(this,e);for(var n=arguments.length,r=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=te("Accessor",e,Re)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}(),Fe={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"},Ne={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Fe},De={removedProps:Fe},Be=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(Pe.a)(n)),n}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Ie.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Ie.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=te("Buffer",e,Ne),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=te("Buffer",e,De))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new Ie(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Z(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(de(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return de(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;de(this.gl);var c,l,f=ye(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(r),d=o;n?c=(l=n.length)-d:l=d+(c=Math.min(h,u||h));var v=Math.min(h,c);return Z((u=u||v)<=v),n=n||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Z(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Z(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=me(e);return Z(i),this.setAccessor(new Ie(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Z(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/ye(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new Ie(this.accessor,{type:me(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return O.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return O.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Ie(this.accessor,e),this}},{key:"type",get:function(){return O.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return O.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(Ae),Ue=(Ce={},Object(c.a)(Ce,6407,{dataFormat:6407,types:[5121,33635]}),Object(c.a)(Ce,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(c.a)(Ce,6406,{dataFormat:6406,types:[5121]}),Object(c.a)(Ce,6409,{dataFormat:6409,types:[5121]}),Object(c.a)(Ce,6410,{dataFormat:6410,types:[5121]}),Object(c.a)(Ce,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(c.a)(Ce,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(c.a)(Ce,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(c.a)(Ce,34836,{dataFormat:6408,types:[5126],gl2:!0}),Ce),ze=(Me={},Object(c.a)(Me,6403,1),Object(c.a)(Me,36244,1),Object(c.a)(Me,33319,2),Object(c.a)(Me,33320,2),Object(c.a)(Me,6407,3),Object(c.a)(Me,36248,3),Object(c.a)(Me,6408,4),Object(c.a)(Me,36249,4),Object(c.a)(Me,6402,1),Object(c.a)(Me,34041,1),Object(c.a)(Me,6406,1),Object(c.a)(Me,6409,1),Object(c.a)(Me,6410,2),Me),Ve=(je={},Object(c.a)(je,5126,4),Object(c.a)(je,5125,4),Object(c.a)(je,5124,4),Object(c.a)(je,5123,2),Object(c.a)(je,5122,2),Object(c.a)(je,5131,2),Object(c.a)(je,5120,1),Object(c.a)(je,5121,1),je);var Ge=[9729,9728],We=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=n.id,o=void 0===a?K("texture"):a,s=n.handle,u=n.target;return(r=Object(we.a)(this,Object(Ee.a)(t).call(this,e,{id:o,handle:s}))).target=u,r.hasFloatTexture=e.getExtension("OES_texture_float"),r.textureUnit=void 0,r.loaded=!1,r.width=void 0,r.height=void 0,r.depth=void 0,r.format=void 0,r.type=void 0,r.dataFormat=void 0,r.border=void 0,r.textureUnit=void 0,r.mipmaps=void 0,r}return Object(Oe.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&function(e,t){var n=Ue[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=fe(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}(e,n))&&(!i||function(e,t){var n=Ue[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}(e,n))),r}}]),Object(r.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var i=t.pixels,r=void 0===i?null:i,a=t.format,o=void 0===a?6408:a,s=t.type,u=void 0===s?5121:s,l=t.border,f=void 0===l?0:l,h=t.recreate,d=void 0!==h&&h,v=t.parameters,p=void 0===v?{}:v,g=t.pixelStore,m=void 0===g?{}:g,y=t.textureUnit,_=void 0===y?void 0:y,b=t.unpackFlipY,x=void 0===b||b,w=t.mipmaps,E=void 0===w||w;n||(n=r);var P=t.width,S=t.height,A=t.dataFormat,T=t.depth,k=void 0===T?0:T,C=this._deduceParameters({format:o,type:u,dataFormat:A,compressed:!1,data:n,width:P,height:S});P=C.width,S=C.height,A=C.dataFormat,this.width=P,this.height=S,this.depth=k,this.format=o,this.type=u,this.dataFormat=A,this.border=f,this.textureUnit=_,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var M=Object(c.a)({},37440,x),j=Object.assign({},M,m);return E&&this._isNPOT()&&(O.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),E=!1,this._updateForNPOT(p)),this.mipmaps=E,this.setImageData({data:n,width:P,height:S,depth:k,format:o,type:u,dataFormat:A,border:f,mipmaps:E,parameters:j}),E&&this.generateMipmap(),this.setParameters(p),d&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:!1}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindTexture(this.target,this.handle),F(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,v=void 0===d?{}:d,p=e.data,g=void 0===p?null:p,m=e.type,y=void 0===m?this.type:m,_=e.width,b=void 0===_?this.width:_,x=e.height,w=void 0===x?this.height:x,E=e.dataFormat,P=void 0===E?this.dataFormat:E,O=e.compressed,S=void 0!==O&&O;g||(g=r);var A=this._deduceParameters({format:u,type:y,dataFormat:P,compressed:S,data:g,width:b,height:w});y=A.type,P=A.dataFormat,S=A.compressed,b=A.width,w=A.height;var T=this.gl;T.bindTexture(this.target,this.handle);var k,C=this._getDataType({data:g,compressed:S});if(g=C.data,k=C.dataType,F(this.gl,v,function(){switch(k){case"null":T.texImage2D(n,o,u,b,w,l,P,y,g);break;case"typed-array":T.texImage2D(n,o,u,b,w,l,P,y,g,h);break;case"buffer":de(T),T.bindBuffer(35052,g.handle||g),T.texImage2D(n,o,u,b,w,l,P,y,h),T.bindBuffer(35052,null);break;case"browser-object":fe(T)?T.texImage2D(n,o,u,b,w,l,P,y,g):T.texImage2D(n,o,u,P,y,g);break;case"compressed":T.compressedTexImage2D(n,o,u,b,w,l,g);break;default:Z(!1,"Unknown image data type")}}),g&&g.byteLength)this._trackAllocatedMemory(g.byteLength,"Texture");else{var M=ze[this.dataFormat]||4,j=Ve[this.type]||1;this._trackAllocatedMemory(this.width*this.height*M*j,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,v=e.height,p=void 0===v?this.height:v,g=e.level,m=void 0===g?0:g,y=e.format,_=void 0===y?this.format:y,b=e.type,x=void 0===b?this.type:b,w=e.dataFormat,E=void 0===w?this.dataFormat:w,P=e.compressed,O=void 0!==P&&P,S=e.offset,A=void 0===S?0:S,T=e.border,k=(void 0===T&&this.border,e.parameters),C=void 0===k?{}:k,M=this._deduceParameters({format:_,type:x,dataFormat:E,compressed:O,data:s,width:d,height:p});if(x=M.type,E=M.dataFormat,O=M.compressed,d=M.width,p=M.height,Z(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var j=s;s=j.data,d=j.shape[0],p=j.shape[1]}s instanceof Be&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),F(this.gl,C,function(){O?t.gl.compressedTexSubImage2D(i,m,c,f,d,p,_,s):null===s?t.gl.texSubImage2D(i,m,c,f,d,p,E,x,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,m,c,f,d,p,E,x,s,A):s instanceof G?(de(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,m,c,f,d,p,E,x,A),t.gl.bindBuffer(35052,null)):fe(t.gl)?t.gl.texSubImage2D(i,m,c,f,d,p,E,x,s):t.gl.texSubImage2D(i,m,c,f,E,x,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return O.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof Be?{data:t.handle,dataType:"buffer"}:t instanceof G?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=Ue[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return Z(i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},"Could not deduced texture size"),Z(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Z(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Z(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!fe(this.gl)&&(!(!this.width||!this.height)&&(!Q(this.width)||!Q(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===Ge.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(Ae),He="";function Xe(e){He=e}function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z("string"==typeof e),e=He+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function Ze(e,t){return Z("string"==typeof e),e=He+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}var qe=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),he(e),(r instanceof Promise||"string"==typeof r)&&(r={data:r}),"string"==typeof r.data&&(r=Object.assign({},r,{data:Ze(r.data)})),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({},r,{target:3553})))).initialize(r),Object.seal(Object(Pe.a)(n)),n}return Object(Oe.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e,t){return We.isSupported(e,t)}}]),t}(We),Ke=n(42),Qe=n.n(Ke),Je=n(63),$e=[34069,34070,34071,34072,34073,34074],et=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),he(e),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({},r,{target:34067})))).initialize(r),Object.seal(Object(Pe.a)(n)),n}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(Je.a)(Qe.a.mark(function e(t){var n,i,r,a,o,s,u,c,l,f,h,d,v,p=this;return Qe.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,r=t.pixels,a=t.data,o=t.border,s=void 0===o?0:o,u=t.format,c=void 0===u?6408:u,l=t.type,f=void 0===l?5121:l,h=this.gl,d=r||a,e.next=5,Promise.all($e.map(function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:v=e.sent,this.bind(),$e.forEach(function(e,t){v[t].length>1&&!1!==p.opts.mipmaps&&O.warn("".concat(p.id," has mipmap and multiple LODs."))(),v[t].forEach(function(t,r){n&&i?h.texImage2D(e,r,c,n,i,s,c,f,t):h.texImage2D(e,r,c,c,f,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(We);et.FACES=$e;var tt,nt=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),de(e),r=Object.assign({depth:1},r,{target:32879,unpackFlipY:!1}),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(Pe.a)(n)),n}return Object(Oe.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return fe(e)}}]),Object(r.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,c=void 0===u?1:u,l=e.border,f=void 0===l?0:l,h=e.format,d=e.type,v=void 0===d?5121:d,p=e.offset,g=void 0===p?0:p,m=e.data,y=e.parameters,_=void 0===y?{}:y;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),F(this.gl,_,function(){ArrayBuffer.isView(m)&&t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,m),m instanceof Be&&(t.gl.bindBuffer(35052,m.handle),t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,g))}),m&&m.byteLength)this._trackAllocatedMemory(m.byteLength,"Texture");else{var b=ze[this.dataFormat]||4,x=Ve[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*b*x,"Texture")}return this.loaded=!0,this}}]),t}(We),it="EXT_color_buffer_float",rt=(tt={},Object(c.a)(tt,33189,{bpp:2}),Object(c.a)(tt,33190,{gl2:!0,bpp:3}),Object(c.a)(tt,36012,{gl2:!0,bpp:4}),Object(c.a)(tt,36168,{bpp:1}),Object(c.a)(tt,34041,{bpp:4}),Object(c.a)(tt,35056,{gl2:!0,bpp:4}),Object(c.a)(tt,36013,{gl2:!0,bpp:5}),Object(c.a)(tt,32854,{bpp:2}),Object(c.a)(tt,36194,{bpp:2}),Object(c.a)(tt,32855,{bpp:2}),Object(c.a)(tt,33321,{gl2:!0,bpp:1}),Object(c.a)(tt,33330,{gl2:!0,bpp:1}),Object(c.a)(tt,33329,{gl2:!0,bpp:1}),Object(c.a)(tt,33332,{gl2:!0,bpp:2}),Object(c.a)(tt,33331,{gl2:!0,bpp:2}),Object(c.a)(tt,33334,{gl2:!0,bpp:4}),Object(c.a)(tt,33333,{gl2:!0,bpp:4}),Object(c.a)(tt,33323,{gl2:!0,bpp:2}),Object(c.a)(tt,33336,{gl2:!0,bpp:2}),Object(c.a)(tt,33335,{gl2:!0,bpp:2}),Object(c.a)(tt,33338,{gl2:!0,bpp:4}),Object(c.a)(tt,33337,{gl2:!0,bpp:4}),Object(c.a)(tt,33340,{gl2:!0,bpp:8}),Object(c.a)(tt,33339,{gl2:!0,bpp:8}),Object(c.a)(tt,32849,{gl2:!0,bpp:3}),Object(c.a)(tt,32856,{gl2:!0,bpp:4}),Object(c.a)(tt,32857,{gl2:!0,bpp:4}),Object(c.a)(tt,36220,{gl2:!0,bpp:4}),Object(c.a)(tt,36238,{gl2:!0,bpp:4}),Object(c.a)(tt,36975,{gl2:!0,bpp:4}),Object(c.a)(tt,36214,{gl2:!0,bpp:8}),Object(c.a)(tt,36232,{gl2:!0,bpp:8}),Object(c.a)(tt,36226,{gl2:!0,bpp:16}),Object(c.a)(tt,36208,{gl2:!0,bpp:16}),Object(c.a)(tt,33325,{gl2:it,bpp:2}),Object(c.a)(tt,33327,{gl2:it,bpp:4}),Object(c.a)(tt,34842,{gl2:it,bpp:8}),Object(c.a)(tt,33326,{gl2:it,bpp:4}),Object(c.a)(tt,33328,{gl2:it,bpp:8}),Object(c.a)(tt,34836,{gl2:it,bpp:16}),Object(c.a)(tt,35898,{gl2:it,bpp:4}),tt);var at,ot=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(Pe.a)(n)),n}return Object(Oe.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=fe(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,rt)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Z(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&fe(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*rt[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(Ae),st=256,ut=1024,ct=16384,lt=6144,ft=6145,ht=6146,dt=34041,vt="clear: bad arguments";function pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.color,a=void 0===r?null:r,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};i&&(l.framebuffer=i);var f=0;a&&(f|=ct,!0!==a&&(l.clearColor=a)),s&&(f|=st,!0!==s&&(l.clearDepth=s)),c&&(f|=ut,!0!==s&&(l.clearStencil=s)),Z(0!==f,vt),F(e,l,function(){e.clear(f)})}function gt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.buffer,a=void 0===r?lt:r,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;de(e),F(e,{framebuffer:i},function(){switch(a){case lt:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case ft:e.clearBufferfv(ft,0,[c]);break;case ht:e.clearBufferiv(ht,0,[c]);break;case dt:var t=Object(C.a)(c,2),n=t[0],i=t[1];e.clearBufferfi(dt,0,n,i);break;default:Z(!1,vt)}})}function mt(e){switch(e){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 Z(!1),0}}function yt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,p=Pt(e),g=p.framebuffer,m=p.deleteFramebuffer;Z(g);var y=g.gl,_=g.handle,b=g.attachments;h=h||g.width,d=d||g.height,36064===c&&null===_&&(c=1028),Z(b[c]),f=function(e,t,n,i,r){if(e)return e;var a=ye(t=t||5121,{clamped:!1}),o=mt(n);return new a(i*r*o)}(f,v=v||b[c].type,s,h,d),v=v||me(f);var x=y.bindFramebuffer(36160,_);return y.readPixels(i,a,h,d,s,v,f),y.bindFramebuffer(36160,x||null),m&&g.delete(),f}function _t(e,t){var n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.target,c=void 0===u?null:u,l=t.targetByteOffset,f=void 0===l?0:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,p=Pt(e),g=p.framebuffer,m=p.deleteFramebuffer;Z(g);var y=g.gl;if(h=h||g.width,d=d||g.height,de(y),v=v||(c?c.type:5121),!c){var _=mt(s),b=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Z(!1),0}}(v);c=new Be(y,{byteLength:f+h*d*_*b,accessor:{type:v,size:_}})}return c.bind({target:35051}),F(y,{framebuffer:g},function(){y.readPixels(i,a,h,d,s,v,f)}),c.unbind({target:35051}),m&&g.delete(),c}function bt(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=yt(e,{sourceAttachment:i}),s=e.width,u=e.height;u>a;){var c=_e({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}!function(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=bt(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function wt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,a=n.sourceY,o=void 0===a?0:a,s=n.targetX,u=n.targetY,c=n.targetZ,l=n.targetMipmaplevel,f=void 0===l?0:l,h=n.targetInternalFormat,d=void 0===h?6408:h,v=n.width,p=n.height,g=Pt(e),m=g.framebuffer,y=g.deleteFramebuffer;Z(m);var _=m.gl,b=m.handle,x=void 0!==s||void 0!==u||void 0!==c;s=s||0,u=u||0,c=c||0;var w=_.bindFramebuffer(36160,b);Z(t);var E=null;if(t instanceof We&&(E=t,v=Number.isFinite(v)?v:E.width,p=Number.isFinite(p)?p:E.height,E.bind(0),t=E.target),x)switch(t){case 3553:case 34067:_.copyTexSubImage2D(t,f,s,u,r,o,v,p);break;case 35866:case 32879:_.copyTexSubImage3D(t,f,s,u,c,r,o,v,p)}else _.copyTexImage2D(t,f,d,r,o,v,p,0);return E&&E.unbind(),_.bindFramebuffer(36160,w||null),y&&m.delete(),E}function Et(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,s=n.sourceY0,u=void 0===s?0:s,c=n.sourceX1,l=n.sourceY1,f=n.targetX0,h=void 0===f?0:f,d=n.targetY0,v=void 0===d?0:d,p=n.targetX1,g=n.targetY1,m=n.color,y=void 0===m||m,_=n.depth,b=void 0!==_&&_,x=n.stencil,w=void 0!==x&&x,E=n.mask,P=void 0===E?0:E,S=n.filter,A=void 0===S?9728:S,T=Pt(e),k=T.framebuffer,C=T.deleteFramebuffer,M=Pt(t),j=M.framebuffer,L=M.deleteFramebuffer;Z(k),Z(j);var R=j.gl,I=j.handle,F=j.width,N=j.height,D=j.readBuffer;de(R),k.handle||36064!==r||(r=1028),y&&(P|=16384),b&&(P|=256),w&&(P|=1024),(C||L)&&1280&P&&(P=16384,O.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Z(P),c=void 0===c?k.width:c,l=void 0===l?k.height:l,p=void 0===p?F:p,g=void 0===g?N:g;var B=R.bindFramebuffer(36009,I),U=R.bindFramebuffer(36008,k.handle);return R.readBuffer(r),R.blitFramebuffer(o,u,c,l,h,v,p,g,P,A),R.readBuffer(D),R.bindFramebuffer(36008,U||null),R.bindFramebuffer(36009,B||null),C&&k.delete(),L&&j.delete(),j}function Pt(e){return e instanceof Dt?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,i=t.gl,r=t.width,a=t.height,o=t.id,s=new Dt(i,Object.assign({},n,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(c.a)({},36064,t)})),s),deleteFramebuffer:!0};var t,n,i,r,a,o,s}var Ot,St=(at={},Object(c.a)(at,33902,{gl1:new Float32Array([1,1])}),Object(c.a)(at,33901,{gl1:new Float32Array([1,1])}),Object(c.a)(at,3379,{gl1:64,gl2:2048}),Object(c.a)(at,34076,{gl1:16}),Object(c.a)(at,34930,{gl1:8}),Object(c.a)(at,35661,{gl1:8}),Object(c.a)(at,35660,{gl1:0}),Object(c.a)(at,34024,{gl1:1}),Object(c.a)(at,36348,{gl1:8}),Object(c.a)(at,34921,{gl1:8}),Object(c.a)(at,36347,{gl1:128}),Object(c.a)(at,36349,{gl1:16}),Object(c.a)(at,3386,{gl1:new Int32Array([0,0])}),Object(c.a)(at,32883,{gl1:0,gl2:256}),Object(c.a)(at,35071,{gl1:0,gl2:256}),Object(c.a)(at,37447,{gl1:0,gl2:0}),Object(c.a)(at,36063,{gl1:0,gl2:4}),Object(c.a)(at,35379,{gl1:0,gl2:0}),Object(c.a)(at,35374,{gl1:0,gl2:0}),Object(c.a)(at,35377,{gl1:0,gl2:0}),Object(c.a)(at,34852,{gl1:0,gl2:4}),Object(c.a)(at,36203,{gl1:0,gl2:0}),Object(c.a)(at,33001,{gl1:0,gl2:0}),Object(c.a)(at,33e3,{gl1:0,gl2:0}),Object(c.a)(at,37157,{gl1:0,gl2:0}),Object(c.a)(at,35373,{gl1:0,gl2:0}),Object(c.a)(at,35657,{gl1:0,gl2:0}),Object(c.a)(at,36183,{gl1:0,gl2:0}),Object(c.a)(at,37137,{gl1:0,gl2:0}),Object(c.a)(at,34045,{gl1:0,gl2:0}),Object(c.a)(at,35978,{gl1:0,gl2:0}),Object(c.a)(at,35979,{gl1:0,gl2:0}),Object(c.a)(at,35968,{gl1:0,gl2:0}),Object(c.a)(at,35376,{gl1:0,gl2:0}),Object(c.a)(at,35375,{gl1:0,gl2:0}),Object(c.a)(at,35659,{gl1:0,gl2:0}),Object(c.a)(at,37154,{gl1:0,gl2:0}),Object(c.a)(at,35371,{gl1:0,gl2:0}),Object(c.a)(at,35658,{gl1:0,gl2:0}),Object(c.a)(at,35076,{gl1:0,gl2:-8,negative:!0}),Object(c.a)(at,35077,{gl1:0,gl2:7}),Object(c.a)(at,35380,{gl1:0,gl2:0}),at);function At(e){if(e.luma=e.luma||{},!e.luma.limits){e.luma.limits={},e.luma.webgl1MinLimits={},e.luma.webgl2MinLimits={};var t=fe(e);for(var n in St){var i=St[n],r=i.gl1,a="gl2"in i?i.gl2:i.gl1,o=t?a:r,s="gl2"in i&&!t||"extension"in i&&!e.getExtension(i.extension)?o:e.getParameter(n);e.luma.limits[n]=s,e.luma.webgl1MinLimits[n]=r,e.luma.webgl2MinLimits[n]=a}}return e.luma.limits}function Tt(e){e.luma=e.luma||{};var t,n=se(e);e.luma.info||(e.luma.info=(t={},Object(c.a)(t,37445,n.vendor),Object(c.a)(t,37446,n.renderer),Object(c.a)(t,7936,n.vendorMasked),Object(c.a)(t,7937,n.rendererMasked),Object(c.a)(t,7938,n.version),Object(c.a)(t,35724,n.shadingLanguageVersion),t));return e.luma.info}function kt(e){return Object.assign(se(e),{limits:At(e),info:Tt(e),webgl1MinLimits:e.luma.webgl1MinLimits,webgl2MinLimits:e.luma.webgl2MinLimits})}var Ct={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",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"},Mt=(Ot={},Object(c.a)(Ot,Ct.WEBGL2,[function(e){return fe(e)}]),Object(c.a)(Ot,Ct.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(c.a)(Ot,Ct.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(c.a)(Ot,Ct.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(c.a)(Ot,Ct.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(c.a)(Ot,Ct.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(c.a)(Ot,Ct.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(c.a)(Ot,Ct.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(c.a)(Ot,Ct.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(c.a)(Ot,Ct.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(c.a)(Ot,Ct.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(c.a)(Ot,Ct.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(c.a)(Ot,Ct.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(c.a)(Ot,Ct.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(c.a)(Ot,Ct.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(c.a)(Ot,Ct.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(c.a)(Ot,Ct.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(c.a)(Ot,Ct.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(c.a)(Ot,Ct.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(c.a)(Ot,Ct.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(c.a)(Ot,Ct.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),Ot);function jt(e,t){return Lt(e,t)}function Lt(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return It(e,t)})}function Rt(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=fe(e),Mt)e.luma.caps[t]=It(e,t);return e.luma.caps}function It(e,t){var n=Mt[t];Z(n,t);var i,r=fe(e)&&n[1]||n[0];if("function"==typeof r)i=r(e);else if(Array.isArray(r)){i=!0;var a=!0,o=!1,s=void 0;try{for(var u,c=r[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i=i&&Boolean(e.getExtension(l))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}else"string"==typeof r?i=Boolean(e.getExtension(r)):"boolean"==typeof r?i=r:Z(!1);return i}var Ft={};function Nt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Mt[t];if(Z(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in Ft)return Ft[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),Ft[t]=s,s}var Dt=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,r))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(r),Object.seal(Object(Pe.a)(n)),n}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(fe(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(fe(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,p=e.readBuffer,g=e.drawBuffers;if(Z(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:p,drawBuffers:g}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Z(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&O.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,r=void 0!==i&&i,a=n.resizeAttachments,o=void 0===a||a,s={};r&&Object.keys(this.attachments).forEach(function(e){s[e]=null}),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){Z(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof ot)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=Object(C.a)(f,3),v=d[0],p=d[1],g=void 0===p?0:p,m=d[2],y=void 0===m?0:m;h=v,this._attachTexture({attachment:l,texture:v,layer:g,level:y})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(function(e){return(Dt.STATUS||{})[e]||"Framebuffer error ".concat(e)}(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&pt(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){gt({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return O.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return O.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return O.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return O.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return O.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return O.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;de(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=xe(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?xe(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>O.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=bt(this,{maxHeight:100});return O.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,i,r){var a,o=null;e&&((o=o||{})[36064]=new qe(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:(a={},Object(c.a)(a,10241,9728),Object(c.a)(a,10240,9728),Object(c.a)(a,10242,33071),Object(c.a)(a,10243,33071),a)}));return t&&n?(o=o||{})[33306]=new ot(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}):t?(o=o||{})[36096]=new ot(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}):n&&Z(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof ot?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Z(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;fe(t)?t.readBuffer(e):Z(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(fe(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Z(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=Rt(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(Ae);function Bt(e,t){Z(e instanceof qe||e instanceof et||e instanceof nt);var n=e.constructor,i=e.gl,r=e.width,a=e.height,o=e.format,s=e.type,u=e.dataFormat,c=e.border,l=e.mipmaps;return new n(i,Object.assign({width:r,height:a,format:o,type:s,dataFormat:u,border:c,mipmaps:l},t))}Dt.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];function Ut(e){return Boolean(e&&2===e._version)}var zt={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Vt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(zt,{width:1,height:1},e)}function Gt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},zt,t),i=n.width,r=n.height;function o(e){if(t.throwOnError)throw new Error(e);return null}a.a?e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(oe({canvas:t.canvas,width:i,height:r,onError:o}),t):e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,a=e.onError;if(r&&!i)return a("headless-gl does not support WebGL2");if(!B)return a(X);var o=B(t,n,e);return o||a(Y)}(H({},t,{width:i,height:r,onError:o}));return e?(function(e){var t=Ut(e)?"WebGL2":"WebGL1",n=se(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";O.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=Wt(e,t)),e):null}function Wt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==W&&e instanceof W)return 2;return 1}(e);var n=t=Object.assign({},zt,t),i=n.manageState,r=n.debug;return i&&Object(R.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}function Yt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}var Zt=35632,qt=35633;function Kt(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Yt(t)||"(unnamed)",u="".concat(function(e){switch(e){case Zt:return"fragment";case qt:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=Jt(a,r-o);return s+n+e})}(t);return{shaderName:u,errors:Qt(a,v),warnings:Qt(o,v)}}function Qt(e,t){for(var n="",i=0;i=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}var en,tn="Shader: GLSL source code must be a JavaScript string",nn=function(e){function t(e,n){var r;Object(i.a)(this,t),he(e),Z("string"==typeof n.source,tn);var a=Yt(n.source,null)||n.id||K("unnamed ".concat(t.getTypeName(n.shaderType)));return(r=Object(we.a)(this,Object(Ee.a)(t).call(this,e,{id:a}))).shaderType=n.shaderType,r.source=n.source,r.initialize(n),r}return Object(Oe.a)(t,e),Object(r.a)(t,null,[{key:"getTypeName",value:function(e){switch(e){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Z(!1),"unknown"}}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.source,n=Yt(t,null);n&&(this.id=K(n)),this._compile(t)}},{key:"getParameter",value:function(e){return this.gl.getShaderParameter(this.handle,e)}},{key:"toString",value:function(){return"".concat(t.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return Yt(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var e=this.gl.getExtension("WEBGL.debug_shaders");return e?e.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL.debug_shaders not implemented"}},{key:"_compile",value:function(){if(this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){var e=Kt(this.gl.getShaderInfoLog(this.handle),this.source,this.shaderType,this.id),t=e.shaderName,n=e.errors,i=e.warnings;throw O.error("GLSL compilation errors in ".concat(t,"\n").concat(n))(),O.warn("GLSL compilation warnings in ".concat(t,"\n").concat(i))(),new Error("GLSL compilation errors in ".concat(t))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}]),t}(Ae),rn=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({},n,{shaderType:35633})))}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),t}(nn),an=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({},n,{shaderType:35632})))}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),t}(nn);function on(e,t,n){return(on="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(Ee.a)(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}var sn,un=(en={},Object(c.a)(en,5126,function(e,t,n){return e.uniform1fv(t,vn(n,1))}),Object(c.a)(en,35664,function(e,t,n){return e.uniform2fv(t,vn(n,2))}),Object(c.a)(en,35665,function(e,t,n){return e.uniform3fv(t,vn(n,3))}),Object(c.a)(en,35666,function(e,t,n){return e.uniform4fv(t,vn(n,4))}),Object(c.a)(en,5124,function(e,t,n){return e.uniform1iv(t,pn(n,1))}),Object(c.a)(en,35667,function(e,t,n){return e.uniform2iv(t,pn(n,2))}),Object(c.a)(en,35668,function(e,t,n){return e.uniform3iv(t,pn(n,3))}),Object(c.a)(en,35669,function(e,t,n){return e.uniform4iv(t,pn(n,4))}),Object(c.a)(en,35670,function(e,t,n){return e.uniform1iv(t,pn(n,1))}),Object(c.a)(en,35671,function(e,t,n){return e.uniform2iv(t,pn(n,2))}),Object(c.a)(en,35672,function(e,t,n){return e.uniform3iv(t,pn(n,3))}),Object(c.a)(en,35673,function(e,t,n){return e.uniform4iv(t,pn(n,4))}),Object(c.a)(en,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,vn(n,4))}),Object(c.a)(en,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,vn(n,9))}),Object(c.a)(en,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,vn(n,16))}),Object(c.a)(en,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,5125,function(e,t,n){return e.uniform1uiv(t,gn(n,1))}),Object(c.a)(en,36294,function(e,t,n){return e.uniform2uiv(t,gn(n,2))}),Object(c.a)(en,36295,function(e,t,n){return e.uniform3uiv(t,gn(n,3))}),Object(c.a)(en,36296,function(e,t,n){return e.uniform4uiv(t,gn(n,4))}),Object(c.a)(en,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,vn(n,6))}),Object(c.a)(en,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,vn(n,8))}),Object(c.a)(en,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,vn(n,6))}),Object(c.a)(en,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,vn(n,12))}),Object(c.a)(en,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,vn(n,8))}),Object(c.a)(en,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,vn(n,12))}),Object(c.a)(en,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36311,function(e,t,n){return e.uniform1i(t,n)}),en),cn={},ln={},fn={},hn=[0];function dn(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(hn[0]=e,e=hn);var r=e.length;if(r%t&&O.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(fe(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",Dn),n._isCached=!1,n.initialize(r),Object.seal(Object(Pe.a)(n)),n._setId(r.id),n}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new rn(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new an(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,Z(this.vs instanceof rn),Z(this.fs instanceof an),this.uniforms={},i&&(de(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Nn(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:on(Object(Ee.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,f=void 0!==l&&l,h=e.indexType,d=void 0===h?5123:h,v=e.isInstanced,p=void 0!==v&&v,g=e.instanceCount,m=void 0===g?0:g,y=e.vertexArray,_=void 0===y?null:y,b=e.transformFeedback,x=e.framebuffer,w=e.parameters,E=void 0===w?{}:w,P=e.uniforms,S=e.samplers;if((P||S)&&(O.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(P||{})),void 0!==n){var A=x?x.id:"default",T="mode=".concat(xe(this.gl,r)," verts=").concat(a," ")+"instances=".concat(m," indexType=").concat(xe(this.gl,d)," ")+"isInstanced=".concat(p," isIndexed=").concat(f," ")+"Framebuffer=".concat(A);O.log(n,T)()}return Z(_),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(_.bindForDraw(a,m,function(){if(void 0!==x&&(E=Object.assign({},E,{framebuffer:x})),b){var e=Rn(r);b.begin(e)}t._bindTextures(),F(t.gl,E,function(){f&&p?t.gl.drawElementsInstanced(r,a,d,s,m):f&&fe(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):f?t.gl.drawElements(r,a,d,s):p?t.gl.drawArraysInstanced(r,s,a,m):t.gl.drawArrays(r,s,a)}),b&&b.end()}),!0)}},{key:"setUniforms",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=!1,r={};for(var a in t)bn(this.uniforms[a],t[a])||(i=!0,r[a]=t[a],this.uniforms[a]=(e=t[a],Array.isArray(e)||ArrayBuffer.isView(e)?e.slice():e));return i&&(n(),function(e,t,n){for(var i in e){var r=e[i];if((!n||Boolean(n[i]))&&!_n(r))throw t=t?"".concat(t," "):"",console.error("".concat(t," Bad uniform ").concat(i),r),new Error("".concat(t," Bad uniform ").concat(i))}}(r,this.id,this._uniformSetters),this._setUniforms(r)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof Dt)i=i.texture;if(i instanceof We)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof Dt&&(n=n.texture),n instanceof We)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof Dt&&(n=n.texture),n instanceof We){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new rn({handle:u});break;case 35632:n.fs=new an({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=K(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),O.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),O.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||O.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,r))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(Pe.a)(n)),n}return Object(Oe.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=fe(e),i=Lt(e,Ct.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Z(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(r.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(Ae),zn=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),de(e),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,r))).initialize(r),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(Pe.a)(n)),n}return Object(Oe.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return fe(e)}}]),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,J(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,O.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof Be==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(Ae),Vn=null;function Gn(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!Vn||Vn.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var a=r.id||r.program&&r.program.id;return(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({},r,{id:a})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(r),Object.seal(Object(Pe.a)(n)),n}return Object(Oe.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?fe(e)||"Chrome"===function(e){if(!e&&!Object(l.a)())return"Node";if(Object(Wn.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":y.b.chrome?"Chrome":y.b.safari?"Safari":y.b.mozInnerScreenX?"Firefox":"Unknown"}():fe(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Z(!1)}}}]),Object(r.a)(t,[{key:"delete",value:function(){on(Object(Ee.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Z(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Z(fe(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new Be(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=Gn(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=Hn.isSupported(t)?new Hn(t):Hn.getDefaultArray(t),ee(this,"VertexArray","v6.0",Yn),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new Be(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof Be){var a=n;if(r){var o=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,o)}else{var s=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,s)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return O.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}(),qn=5126,Kn=5124,Qn=5125,Jn=function(){function e(t){var n;for(var r in Object(i.a)(this,e),this.layout={},this.size=0,t)this._addUniform(r,t[r]);this.size+=(4-this.size%4)%4;var a=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,qn,a),Object(c.a)(n,Kn,new Int32Array(a.buffer)),Object(c.a)(n,Qn,new Uint32Array(a.buffer)),n)}return Object(r.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[qn]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Z(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=In(t);Z(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}();function $n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,i=e.program,r=e.uniforms,a=e.undefinedOnly,o=void 0!==a&&a;Z(i);var s=i._uniformSetters,u={},l=Object.keys(s).sort(),f=0,h=!0,d=!1,v=void 0;try{for(var p,g=l[Symbol.iterator]();!(h=(p=g.next()).done);h=!0){var m=p.value;m.match(".*_.*")||m.match(".*Matrix")||ei({table:u,header:n,uniforms:r,uniformName:m,undefinedOnly:o})&&f++}}catch(e){d=!0,v=e}finally{try{h||null==g.return||g.return()}finally{if(d)throw v}}var y=!0,_=!1,b=void 0;try{for(var x,w=l[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var E=x.value;E.match(".*Matrix")&&ei({table:u,header:n,uniforms:r,uniformName:E,undefinedOnly:o})&&f++}}catch(e){_=!0,b=e}finally{try{y||null==w.return||w.return()}finally{if(_)throw b}}var P=!0,O=!1,S=void 0;try{for(var A,T=l[Symbol.iterator]();!(P=(A=T.next()).done);P=!0){var k=A.value;u[k]||ei({table:u,header:n,uniforms:r,uniformName:k,undefinedOnly:o})&&f++}}catch(e){O=!0,S=e}finally{try{P||null==T.return||T.return()}finally{if(O)throw S}}var C=0,M={};if(!o)for(var j in r){var L=r[j];u[j]||(C++,M[j]=Object(c.a)({Type:"NOT USED: ".concat(L)},n,$(L)))}return{table:u,count:f,unusedTable:M,unusedCount:C}}function ei(e){var t,n=e.table,i=e.header,r=e.uniforms,a=e.uniformName,o=e.undefinedOnly,s=r[a],u=function(e){return null!=e}(s);return(!o||!u)&&(n[a]=(t={},Object(c.a)(t,i,u?$(s):"N/A"),Object(c.a)(t,"Uniform Type",u?s:"NOT PROVIDED"),t),!0)}function ti(e,t,n,i){var r,a,o,s,u=e.gl,l="NOT PROVIDED",f="N/A",h="N/A",d="N/A";if(n&&(l=n.type,f=n.size,a=-1!==(l=String(l).replace("Array","")).indexOf("nt")),t instanceof Be){var v,p,g=t,m=g.getDebugData(),y=m.data;if(o=m.modified?"*":"",s=y,h=(d=g.byteLength)/y.BYTES_PER_ELEMENT/f,n){var _=n.divisor>0;p="".concat(_?"I ":"P "," ").concat(h," (x").concat(f,"=").concat(d," bytes ").concat(xe(u,l),")")}else a=!0,p="".concat(d," bytes");return v={},Object(c.a)(v,i,"".concat(o).concat($(s,{size:f,isInteger:a}))),Object(c.a)(v,"Format ",p),v}return s=t,f=t.length,a=-1!==(l=String(t.constructor.name).replace("Array","")).indexOf("nt"),r={},Object(c.a)(r,i,"".concat($(s,{size:f,isInteger:a})," (constant)")),Object(c.a)(r,"Format ","".concat(f,"x").concat(l," (constant)")),r}function ni(e,t){var n=Fn(t.type,t.size);return n?"".concat(e," (").concat(n.name,")"):e}function ii(e){var t=e.accessor,n=Fn(t.type,t.size);return n?"".concat(n.name," ").concat(e.name):e.name}var ri={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ai=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id,r=void 0===n?K("geometry"):n,a=t.drawMode,o=void 0===a?ri.TRIANGLES:a,s=t.mode,u=t.attributes,c=void 0===u?{}:u,l=t.indices,f=void 0===l?null:l,h=t.vertexCount,d=void 0===h?null:h;this.id=r,this.drawMode=0|o||0|s,this.attributes={},this.userData={},this._setAttributes(c,f),this.vertexCount=d||this._calculateVertexCount(this.attributes,this.indices)}return Object(r.a)(e,null,[{key:"DRAW_MODE",get:function(){return ri}}]),Object(r.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?H({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Z(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"indices"===n?(Z(!this.indices),this.indices=i,void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed)):this.attributes[n]=i}return this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}if(!Number.isFinite(n)){var s=e.POSITION||e.positions;s&&(n=s.value&&s.value.length/(s.size||3))}return Z(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}(),oi=function e(){Object(i.a)(this,e)},si=n(48),ui=[255,255,255],ci=[0,0,1],li=[0,0,-1],fi=[0,0,1],hi=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e),this.id=t.id||K("light");var n=t.color,r=void 0===n?ui:n;this.color=r;var a=t.intensity,o=void 0===a?1:a;this.intensity=o},di=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object(we.a)(this,Object(Ee.a)(t).call(this,n))).type="ambient",e}return Object(Oe.a)(t,e),t}(hi),vi=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object(we.a)(this,Object(Ee.a)(t).call(this,n))).type="directional";var r=n.direction,a=void 0===r?li:r;return e.direction=new si.a(a).normalize().toArray(),e}return Object(Oe.a)(t,e),t}(hi),pi=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object(we.a)(this,Object(Ee.a)(t).call(this,n))).type="point";var r=n.position,a=void 0===r?fi:r;return e.position=a,e.attenuation=e._getAttenuation(n),e}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:ci}}]),t}(hi),gi=0,mi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.onCreateContext,r=void 0===n?function(e){return Gt(e)}:n,a=t.onAddHTML,o=void 0===a?null:a,s=t.onInitialize,u=void 0===s?function(){}:s,c=t.onRender,l=void 0===c?function(){}:c,f=t.onFinalize,h=void 0===f?function(){}:f,d=t.gl,v=void 0===d?null:d,p=t.glOptions,g=void 0===p?{}:p,m=t.debug,y=void 0!==m&&m,_=t.createFramebuffer,b=void 0!==_&&_,x=t.autoResizeViewport,w=void 0===x||x,E=t.autoResizeDrawingBuffer,P=void 0===E||E,S=t.stats,A=void 0===S?T.get("animation-loop-".concat(gi++)):S,k=t.useDevicePixels,C=void 0===k||k;"useDevicePixelRatio"in t&&(O.deprecated("useDevicePixelRatio","useDevicePixels")(),C=t.useDevicePixelRatio),this.props={onCreateContext:r,onAddHTML:o,onInitialize:u,onRender:l,onFinalize:h,gl:v,glOptions:g,debug:y,createFramebuffer:b},this.gl=v,this.needsRedraw=null,this.timeline=null,this.stats=A,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:w,autoResizeDrawingBuffer:P,useDevicePixels:C}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Z("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,ae().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=Un.isSupported(e.gl,["timers"])?new Un(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),pe(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(Je.a)(Qe.a.mark(function e(){return Qe.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return O.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;pe(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||ve(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(s.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Wt(this.props.gl,e):this.onCreateContext(e),!le(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(k.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas,r=i.clientWidth,a=i.clientHeight;return r>0&&a>0?n=r/a:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Xt(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new Dt(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()&&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(){this.gl.canvas.addEventListener("mousemove",this._onMousemove),this.gl.canvas.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}}]),e}(),yi=new Uint8Array([0,0,0]);function _i(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function bi(e){var t=Object(C.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function xi(){return yi}var wi={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Ei(e,t){var n=(t||{}).attributeMap,i=void 0===n?wi:n;return i&&i[e]||e}function Pi(e,t){var n;switch(e){case"indices":n=n||"indices";break;case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2;break;case"indices":t.size=t.size||1,t.isIndexed=void 0===t.isIndexed||t.isIndexed,Z(t.value instanceof Uint16Array||t.value instanceof Uint32Array,'attribute array for "indices" must be of integer type')}Z(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var Oi=n(26),Si=n(100),Ai=n(31),Ti=n.n(Ai),ki={},Ci=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},Mi=new Map;Ti.a.listenFor("luma.gl",function(e){var t=ki[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){o.d.__SEER_INITIALIZED__&&(Mi.has(e)||Mi.set(e,new Map),Mi.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();Ci(i,n,e.value),t.setUniforms(i)}});var ji,Li=["renderPickingBuffer","pickingEnabled"],Ri=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Z(le(t));var r=n.id,a=void 0===r?K("base-model"):r;this.id=a,this.gl=t,this.id=n.id||K("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(r.a)(e,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props={},this.program=this._createProgram(e),this.vertexArray=new Zn(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete ki[t],Ti.a.deleteItem("luma.gl",t)}},{key:"destroy",value:function(){this.delete()}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.getUniforms()}},{key:"setUniforms",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),function(e,t){if(o.d.__SEER_INITIALIZED__&&e){var n=Mi.get(e);n&&n.forEach(function(e,n){Ci(t,n,e)})}}(this.id,t),t=this._extractAnimatedUniforms(t),this.program.setUniforms(t,function(){e._checkForDeprecatedUniforms(t)}),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return pt(this.program.gl,e),this}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,s=t.attributes,u=void 0===s?{}:s,c=t.transformFeedback,l=void 0===c?this.transformFeedback:c,f=t.parameters,h=void 0===f?{}:f,d=t.vertexArray,v=void 0===d?this.vertexArray:d,p=t.animationProps;ki[(e=this).id]||(ki[e.id]=e,Ti.a.listItem("luma.gl",e.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(p);var g=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&O.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,_=m.indexType,b=m.indexOffset,x=this.isInstanced,w=this.instanceCount,E=function(){},P=this.props,S=P.onBeforeRender,A=void 0===S?E:S,T=P.onAfterRender,k=void 0===T?E:T;A(),this._timerQueryStart();var C=this.program.draw(Object.assign({},t,{logPriority:g,uniforms:null,framebuffer:r,parameters:h,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:_,isInstanced:x,instanceCount:w,offset:y?b:0}));return this._timerQueryEnd(),k(),this._logDrawCallEnd(g,v,r),C}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(c.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&Un.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&O.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,s=e.defines,u=void 0===s?{}:s,c=e.inject,l=void 0===c?{}:c,f=e.shaderCache,h=void 0===f?null:f,d=e.varyings,v=void 0===d?null:d,p=e.bufferMode,g=void 0===p?35981:p,m=e.program,y=void 0===m?null:m;this.getModuleUniforms=function(e){};var _=this.id;if(!y){n=n||Oi.a.vs,r=r||Oi.a.fs;var b=Object(Si.a)(this.gl,{vs:n,fs:r,modules:o,inject:l,defines:u,log:O});n=b.vs,r=b.fs,y=h?h.getProgram(this.gl,{id:_,vs:n,fs:r}):new Bn(this.gl,{id:_,vs:n,fs:r,varyings:v,bufferMode:g}),this.getModuleUniforms=b.getUniforms||function(e){}}return Z(y instanceof Bn,"Model needs a program"),y}},{key:"_checkForDeprecatedUniforms",value:function(e){Li.forEach(function(t){t in e&&O.deprecated(t,"use picking shader module and Model class updateModuleSettings()")()})}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!J(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new Un(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,O.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(O.priority>> DRAWING MODEL ".concat(this.id),{collapsed:O.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=ti(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),c=t.accessors[s.location];c&&(u="".concat(o,": ").concat(ni(s.name,c))),r[u]=ti(t,a[o],c,i)}}return r}({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=$n({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,l=$n({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),f=l.table;l.count>0&&O.log("MISSING UNIFORMS",Object.keys(f))(),u>0&&O.log("UNUSED UNIFORMS",Object.keys(s))();var h=function(e){var t={},n="Accessors for ".concat(e.id),i=!0,r=!1,a=void 0;try{for(var o,s=e.attributeInfos[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(u){var l=ii(u);t["in ".concat(l)]=Object(c.a)({},n,JSON.stringify(u.accessor))}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}var f=!0,h=!1,d=void 0;try{for(var v,p=e.varyingInfos[Symbol.iterator]();!(f=(v=p.next()).done);f=!0){var g=v.value;if(g){var m=ii(g);t["out ".concat(m)]=Object(c.a)({},n,JSON.stringify(g.accessor))}}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}return t}(this.vertexArray.configuration);O.table(e,r)(),O.table(e,o)(),O.table(e+1,h)(),function(e,t){if(Ti.a.isReady()&&!Ti.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);Ti.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),O.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}(),Ii=function(e){function t(e,n){Object(i.a)(this,t);var r=n.id,a=void 0===r?K("model"):r;return Object(we.a)(this,Object(Ee.a)(t).call(this,e,H({},n,{id:a})))}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};on(Object(Ee.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Z(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){on(Object(Ee.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){on(Object(Ee.a)(t.prototype),"delete",this).call(this),this._deleteGeometryBuffers()}},{key:"destroy",value:function(){this.delete()}},{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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Z(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Z(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=function(e,t,n){var i={};for(var r in t.attributes){var a=t.attributes[r],o=Ei(r,n);if(a.constant)i[o]=a.value;else{var s=a.value,u=H({},a);delete u.value,i[o]=[new Be(e,s),u],Pi(r,u)}}return t.indices&&(i.indices=new Be(e,{data:t.indices.value||t.indices,target:34963})),i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(J(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(c.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return O.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof Be&&t.delete()}}},{key:"_setAnimationProps",value:function(e){var t=this;if(this.animated){Z(e,"Model.draw(): animated uniforms but no animationProps");var n=this._evaluateAnimateUniforms(e);this.program.setUniforms(n,function(){t._checkForDeprecatedUniforms(n)})}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(J(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new zn(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new Un(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,O.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}}]),t}(Ri),Fi=n(111),Ni=n(77),Di=n(137),Bi="transform_uSampler_",Ui="transform_uSize_",zi="transform_position";function Vi(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,s={},u=t,c={};if(a>0||i){var l=u.split("\n"),f=l.slice();if(l.forEach(function(e,t,r){if(a>0){var u=function(e,t){var n={},i=function(e){return Object(Ni.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(Bi).concat(e),n="".concat(Ui).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),u=s.samplerName,c=s.sizeName,l=s.uniformDeclerations,f=Object(Ni.e)(r),h=" ".concat(r," ").concat(a," = transform_getInput(").concat(u,", ").concat(c,").").concat(f,";\n");n[u]=a;var d={"vs:#decl":l,"vs:#main-start":h};return{updatedLine:o,inject:d,samplerTextureMap:n}}return null}(e,n);if(u){var l=u.updatedLine,h=u.inject;f[t]=l,c=Object(Fi.a)([c,h]),Object.assign(s,u.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(Ni.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Z(r);var h="".concat(Ui).concat(i),d={"vs:#decl":"uniform vec2 ".concat(h,";\n"),"vs:#main-start":" vec2 ".concat(zi," = transform_getPos(").concat(h,");\n gl_Position = vec4(").concat(zi,", 0, 1.);\n")};c=Object(Fi.a)([c,d])}u=f.join("\n")}return{vs:u,targetTextureType:o,inject:c,samplerTextureMap:s}}var Gi=(ji={},Object(c.a)(ji,10241,9728),Object(c.a)(ji,10240,9728),Object(c.a)(ji,10242,33071),Object(c.a)(ji,10243,33071),ji),Wi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Z(fe(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this._createdBuffers={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(r.a)(e,null,[{key:"isSupported",value:function(e){return fe(e)}}]),Object(r.a)(e,[{key:"delete",value:function(){for(var e in this._createdBuffers)this._createdBuffers[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof Be?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Z(!n||n===this.targetTextureVarying);var o=yt(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,u=Object(Ni.d)(this.targetTextureType),c=new s(o.length*u/4),l=0,f=0;f0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,Z(s=this.framebuffers[this.currentIndex]),r.viewport=[0,0,s.width,s.height],o&&this.gl.clear(this.gl.COLOR_BUFFER_BIT)),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){O.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Z(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Z(r[o]instanceof Be||r[o].buffer instanceof Be);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(Gi)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Z(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(O.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(O.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,f=e._swapTexture;for(var h in Z(a&&(s||n||c)&&o),t||{})Z(t[h]instanceof Be||t[h].buffer instanceof Be);for(var d in u||{})Z(u[d]instanceof qe);return Z(!c||l),Z(!f||u[f]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n);Z(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e){var t;if(e instanceof qe)return e;var n=this.sourceTextures[0][e];return n?(this._targetRefTexName=e,Bt(n,{parameters:(t={},Object(c.a)(t,10241,9728),Object(c.a)(t,10240,9728),Object(c.a)(t,10242,33071),Object(c.a)(t,10243,33071),t),pixelStore:Object(c.a)({},37440,!1)})):null}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=new Be(this.gl,{byteLength:o,usage:s,accessor:u});this._createdBuffers[r]&&this._createdBuffers[r].delete(),this._createdBuffers[r]=c,this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new Be(this.gl,t);return this._createdBuffers[e]&&(this._createdBuffers[e].delete(),this._createdBuffers[e]=n),n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Z(this.feedbackBuffers[t][i]instanceof Be))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new Ii(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){J(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new zn(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new zn(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new Dt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(c.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new Dt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(c.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new Be(this.gl,{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,s=Object(Fi.a)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:Object(Ni.b)({version:$t(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Di.a].concat(e.modules||[]):e.modules,uniforms:i,inject:s,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return Vi({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}(),Hi="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",Xi=[-1,-1,1,-1,-1,1,1,1],Yi=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=Xi.map(function(e){return-1===e?0:e});return(r=Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({},n,{vs:Hi,geometry:new ai({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(Xi)},aTexCoord:{size:2,value:new Float32Array(a)},aCoordinate:{size:2,value:new Float32Array(a)}}})})))).setVertexCount(4),r}return Object(Oe.a)(t,e),t}(Ii),Zi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Z(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Z("string"==typeof t),Z(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new rn(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Z("string"==typeof t),Z(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new an(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Z(this._compareContexts(e,this.gl)),Z("string"==typeof t.vs),Z("string"==typeof t.fs),Z("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new Bn(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}(),qi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.onInitialize,a=void 0===r?function(){}:r,o=n.onFinalize,s=void 0===o?function(){}:o,u=n.useDevicePixels,c=void 0===u||u,l=n.autoResizeDrawingBuffer,f=void 0===l||l;this.props={onInitialize:a,onFinalize:s},this.setProps({autoResizeDrawingBuffer:f,useDevicePixels:c}),Z(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._resolveNextFrame=null,this._nextFramePromise=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(r.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.addEventListener("message",function(n){switch(n.data.command){case"start":i=n.data.opts.canvas,r=new Map,i.addEventListener=function(e,n){t.postMessage({command:"addEventListener",type:e}),r.has(e)||r.set(e,[]),r.get(e).push(n)},i.removeEventListener=function(e,n){t.postMessage({command:"removeEventListener",type:e});var i=r.get(e);i&&i.splice(i.indexOf(n),1)},i.dispatchEvent=function(e,t){var n=r.get(e);n&&n.forEach(function(e){return e(t)})},t.canvas=i,e.start(n.data.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=n.data.width,t.canvas.height=n.data.height;break;case"event":t.canvas.dispatchEvent(n.data.type,n.data.event)}var i,r})}}}]),Object(r.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,ae().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=ve(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(pe(this._animationFrameId),this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"waitForRender",value:function(){var e=this;return this._nextFramePromise||(this._nextFramePromise=new Promise(function(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(s.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._animationFrameId=ve(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=oe(e);t.transferControlToOffscreen||O.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),Ki=function(){function e(t,n){Object(i.a)(this,e);var r=n.id,a=void 0===r?"pass":r;this.id=a,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(r.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=Dt.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),F(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),Qi=function(e){function t(e,n){return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(Ki),Ji=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(i.a)(this,e),this.gl=t,this.framebuffer1=new Dt(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new Dt(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(r.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),$i=function(e){function t(e,n){var r;return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,(r=Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({id:"multi-pass"},n)))).renderState=new Ji(e,n),r}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(Qi),er=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.gl,n=this.props.clearBits,i=void 0===n?16640:n;t.clear(i)}}]),t}(Ki),tr=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(Ki),nr="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",ir=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},r)))).clipspace=new Yi(e,{id:"copy-pass",fs:nr}),n}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Ki),rr="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",ar=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t),n=Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({id:"texture-pass"},r)));var a=r.texture,o=r.opacity,s=void 0===o?1:o;return n.clipspace=new Yi(e,{id:"texture-pass",fs:rr,uniforms:{uDiffuseSampler:a,uOpacity:s}}),n}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Ki),or=n(146),sr=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Ki),ur=function(e){function t(e,n){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t);var o="".concat(n.name,"-pass");Object(or.a)(n);var s=function(e,t,n,i){if(t.filter||t.sampler){var r=hr(t),a=new sr(e,{id:n,model:cr(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=hr(t,r),s="".concat(n,"-").concat(o.length+1);return new sr(e,Object.assign({id:s,model:cr(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,o,a);return(r=Object(we.a)(this,Object(Ee.a)(t).call(this,e,Object.assign({id:o,passes:s},a)))).module=n,r}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.module.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1,c.uniforms&&c.model.setUniforms(c.uniforms),c.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(Qi);function cr(e,t,n,i,r){var a=new Yi(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var lr=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},fr=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function hr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return lr(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return fr(i)}return null}var dr={x:[2,0,1],y:[0,1,2],z:[1,2,0]},vr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?K("truncated-code-geometry"):n,a=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,p=e.bottomCap,g=void 0!==p&&p,m=(v?2:0)+(g?2:0),y=(u+1)*(l+1+m),_=Math.atan2(n-r,o),b=Math.sin,x=Math.cos,w=Math.PI,E=x(_),P=b(_),O=v?-2:0,S=l+(g?2:0),A=u+1,T=new Uint16Array(u*(l+m)*6),k=dr[h],C=new Float32Array(3*y),M=new Float32Array(3*y),j=new Float32Array(2*y),L=0,R=0,I=O;I<=S;I++){var F=I/l,N=o*F,D=void 0;I<0?(N=0,F=1,D=n):I>l?(N=o,F=1,D=r):D=n+I/l*(r-n),-2!==I&&I!==l+2||(D=0,F=0),N-=o/2;for(var B=0;Bl?0:U*E,M[L+k[1]]=I<0?-1:I>l?1:P,M[L+k[2]]=I<0||I>l?0:z*E,j[R+0]=B/u,j[R+1]=F,R+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?K("cone-geometry"):n,a=e.radius,o=void 0===a?1:a,s=e.cap,u=void 0===s||s;return Object(we.a)(this,Object(Ee.a)(t).call(this,H({},e,{id:r,topRadius:0,topCap:Boolean(u),bottomCap:Boolean(u),bottomRadius:o})))}return Object(Oe.a)(t,e),t}(vr),gr=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]),mr=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]),yr=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]),_r=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]),br={POSITION:{size:3,value:new Float32Array(mr)},NORMAL:{size:3,value:new Float32Array(yr)},TEXCOORD_0:{size:2,value:new Float32Array(_r)}},xr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?K("cube-geometry"):n;return Object(we.a)(this,Object(Ee.a)(t).call(this,H({},e,{id:r,indices:{size:1,value:new Uint16Array(gr)},attributes:H({},br,e.attributes)})))}return Object(Oe.a)(t,e),t}(ai),wr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?K("cylinder-geometry"):n,a=e.radius,o=void 0===a?1:a;return Object(we.a)(this,Object(Ee.a)(t).call(this,H({},e,{id:r,bottomRadius:o,topRadius:o})))}return Object(Oe.a)(t,e),t}(vr),Er=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],Pr=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],Or=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?K("ico-sphere-geometry"):n,a=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).iterations,t=void 0===e?0:e,n=Math.PI,i=2*n,r=[].concat(Er),a=[].concat(Pr);r.push(),a.push();for(var o=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,a=t>n?t:n,o="".concat(i,"|").concat(a);if(o in e)return e[o];var s=r[t],u=r[t+1],c=r[t+2],l=r[n],f=r[n+1],h=r[n+2],d=(s+l)/2,v=(u+f)/2,p=(c+h)/2,g=Math.sqrt(d*d+v*v+p*p);return d/=g,v/=g,p/=g,r.push(d,v,p),e[o]=r.length/3-1}}(),s=0;s=0;p-=3){var g=a[p+0],m=a[p+1],y=a[p+2],_=3*g,b=3*m,x=3*y,w=2*g,E=2*m,P=2*y,O=r[_+0],S=r[_+1],A=r[_+2],T=Math.acos(A/Math.sqrt(O*O+S*S+A*A)),k=Math.atan2(S,O)+n,C=T/n,M=1-k/i,j=r[b+0],L=r[b+1],R=r[b+2],I=Math.acos(R/Math.sqrt(j*j+L*L+R*R)),F=Math.atan2(L,j)+n,N=I/n,D=1-F/i,B=r[x+0],U=r[x+1],z=r[x+2],V=Math.acos(z/Math.sqrt(B*B+U*U+z*z)),G=Math.atan2(U,B)+n,W=V/n,H=1-G/i,X=[B-j,U-L,z-R],Y=[O-j,S-L,A-R],Z=new si.a(X).cross(Y).normalize(),q=void 0;(0===M||0===D||0===H)&&(0===M||M>.5)&&(0===D||D>.5)&&(0===H||H>.5)&&(r.push(r[_+0],r[_+1],r[_+2]),q=r.length/3-1,a.push(q),v[2*q+0]=1,v[2*q+1]=C,d[3*q+0]=Z.x,d[3*q+1]=Z.y,d[3*q+2]=Z.z,r.push(r[b+0],r[b+1],r[b+2]),q=r.length/3-1,a.push(q),v[2*q+0]=1,v[2*q+1]=N,d[3*q+0]=Z.x,d[3*q+1]=Z.y,d[3*q+2]=Z.z,r.push(r[x+0],r[x+1],r[x+2]),q=r.length/3-1,a.push(q),v[2*q+0]=1,v[2*q+1]=W,d[3*q+0]=Z.x,d[3*q+1]=Z.y,d[3*q+2]=Z.z),d[_+0]=d[b+0]=d[x+0]=Z.x,d[_+1]=d[b+1]=d[x+1]=Z.y,d[_+2]=d[b+2]=d[x+2]=Z.z,v[w+0]=M,v[w+1]=C,v[E+0]=D,v[E+1]=N,v[P+0]=H,v[P+1]=W}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(r)},NORMAL:{size:3,value:new Float32Array(d)},TEXCOORD_0:{size:2,value:new Float32Array(v)}}}}(e),o=a.indices,s=a.attributes;return Object(we.a)(this,Object(Ee.a)(t).call(this,H({},e,{id:r,indices:o,attributes:H({},s,e.attributes)})))}return Object(Oe.a)(t,e),t}(ai);var Sr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?K("plane-geometry"):n,a=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")],f=e["".concat(c[1],"len")],h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),p=new Float32Array(3*v),g=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,_=0,b=0;b<=d;b++)for(var x=0;x<=h;x++){var w=x/h,E=b/d;switch(m[y+0]=o?1-w:w,m[y+1]=E,n){case"x,y":p[_+0]=l*w-.5*l,p[_+1]=f*E-.5*f,p[_+2]=r,g[_+0]=0,g[_+1]=0,g[_+2]=o?1:-1;break;case"x,z":p[_+0]=l*w-.5*l,p[_+1]=r,p[_+2]=f*E-.5*f,g[_+0]=0,g[_+1]=o?1:-1,g[_+2]=0;break;case"y,z":p[_+0]=r,p[_+1]=l*w-.5*l,p[_+2]=f*E-.5*f,g[_+0]=o?1:-1,g[_+1]=0,g[_+2]=0}y+=2,_+=3}for(var P=h+1,O=new Uint16Array(h*d*6),S=0;S0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?K("sphere-geometry"):n,a=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),p=0;p<=n;p++)for(var g=0;g<=r;g++){var m=g/r,y=p/n,_=g+p*(r+1),b=2*_,x=3*_,w=u*m,E=s*y,P=Math.sin(w),O=Math.cos(w),S=Math.sin(E),A=Math.cos(E),T=O*S,k=A,C=P*S,M=o(T,k,C,m,y);f[x+0]=M*T,f[x+1]=M*k,f[x+2]=M*C,h[x+0]=T,h[x+1]=k,h[x+2]=C,d[b+0]=m,d[b+1]=1-y}for(var j=n+1,L=0;L1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Z(e),t=t||this.matrix;var n=new Mr.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{key:"transform",value:function(){if(this.parent){var e=this.parent;this.endPosition.set(this.position.add(e.endPosition)),this.endRotation.set(this.rotation.add(e.endRotation)),this.endScale.set(this.scale.add(e.endScale))}else this.endPosition.set(this.position),this.endRotation.set(this.rotation),this.endScale.set(this.scale);for(var t=this.children,n=0;n0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var r=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===r?[]:r;return a.every(function(e){return Z(e instanceof jr)}),(e=Object(we.a)(this,Object(Ee.a)(t).call(this,n))).children=a,e}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),on(Object(Ee.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new Mr.a:n,r=new Mr.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l instanceof t?l.traverse(e,{worldMatrix:r}):e(l,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return O.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(jr),Rr=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Ee.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof Ii?(n.model=e,n._setModelNodeProps(r)):n.model=new Ii(e,r),n.managedResources=r.managedResources||[],n}return Object(Oe.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return on(Object(Ee.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(jr),Ir=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object(we.a)(this,Object(Ee.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(Oe.a)(t,e),t}(jr);n.d(t,"isWebGL",function(){return le}),n.d(t,"isWebGL2",function(){return fe}),n.d(t,"lumaStats",function(){return T}),n.d(t,"createGLContext",function(){return Gt}),n.d(t,"destroyGLContext",function(){return Ht}),n.d(t,"resizeGLContext",function(){return Xt}),n.d(t,"setGLContextDefaults",function(){return Vt}),n.d(t,"getContextInfo",function(){return kt}),n.d(t,"getGLContextInfo",function(){return Tt}),n.d(t,"getContextLimits",function(){return At}),n.d(t,"FEATURES",function(){return Ct}),n.d(t,"hasFeature",function(){return jt}),n.d(t,"hasFeatures",function(){return Lt}),n.d(t,"getFeatures",function(){return Rt}),n.d(t,"canCompileGLGSExtension",function(){return Nt}),n.d(t,"cloneTextureFrom",function(){return Bt}),n.d(t,"getKeyValue",function(){return be}),n.d(t,"getKey",function(){return xe}),n.d(t,"setContextDefaults",function(){return Vt}),n.d(t,"glGetDebugInfo",function(){return se}),n.d(t,"trackContextState",function(){return R.a}),n.d(t,"resetParameters",function(){return k.d}),n.d(t,"getParameter",function(){return k.b}),n.d(t,"getParameters",function(){return k.c}),n.d(t,"setParameter",function(){return k.e}),n.d(t,"setParameters",function(){return L}),n.d(t,"withParameters",function(){return F}),n.d(t,"getModifiedParameters",function(){return k.a}),n.d(t,"Buffer",function(){return Be}),n.d(t,"Shader",function(){return nn}),n.d(t,"VertexShader",function(){return rn}),n.d(t,"FragmentShader",function(){return an}),n.d(t,"Program",function(){return Bn}),n.d(t,"Framebuffer",function(){return Dt}),n.d(t,"Renderbuffer",function(){return ot}),n.d(t,"Texture2D",function(){return qe}),n.d(t,"TextureCube",function(){return et}),n.d(t,"clear",function(){return pt}),n.d(t,"clearBuffer",function(){return gt}),n.d(t,"readPixelsToArray",function(){return yt}),n.d(t,"readPixelsToBuffer",function(){return _t}),n.d(t,"copyToDataUrl",function(){return bt}),n.d(t,"copyToImage",function(){return xt}),n.d(t,"copyToTexture",function(){return wt}),n.d(t,"blit",function(){return Et}),n.d(t,"Query",function(){return Un}),n.d(t,"Texture3D",function(){return nt}),n.d(t,"TransformFeedback",function(){return zn}),n.d(t,"VertexArrayObject",function(){return Hn}),n.d(t,"VertexArray",function(){return Zn}),n.d(t,"UniformBufferLayout",function(){return Jn}),n.d(t,"setPathPrefix",function(){return Xe}),n.d(t,"loadFile",function(){return Ye}),n.d(t,"loadImage",function(){return Ze}),n.d(t,"_Accessor",function(){return Ie}),n.d(t,"_clearBuffer",function(){return gt}),n.d(t,"Geometry",function(){return ai}),n.d(t,"Material",function(){return oi}),n.d(t,"AmbientLight",function(){return di}),n.d(t,"DirectionalLight",function(){return vi}),n.d(t,"PointLight",function(){return pi}),n.d(t,"AnimationLoop",function(){return mi}),n.d(t,"encodePickingColor",function(){return _i}),n.d(t,"decodePickingColor",function(){return bi}),n.d(t,"getNullPickingColor",function(){return xi}),n.d(t,"Model",function(){return Ii}),n.d(t,"Transform",function(){return Wi}),n.d(t,"ClipSpace",function(){return Yi}),n.d(t,"_ShaderCache",function(){return Zi}),n.d(t,"_AnimationLoopProxy",function(){return qi}),n.d(t,"_MultiPassRenderer",function(){return $i}),n.d(t,"_RenderState",function(){return Ji}),n.d(t,"_Pass",function(){return Ki}),n.d(t,"_CompositePass",function(){return Qi}),n.d(t,"_ClearPass",function(){return er}),n.d(t,"_RenderPass",function(){return tr}),n.d(t,"_CopyPass",function(){return ir}),n.d(t,"_TexturePass",function(){return ar}),n.d(t,"_ShaderModulePass",function(){return ur}),n.d(t,"ConeGeometry",function(){return pr}),n.d(t,"CubeGeometry",function(){return xr}),n.d(t,"CylinderGeometry",function(){return wr}),n.d(t,"IcoSphereGeometry",function(){return Or}),n.d(t,"PlaneGeometry",function(){return Sr}),n.d(t,"SphereGeometry",function(){return Ar}),n.d(t,"TruncatedConeGeometry",function(){return vr}),n.d(t,"PhongMaterial",function(){return kr}),n.d(t,"PBRMaterial",function(){return Cr}),n.d(t,"ScenegraphNode",function(){return jr}),n.d(t,"GroupNode",function(){return Lr}),n.d(t,"ModelNode",function(){return Rr}),n.d(t,"CameraNode",function(){return Ir}),n.d(t,"registerShaderModules",function(){return Oi.u}),n.d(t,"setDefaultShaderModules",function(){return Oi.v}),n.d(t,"assembleShaders",function(){return Oi.c}),n.d(t,"createShaderHook",function(){return Oi.g}),n.d(t,"createModuleInjection",function(){return Oi.f}),n.d(t,"combineInjects",function(){return Oi.d}),n.d(t,"normalizeShaderModule",function(){return Oi.p}),n.d(t,"fp32",function(){return Oi.j}),n.d(t,"fp64",function(){return Oi.k}),n.d(t,"project",function(){return Oi.t}),n.d(t,"lights",function(){return Oi.o}),n.d(t,"dirlight",function(){return Oi.i}),n.d(t,"picking",function(){return Oi.s}),n.d(t,"diffuse",function(){return Oi.h}),n.d(t,"gouraudlighting",function(){return Oi.n}),n.d(t,"phonglighting",function(){return Oi.r}),n.d(t,"pbr",function(){return Oi.q}),n.d(t,"_transform",function(){return Oi.b}),n.d(t,"MODULAR_SHADERS",function(){return Oi.a}),n.d(t,"getQualifierDetails",function(){return Oi.m}),n.d(t,"getPassthroughFS",function(){return Oi.l}),n.d(t,"typeToChannelSuffix",function(){return Oi.x}),n.d(t,"typeToChannelCount",function(){return Oi.w}),n.d(t,"convertToVec4",function(){return Oi.e}),n.d(t,"log",function(){return O}),n.d(t,"assert",function(){return Z}),n.d(t,"uid",function(){return K}),n.d(t,"self",function(){return o.c}),n.d(t,"window",function(){return o.d}),n.d(t,"global",function(){return o.b}),n.d(t,"document",function(){return o.a})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var f={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(e){return"string"==typeof e?f[e.toUpperCase()]||f.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(59),p={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},g={enabled:!1,priority:0};function m(){}var y={};var _=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),g),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(166)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var f=new Image;return f.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(f,i,o)))},f.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=h(a),r="[".concat(a,"m").concat(r,"")),o&&(a=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();_.VERSION=u.a;t.a=new _({id:"deck"}).enable()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){e.exports=n(180)},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"c",function(){return a});var i=1e-6,r="undefined"!=typeof Float32Array?Float32Array:Array,a=Math.random;Math.PI},function(e,t,n){n(5);var i=n(176);function r(t,n,a){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=r=Reflect.get:e.exports=r=function(e,t,n){var r=i(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}},r(t,n,a||t)}e.exports=r},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return p}),n.d(t,"i",function(){return g}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return _});var i=n(17);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],p=t[13],g=t[14],m=t[15],y=n*s-i*o,_=n*u-r*o,b=n*c-a*o,x=i*u-r*s,w=i*c-a*s,E=r*c-a*u,P=l*p-f*v,O=l*g-h*v,S=l*m-d*v,A=f*g-h*p,T=f*m-d*p,k=h*m-d*g,C=y*k-_*T+b*A+x*S-w*O+E*P;return C?(C=1/C,e[0]=(s*k-u*T+c*A)*C,e[1]=(r*T-i*k-a*A)*C,e[2]=(p*E-g*w+m*x)*C,e[3]=(h*w-f*E-d*x)*C,e[4]=(u*S-o*k-c*O)*C,e[5]=(n*k-r*S+a*O)*C,e[6]=(g*b-v*E-m*_)*C,e[7]=(l*E-h*b+d*_)*C,e[8]=(o*T-s*S+c*P)*C,e[9]=(i*S-n*T-a*P)*C,e[10]=(v*w-p*b+m*y)*C,e[11]=(f*b-l*w-d*y)*C,e[12]=(s*O-o*A-u*P)*C,e[13]=(n*A-i*O+r*P)*C,e[14]=(p*_-v*x-g*y)*C,e[15]=(l*x-f*_+h*y)*C,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],v=e[13],p=e[14],g=e[15];return(t*o-n*a)*(f*g-h*p)-(t*s-i*a)*(l*g-h*v)+(t*u-r*a)*(l*p-f*v)+(n*s-i*o)*(c*g-h*d)-(n*u-r*o)*(c*p-f*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],p=t[12],g=t[13],m=t[14],y=t[15],_=n[0],b=n[1],x=n[2],w=n[3];return e[0]=_*i+b*s+x*f+w*p,e[1]=_*r+b*u+x*h+w*g,e[2]=_*a+b*c+x*d+w*m,e[3]=_*o+b*l+x*v+w*y,_=n[4],b=n[5],x=n[6],w=n[7],e[4]=_*i+b*s+x*f+w*p,e[5]=_*r+b*u+x*h+w*g,e[6]=_*a+b*c+x*d+w*m,e[7]=_*o+b*l+x*v+w*y,_=n[8],b=n[9],x=n[10],w=n[11],e[8]=_*i+b*s+x*f+w*p,e[9]=_*r+b*u+x*h+w*g,e[10]=_*a+b*c+x*d+w*m,e[11]=_*o+b*l+x*v+w*y,_=n[12],b=n[13],x=n[14],w=n[15],e[12]=_*i+b*s+x*f+w*p,e[13]=_*r+b*u+x*h+w*g,e[14]=_*a+b*c+x*d+w*m,e[15]=_*o+b*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,f,h,d,v,p=n[0],g=n[1],m=n[2];return t===e?(e[12]=t[0]*p+t[4]*g+t[8]*m+t[12],e[13]=t[1]*p+t[5]*g+t[9]*m+t[13],e[14]=t[2]*p+t[6]*g+t[10]*m+t[14],e[15]=t[3]*p+t[7]*g+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=v,e[12]=i*p+s*g+f*m+t[12],e[13]=r*p+u*g+h*m+t[13],e[14]=a*p+c*g+d*m+t[14],e[15]=o*p+l*g+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,f,h,d,v,p,g,m,y,_,b,x,w,E,P,O,S,A,T,k=r[0],C=r[1],M=r[2],j=Math.sqrt(k*k+C*C+M*M);return j unit tile [0-1, 0-1]\n//\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\n\n//\n// Projects lnglats (or meter offsets, depending on mode) to common space\n//\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n // TODO - why not simply subtract center and fall through?\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n // Subtract high part of 64 bit value. Convert remainder to float32, preserving precision.\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n\n // METER_OFFSETS or IDENTITY\n // Apply model matrix\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n // Translation is already added to the high parts\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\n\n//\n// Projects from "world" coordinates to clip space.\n// Uses project_uViewProjectionMatrix\n//\nvec4 project_common_position_to_clipspace(vec4 position) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n // Needs to be divided with project_uCommonUnitsPerMeter\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return project_uViewProjectionMatrix * position + project_uCenter;\n}\n\n// Returns a clip space offset that corresponds to a given number of screen pixels\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\n\n// Deprecated, remove in v8\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n'),c=n(84),l={};var f={name:"project",dependencies:[a.fp32],vs:u,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;return e.viewport?Object(c.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]},h={name:"project32",dependencies:[f],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"},d=n(85),v=a.fp64.fp64ify,p=a.fp64.fp64ifyMatrix4,g={name:"project64",dependencies:[f,a.fp64],vs:"\nconst vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);\n\nuniform vec2 project64_uScale;\nuniform vec2 project_uViewProjectionMatrixFP64[16];\n\n// longitude: lnglat_fp64.xy; latitude: lnglat_fp64.zw\nvoid mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) {\n\n#if defined(NVIDIA_FP64_WORKAROUND)\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64 * ONE);\n#else\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64);\n#endif\n out_val[1] = sub_fp64(PI_FP64,\n log_fp64(tan_fp64(sum_fp64(PI_4_FP64, radians_fp64(lnglat_fp64.zw) / 2.0))));\n return;\n}\n\nvoid project_position_fp64(vec4 position_fp64, out vec2 out_val[2]) {\n vec2 pos_fp64[2];\n mercatorProject_fp64(position_fp64, pos_fp64);\n vec2 x_fp64 = mul_fp64(pos_fp64[0], project64_uScale);\n vec2 y_fp64 = mul_fp64(pos_fp64[1], project64_uScale);\n out_val[0] = mul_fp64(x_fp64, WORLD_SCALE_FP64);\n out_val[1] = mul_fp64(y_fp64, WORLD_SCALE_FP64);\n\n return;\n}\n\nvoid project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val[2]) {\n vec4 position64xy = vec4(\n position.x, position64xyLow.x,\n position.y, position64xyLow.y);\n\n project_position_fp64(position64xy, out_val);\n}\n\nvec4 project_common_position_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n vec2 vertex_pos_clipspace[4];\n mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace,\n vertex_pos_clipspace);\n return vec4(\n vertex_pos_clipspace[0].x,\n vertex_pos_clipspace[1].x,\n vertex_pos_clipspace[2].x,\n vertex_pos_clipspace[3].x\n );\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n // This is the local offset to the instance position\n vec2 offset64[4];\n vec4_fp64(vec4(offset, 0.0), offset64);\n\n float z = project_size(position.z);\n\n // Apply web mercator projection (depends on coordinate system imn use)\n vec2 projectedPosition64xy[2];\n project_position_fp64(position.xy, position64xyLow, projectedPosition64xy);\n\n vec2 commonPosition64[4];\n commonPosition64[0] = sum_fp64(offset64[0], projectedPosition64xy[0]);\n commonPosition64[1] = sum_fp64(offset64[1], projectedPosition64xy[1]);\n commonPosition64[2] = sum_fp64(offset64[2], vec2(z, 0.0));\n commonPosition64[3] = vec2(1.0, 0.0);\n\n commonPosition = vec4(projectedPosition64xy[0].x, projectedPosition64xy[1].x, z, 1.0);\n\n return project_common_position_to_clipspace_fp64(commonPosition64);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(\n position, position64xyLow, offset, commonPosition\n );\n}\n\n// Deprecated, remove in v8\nvec4 project_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n return project_common_position_to_clipspace_fp64(vertex_pos_modelspace);\n}\n",getUniforms:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return m({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},m=Object(d.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=p(t),r=v(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}});if(i.a.deck&&"7.1.3"!==i.a.deck.VERSION)throw new Error("deck.gl - multiple versions detected: ".concat(i.a.deck.VERSION," vs ").concat("7.1.3"));i.a.deck||(r.a.log(0,"deck.gl ".concat("7.1.3"," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),i.a.deck=i.a.deck||{VERSION:"7.1.3",version:"7.1.3",log:r.a},Object(a.registerShaderModules)([a.fp32,a.fp64,f,h,g,a.gouraudlighting,a.phonglighting,a.picking]),Object(a.setDefaultShaderModules)([f]));var y=n(27),_=n(93),b=n(2),x=n.n(b),w=n(3),E=n.n(w),P=n(8),O=n.n(P),S=n(5),A=n.n(S),T=n(9),k=n.n(T),C=n(96),M=function(e){function t(e){var n;return x()(this,t),(n=O()(this,A()(t).call(this,e))).projectedLight=new a.PointLight(e),n}return k()(t,e),E()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=Object(C.b)(this.position,{viewport:n,coordinateSystem:r,coordinateOrigin:a,fromCoordinateSystem:n.isGeospatial?y.a.LNGLAT:y.a.IDENTITY,fromCoordinateOrigin:[0,0,0]});return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=o,this.projectedLight}}]),t}(a.PointLight),j=n(94),L=function(e){function t(){return x()(this,t),O()(this,A()(t).apply(this,arguments))}return k()(t,e),E()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=i.modelMatrix,s=Object(c.b)({viewport:n,modelMatrix:o,coordinateSystem:r,coordinateOrigin:a}).project_uCameraPosition;return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=s,this.projectedLight}}]),t}(M),R=n(150),I=n.n(R),F=Math.PI/180,N=864e5,D=2440588,B=2451545,U=23.4397*F,z=357.5291,V=.98560028,G=280.147,W=360.9856235;function H(e,t,n){var i,r,a,o,s,u,c=F*-n,l=F*t,f=function(e){return function(e){return e/N-.5+D}(e)-B}(e),h=(i=F*(z+V*f),r=F*(1.9148*Math.sin(i)+.02*Math.sin(2*i)+3e-4*Math.sin(3*i)),a=i+r+102.9372*F+Math.PI,{declination:(o=a,s=0,u=o,Math.asin(Math.sin(s)*Math.cos(U)+Math.cos(s)*Math.sin(U)*Math.sin(u))),rightAscension:X(a,0)}),d=function(e,t){return F*(G+W*e)-t}(f,c)-h.rightAscension;return{azimuth:Y(d,l,h.declination),altitude:Z(d,l,h.declination)}}function X(e,t){var n=e;return Math.atan2(Math.sin(n)*Math.cos(U)-Math.tan(t)*Math.sin(U),Math.cos(n))}function Y(e,t,n){var i=e,r=t,a=n;return Math.atan2(Math.sin(i),Math.cos(i)*Math.sin(r)-Math.tan(a)*Math.cos(r))}function Z(e,t,n){var i=e,r=t,a=n;return Math.asin(Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos(i))}var q=function(e){function t(e){var n,i=e.timestamp,r=I()(e,["timestamp"]);return x()(this,t),(n=O()(this,A()(t).call(this,r))).timestamp=i,n}return k()(t,e),E()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer.context.viewport,n=t.latitude,i=t.longitude;return this.direction=function(e,t,n){var i=H(e,t,n),r=i.azimuth,a=i.altitude,o=r+Math.PI;return[-Math.sin(o),-Math.cos(o),-Math.sin(a)]}(this.timestamp,n,i),this}}]),t}(a.DirectionalLight),K=n(95),Q=n(78),J=n(128),$=n(104),ee=n(107),te=n(80),ne=n(127),ie=n(112),re=n(34),ae=n(103),oe=n(38),se=n(102),ue=n(138),ce=n(133),le=n(48),fe=n(126);var he=function(e){function t(){return x()(this,t),O()(this,A()(t).apply(this,arguments))}return k()(t,e),E()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.bearing,i=t.pitch,r=t.position,a=t.up,o=50*t.zoom,s=function(e){var t=e.bearing,n=e.pitch;return new ce.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:n,pitch:i}).scale(-o).multiply(new le.a(1,1,-1)),u=(new fe.a).multiplyRight((new fe.a).lookAt({eye:s,center:r,up:a}));return new re.a(Object.assign({},e,{id:this.id,zoom:null,viewMatrix:u}))}}]),t}(oe.a);he.displayName="ThirdPersonView";var de=n(139),ve=n(19),pe=Math.PI/180,ge=function(e){function t(){return x()(this,t),O()(this,A()(t).apply(this,arguments))}return k()(t,e),E()(t,[{key:"_getViewport",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.viewState,o=a.eye,s=a.lookAt,u=void 0===s?[0,0,0]:s,c=a.up,l=void 0===c?[0,1,0]:c,f=e.fovy||a.fovy||75,h=e.near||a.near||1,d=e.far||a.far||100,v=Number.isFinite(a.aspect)?a.aspect:i/r,p=f*pe;return new re.a({id:this.id,x:t,y:n,width:i,height:r,viewMatrix:ve.f([],o,u,l),projectionMatrix:ve.i([],p,v,h,d)})}}]),t}(oe.a);ge.displayName="PerspectiveView";var me=n(140),ye=n(58),_e=n(110),be=n(105),xe=n(79),we=n(106),Ee=n(68),Pe=n(57),Oe=n(56),Se=n(118),Ae=n(23),Te=n(39),ke=n(29),Ce=n(36),Me=.01,je=["longitude","latitude","zoom"];var Le=["bearing","pitch"],Re=function(e){function t(){return x()(this,t),O()(this,A()(t).call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]}))}return k()(t,e),E()(t,[{key:"interpolateProps",value:function(e,t,n){for(var i=function(e,t,n){var i={},r=e.zoom,a=[e.longitude,e.latitude],o=Object(ke.l)(r),s=t.zoom,u=[t.longitude,t.latitude],c=Object(ke.l)(s-r),l=Object(ke.g)(a,o),f=Object(ke.g)(u,o),h=Ce.g([],f,l),d=Math.max(e.width,e.height),v=d/c,p=Ce.c(h);if(Math.abs(p)0&&void 0!==arguments[0]?arguments[0]:{}).overAlloc,n=void 0===t?1:t;x()(this,e),this.overAlloc=n}return E()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=n.type,a=n.copy,o=void 0!==a&&a,s=t*i;if(e&&s<=e.length)return e;var u=Math.max(Math.ceil(s*this.overAlloc),1),c=this._allocate(r,u);return e&&o&&c.set(e),this._release(e),c}},{key:"_allocate",value:function(){return new(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Float32Array)(arguments.length>1?arguments[1]:void 0)}},{key:"_release",value:function(e){}}]),e}(),De=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};x()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=new Ne,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return E()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64;this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(Fe.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var p=this.attributes,g=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var _ in g){var b=g[_];b.copy=Boolean(e),b.fp64Only&&!y||(p[_]=m.allocate(p[_],c,b))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null};function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var l="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",f="".concat(l,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),h={ONE:1};var d={name:"fp64",vs:f,fs:null,fp64ify:c,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var i=0;i<4;++i){var r=4*n+i;c(e[4*i+n],t,2*r)}return t},getUniforms:function(){return Object.assign({},h)}},v=("".concat(l),n(126)),p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],g={modelMatrix:p,viewMatrix:p,projectionMatrix:p,cameraPositionWorld:[0,0,0]};var m="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",y={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new v.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(m,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(m)},_="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",b={name:"lights",vs:_,fs:_,getUniforms:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,r=n.pointLights,a=n.directionalLights,o=i||r&&r.length>0||a&&a.length>0;return o?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,a=void 0===r?[]:r,o={};o["lighting_uAmbientLight.color"]=t?w(t):[0,0,0];return i.forEach(function(e,t){o["lighting_uPointLight[".concat(t,"].color")]=w(e),o["lighting_uPointLight[".concat(t,"].position")]=e.position,o["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),o.lighting_uPointLightCount=i.length,a.forEach(function(e,t){o["lighting_uDirectionalLight[".concat(t,"].color")]=w(e),o["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),o.lighting_uDirectionalLightCount=a.length,o}({ambientLight:i,pointLights:r,directionalLights:a}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var s={pointLights:[],directionalLights:[]},u=!0,c=!1,l=void 0;try{for(var f,h=(t.lights||[])[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;switch(d.type){case"ambient":s.ambientLight=d;break;case"directional":s.directionalLights.push(d);break;case"point":s.pointLights.push(d)}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return e({lightSources:s})}return{}},defines:{MAX_LIGHTS:3}},x={};function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}var E={lightDirection:new Float32Array([1,1,2])};var P={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[y]},O={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};var S={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}},A={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var T={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},k="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",C={name:"gouraud-lighting",dependencies:[b],vs:k,defines:{LIGHTING_VERTEX:1},getUniforms:L},M={name:"phong-lighting",dependencies:[b],fs:k,defines:{LIGHTING_FRAGMENT:1},getUniforms:L},j={};function L(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor,t}(t):{lighting_uEnabled:!1}}var R="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",I={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[{name:"project2",vs:R,fs:R},b]},F=n(137);n.d(t,"a",function(){return N}),n.d(t,"u",function(){return i.b}),n.d(t,"v",function(){return i.d}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.a}),n.d(t,"p",function(){return o.a}),n.d(t,"m",function(){return s.c}),n.d(t,"l",function(){return s.b}),n.d(t,"x",function(){return s.e}),n.d(t,"w",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u}),n.d(t,"k",function(){return d}),n.d(t,"t",function(){return y}),n.d(t,"o",function(){return b}),n.d(t,"i",function(){return P}),n.d(t,"s",function(){return S}),n.d(t,"h",function(){return T}),n.d(t,"n",function(){return C}),n.d(t,"r",function(){return M}),n.d(t,"q",function(){return I}),n.d(t,"b",function(){return F.a});var N={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",defaultUniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r});var i={LNGLAT:1,LNGLAT_DEPRECATED:5,METER_OFFSETS:2,METERS:2,LNGLAT_OFFSETS:3,IDENTITY:0},r={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},function(e,t,n){"use strict";function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"l",function(){return g}),n.d(t,"i",function(){return m}),n.d(t,"g",function(){return y}),n.d(t,"j",function(){return _}),n.d(t,"c",function(){return b}),n.d(t,"b",function(){return x}),n.d(t,"a",function(){return w}),n.d(t,"f",function(){return E}),n.d(t,"e",function(){return P}),n.d(t,"d",function(){return O}),n.d(t,"k",function(){return S}),n.d(t,"h",function(){return A});var i=n(22),r=n(39),a=n(19),o=n(36),s=n(41),u=n(61),c=Math.PI,l=c/4,f=c/180,h=180/c,d=512,v=4003e4,p=1.5;function g(e){return Math.pow(2,e)}function m(e){return Math.log2(e)}function y(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1];Object(u.a)(Number.isFinite(r)&&Number.isFinite(t)),Object(u.a)(Number.isFinite(a)&&a>=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function _(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function b(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:g(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,p=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-p,m],s.degreesPerPixel=[1/h,-1/p,1/m],o){var y=f*Math.tan(t*f)/l,_=h*y/2,b=c/v*y,x=b/p*m;s.pixelsPerDegree2=[0,-_,b],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var p=_(v,1),g=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[p[0],p[1],g]:p}function E(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.d([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?p:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),g=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:g*l}}function O(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function S(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function A(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],p=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,p)}},function(e,t,n){e.exports=n(178)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";(function(e){n.d(t,"c",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},r=i.self||i.window||i.global,a=i.window||i.self||i.global,o=i.global||i.self||i.window,s=i.document||{}}).call(this,n(54))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=i=function(e){return n(e)}:e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},i(t)}e.exports=i},function(e,t,n){"use strict";var i=n(20),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(14),l=(n(40),n(15));var f=n(23),h=n(126),d=n(48),v=n(19),p=n(29);n.d(t,"a",function(){return _});var g=Math.PI/180,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(p.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(p.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),g=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[g,m,y]:Number.isFinite(a)?[g,m,a]:[g,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(p.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(p.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(p.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(87),v=n(15);n.d(t,"a",function(){return p});var p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,p=t.projectionMatrix,g=void 0===p?null:p,m=t.fovy,y=void 0===m?50:m,_=t.near,b=void 0===_?.1:_,x=t.far,w=void 0===x?1e3:x,E=t.modelMatrix,P=void 0===E?null:E,O=t.viewportInstance,S=void 0===O?null:O,A=t.type,T=void 0===A?c.a:A;Object(v.a)(!S||S instanceof c.a),this.viewportInstance=S,this.id=i||this.constructor.displayName||"view",this.type=T,this.props=Object.assign({},t,{projectionMatrix:g,fovy:y,near:b,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(40);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.c([],t,e);return i.b(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return o});var i=n(17);function r(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function a(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function o(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}var s,u;s=new i.a(4),i.a!=Float32Array&&(s[0]=0,s[1]=0,s[2]=0,s[3]=0),u=s},function(e,t,n){"use strict";n.d(t,"c",function(){return r}),n.d(t,"d",function(){return o}),n.d(t,"b",function(){return u}),n.d(t,"i",function(){return c}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"a",function(){return d}),n.d(t,"h",function(){return g});var i=n(17);function r(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function a(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function o(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function s(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function u(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function c(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function l(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function f(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t){var n=a(e[0],e[1],e[2]),i=a(t[0],t[1],t[2]);s(n,n),s(i,i);var r=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var v,p,g=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e};v=new i.a(3),i.a!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0),p=v},function(e,t,n){e.exports=n(164)},function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return v}),n.d(t,"c",function(){return g});var i,r,a,o=n(25),s=n(0),u=n(46),c=(i={},Object(s.a)(i,3042,!1),Object(s.a)(i,32773,new Float32Array([0,0,0,0])),Object(s.a)(i,32777,32774),Object(s.a)(i,34877,32774),Object(s.a)(i,32969,1),Object(s.a)(i,32968,0),Object(s.a)(i,32971,1),Object(s.a)(i,32970,0),Object(s.a)(i,3106,new Float32Array([0,0,0,0])),Object(s.a)(i,3107,[!0,!0,!0,!0]),Object(s.a)(i,2884,!1),Object(s.a)(i,2885,1029),Object(s.a)(i,2929,!1),Object(s.a)(i,2931,1),Object(s.a)(i,2932,513),Object(s.a)(i,2928,new Float32Array([0,1])),Object(s.a)(i,2930,!0),Object(s.a)(i,3024,!0),Object(s.a)(i,36006,null),Object(s.a)(i,2886,2305),Object(s.a)(i,33170,4352),Object(s.a)(i,2849,1),Object(s.a)(i,32823,!1),Object(s.a)(i,32824,0),Object(s.a)(i,10752,0),Object(s.a)(i,32938,1),Object(s.a)(i,32939,!1),Object(s.a)(i,3089,!1),Object(s.a)(i,3088,new Int32Array([0,0,1024,1024])),Object(s.a)(i,2960,!1),Object(s.a)(i,2961,0),Object(s.a)(i,2968,4294967295),Object(s.a)(i,36005,4294967295),Object(s.a)(i,2962,519),Object(s.a)(i,2967,0),Object(s.a)(i,2963,4294967295),Object(s.a)(i,34816,519),Object(s.a)(i,36003,0),Object(s.a)(i,36004,4294967295),Object(s.a)(i,2964,7680),Object(s.a)(i,2965,7680),Object(s.a)(i,2966,7680),Object(s.a)(i,34817,7680),Object(s.a)(i,34818,7680),Object(s.a)(i,34819,7680),Object(s.a)(i,2978,new Int32Array([0,0,1024,1024])),Object(s.a)(i,3333,4),Object(s.a)(i,3317,4),Object(s.a)(i,37440,!1),Object(s.a)(i,37441,!1),Object(s.a)(i,37443,37444),Object(s.a)(i,35723,4352),Object(s.a)(i,36010,null),Object(s.a)(i,35977,!1),Object(s.a)(i,3330,0),Object(s.a)(i,3332,0),Object(s.a)(i,3331,0),Object(s.a)(i,3314,0),Object(s.a)(i,32878,0),Object(s.a)(i,3316,0),Object(s.a)(i,3315,0),Object(s.a)(i,32877,0),i),l=function(e,t,n){return t?e.enable(n):e.disable(n)},f=function(e,t,n){return e.hint(n,t)},h=function(e,t,n){return e.pixelStorei(n,t)},d=(r={},Object(s.a)(r,3042,l),Object(s.a)(r,32773,function(e,t){return e.blendColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,32777,"blendEquation"),Object(s.a)(r,34877,"blendEquation"),Object(s.a)(r,32969,"blendFunc"),Object(s.a)(r,32968,"blendFunc"),Object(s.a)(r,32971,"blendFunc"),Object(s.a)(r,32970,"blendFunc"),Object(s.a)(r,3106,function(e,t){return e.clearColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,3107,function(e,t){return e.colorMask.apply(e,Object(o.a)(t))}),Object(s.a)(r,2884,l),Object(s.a)(r,2885,function(e,t){return e.cullFace(t)}),Object(s.a)(r,2929,l),Object(s.a)(r,2931,function(e,t){return e.clearDepth(t)}),Object(s.a)(r,2932,function(e,t){return e.depthFunc(t)}),Object(s.a)(r,2928,function(e,t){return e.depthRange.apply(e,Object(o.a)(t))}),Object(s.a)(r,2930,function(e,t){return e.depthMask(t)}),Object(s.a)(r,3024,l),Object(s.a)(r,35723,f),Object(s.a)(r,36006,function(e,t){var n=Object(u.c)(e)?36009:36160;return e.bindFramebuffer(n,t)}),Object(s.a)(r,2886,function(e,t){return e.frontFace(t)}),Object(s.a)(r,33170,f),Object(s.a)(r,2849,function(e,t){return e.lineWidth(t)}),Object(s.a)(r,32823,l),Object(s.a)(r,32824,"polygonOffset"),Object(s.a)(r,10752,"polygonOffset"),Object(s.a)(r,35977,l),Object(s.a)(r,32938,"sampleCoverage"),Object(s.a)(r,32939,"sampleCoverage"),Object(s.a)(r,3089,l),Object(s.a)(r,3088,function(e,t){return e.scissor.apply(e,Object(o.a)(t))}),Object(s.a)(r,2960,l),Object(s.a)(r,2961,function(e,t){return e.clearStencil(t)}),Object(s.a)(r,2968,function(e,t){return e.stencilMaskSeparate(1028,t)}),Object(s.a)(r,36005,function(e,t){return e.stencilMaskSeparate(1029,t)}),Object(s.a)(r,2962,"stencilFuncFront"),Object(s.a)(r,2967,"stencilFuncFront"),Object(s.a)(r,2963,"stencilFuncFront"),Object(s.a)(r,34816,"stencilFuncBack"),Object(s.a)(r,36003,"stencilFuncBack"),Object(s.a)(r,36004,"stencilFuncBack"),Object(s.a)(r,2964,"stencilOpFront"),Object(s.a)(r,2965,"stencilOpFront"),Object(s.a)(r,2966,"stencilOpFront"),Object(s.a)(r,34817,"stencilOpBack"),Object(s.a)(r,34818,"stencilOpBack"),Object(s.a)(r,34819,"stencilOpBack"),Object(s.a)(r,2978,function(e,t){return e.viewport.apply(e,Object(o.a)(t))}),Object(s.a)(r,3333,h),Object(s.a)(r,3317,h),Object(s.a)(r,37440,h),Object(s.a)(r,37441,h),Object(s.a)(r,37443,h),Object(s.a)(r,3330,h),Object(s.a)(r,3332,h),Object(s.a)(r,3331,h),Object(s.a)(r,36010,function(e,t){return e.bindFramebuffer(36008,t)}),Object(s.a)(r,3314,h),Object(s.a)(r,32878,h),Object(s.a)(r,3316,h),Object(s.a)(r,3315,h),Object(s.a)(r,32877,h),r),v={blendEquation:function(e,t){return e.blendEquationSeparate(t[32777],t[34877])},blendFunc:function(e,t){return e.blendFuncSeparate(t[32969],t[32968],t[32971],t[32970])},polygonOffset:function(e,t){return e.polygonOffset(t[32824],t[10752])},sampleCoverage:function(e,t){return e.sampleCoverage(t[32938],t[32939])},stencilFuncFront:function(e,t){return e.stencilFuncSeparate(1028,t[2962],t[2967],t[2963])},stencilFuncBack:function(e,t){return e.stencilFuncSeparate(1029,t[34816],t[36003],t[36004])},stencilOpFront:function(e,t){return e.stencilOpSeparate(1028,t[2964],t[2965],t[2966])},stencilOpBack:function(e,t){return e.stencilOpSeparate(1029,t[34817],t[34818],t[34819])}},p=function(e,t){return e.isEnabled(t)},g=(a={},Object(s.a)(a,3042,p),Object(s.a)(a,2884,p),Object(s.a)(a,2929,p),Object(s.a)(a,3024,p),Object(s.a)(a,32823,p),Object(s.a)(a,32926,p),Object(s.a)(a,32928,p),Object(s.a)(a,3089,p),Object(s.a)(a,2960,p),Object(s.a)(a,35977,p),a)},function(t,n){t.exports=e},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(24),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(54),n(50))},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n(101);function r(e){for(var t in e)return!1;return!0}function a(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"c",function(){return a}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(120),r=n.n(i),a=n(31),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(6),a=n(12),o=n(11),s=n(13),u=n(83),c=n(23),l=n(41),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.b(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.e(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.f(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.g(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&u0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&(R(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+g+i,f=Math.max(f,p)}}return h.length>0&&R(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new w.Texture2D(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:j})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(w.readPixelsToBuffer)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:j}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(E.a)(e.url).then(function(r){var a=L(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},j,y()({},b.a.UNPACK_FLIP_Y_WEBGL,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),F=w.fp64.fp64LowPart,N=[0,0,0,255],D={iconAtlas:null,iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},fp64:!1,billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:N},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},B=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"getShaders",value:function(){return{vs:'#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n // convert size in meters to pixels, then scaled and clamp\n \n // project meters to pixels and clamp to limits \n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n\n // scale icon height to match instanceSize\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n\n // scale and rotate vertex in "pixel" value and convert back to fraction in clipspace\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0)); \n gl_Position.xy += project_pixel_size_to_clipspace(pixelOffset);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common); \n }\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors / 255.;\n\n vColorMode = instanceColorModes;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n',fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n\n // if colorMode == 0, use pixel color from the texture\n // if colorMode == 1 or rendering picking buffer, use texture as transparency mask\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n // Take the global opacity and the alpha from vColor into account for the alpha component\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","picking"]}}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new I(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:b.a.UNSIGNED_BYTE,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:4,type:b.a.UNSIGNED_BYTE,transition:!0,accessor:"getColor",defaultValue:N},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),i.fp64!==n.fp64){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new w.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.Geometry({drawMode:b.a.TRIANGLE_FAN,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(T.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var p=d.value;c.index++;var g=r(p,c);a[o++]=F(g[0]),a[o++]=F(g[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(T.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,p=c[Symbol.iterator]();!(f=(v=p.next()).done);f=!0){var g=v.value;l.index++;var m=a.getIconMapping(g,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(T.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,p=c[Symbol.iterator]();!(f=(v=p.next()).done);f=!0){var g=v.value;l.index++;var m=a.getIconMapping(g,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(T.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,p=c[Symbol.iterator]();!(f=(v=p.next()).done);f=!0){var g=v.value;l.index++;var m=a.getIconMapping(g,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}}}]),t}(x.a);B.layerName="IconLayer",B.defaultProps=D;var U=n(144),z=w.fp64.fp64LowPart,V=[0,0,0,255],G=[0,0,1],W=new w.PhongMaterial,H={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},fp64:!1,getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:G},getColor:{type:"accessor",value:V},material:W,radiusPixels:{deprecatedFor:"pointSize"}},X=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"getShaders",value:function(e){return{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n // position on the containing square in [-1, 1] space\n unitPosition = positions.xy;\n\n // Find the center of the point and add the current vertex\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), position_commonspace);\n gl_Position.xy += project_pixel_size_to_clipspace(positions.xy * radiusPixels);\n\n // Apply lighting\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, position_commonspace.xyz, project_normal(instanceNormals));\n\n // Apply opacity to instance color, or return instance picking color\n vColor = vec4(lightColor, instanceColors.a * opacity) / 255.0;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","gouraud-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:G},instanceColors:{size:4,type:b.a.UNSIGNED_BYTE,transition:!0,accessor:"getColor",defaultValue:V}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new w.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.Geometry({drawMode:b.a.TRIANGLES,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(T.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var g,m=f[Symbol.iterator]();!(d=(g=m.next()).done);d=!0){var y=g.value;h.index++;var _=s(y,h);u[c++]=z(_[0]),u[c++]=z(_[1])}}catch(e){v=!0,p=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw p}}}else e.value=new Float32Array(2)}}]),t}(x.a);X.layerName="PointCloudLayer",X.defaultProps=H;var Y=n(109),Z=n(108),q=n(141),K=n(72),Q=n(142),J=n(145),$=n(14),ee=n(127),te=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:'#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\n// the following three attributes are for the multi-icon layer\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n \n // project meters to pixels and clamp to limits \n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n // scale icon height to match instanceSize\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n\n // scale and rotate vertex in "pixel" value and convert back to fraction in clipspace\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0)); \n gl_Position.xy += project_pixel_size_to_clipspace(pixelOffset);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common); \n }\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n',fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n // if enable sdf (signed distance fields)\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n\n // Take the global opacity and the alpha from vColor into account for the alpha component\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getLengthOfQueue,f=r.getShiftInQueue,h=e.value,d=n*e.size,v=Object(T.a)(a,n,i).iterable,p=!0,g=!1,m=void 0;try{for(var y,_=v[Symbol.iterator]();!(p=(y=_.next()).done);p=!0){var b=y.value,x=o[s(b)]||{},w=l(b),E=f(b);h[d++]=(u(b)-1)*w/2+x.width/2+E||0,h[d++]=x.height/2*c(b)||0}}catch(e){g=!0,m=e}finally{try{p||null==_.return||_.return()}finally{if(g)throw m}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(T.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,p=l[Symbol.iterator]();!(f=(v=p.next()).done);f=!0){var g=o(v.value);this.encodePickingColor(g,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}}}]),t}(B);te.layerName="MultiIconLayer",te.defaultProps={getShiftInQueue:{type:"accessor",value:function(e){return e.shift||0}},getLengthOfQueue:{type:"accessor",value:function(e){return e.len||1}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ne=n(156),ie=n.n(ne);var re=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ae=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),oe="Monaco, monospace",se="normal",ue=64,ce=2,le=.25,fe=3,he=new re(3),de=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function ve(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};de.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=he.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=he.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),he.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,b.a.UNPACK_FLIP_Y_WEBGL,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");pe(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,p=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*p,canvasHeight:(v=f+(h+1)*p,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,p=d.canvasHeight,g=d.xOffset,m=d.yOffset;if(f.height!==p){var y=h.getImageData(0,0,f.width,f.height);f.height=p,h.putImageData(y,0,0)}if(pe(h,r,o,a),u){var _=new ie.a(o,s,c,l,r,a),b=h.getImageData(0,0,_.size,_.size),x=!0,w=!1,E=void 0;try{for(var P,O=t[Symbol.iterator]();!(x=(P=O.next()).done);x=!0){var S=P.value;ve(_.draw(S),b),h.putImageData(b,v[S].x-s,v[S].y-s)}}catch(e){w=!0,E=e}finally{try{x||null==O.return||O.return()}finally{if(w)throw E}}}else{var A=!0,T=!1,k=void 0;try{for(var C,M=t[Symbol.iterator]();!(A=(C=M.next()).done);A=!0){var j=C.value;h.fillText(j,v[j].x,v[j].y+.9*o)}}catch(e){T=!0,k=e}finally{try{A||null==M.return||M.return()}finally{if(T)throw k}}}return{xOffset:g,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=he.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),me={fontSize:ue,buffer:ce,sdf:!1,radius:fe,cutoff:le},ye={start:1,middle:0,end:-1},_e={top:1,center:0,bottom:-1},be=["fontSize","buffer","sdf","radius","cutoff"],xe={fp64:!1,billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ae,fontFamily:oe,fontWeight:se,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},we=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new ge(this.context.gl)}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps,i=e.changeFlags,r=this.fontChanged(n,t);r&&this.updateFontAtlas({oldProps:n,props:t}),(i.dataChanged||r||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getText))&&this.transformStringToLetters()}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},me,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return be.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this.props,t=e.data,n=e.getText,i=this.state.iconMapping,r=[],a=Object(T.a)(t),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=function(){var e=f.value;s.index++;var t=n(e,s);if(t){var a=Array.from(t),o=[0],u=0;a.forEach(function(n,a){var c={text:n,index:a,offsets:o,len:t.length,object:e,objectIndex:s.index},l=i[n];l?u+=l.width:($.a.warn("Missing character: ".concat(n))(),u+=32),o.push(u),r.push(c)})}},d=o[Symbol.iterator]();!(u=(f=d.next()).done);u=!0)h()}catch(e){c=!0,l=e}finally{try{u||null==d.return||d.return()}finally{if(c)throw l}}this.setState({data:r})}},{key:"getLetterOffset",value:function(e){return e.offsets[e.index]}},{key:"getTextLength",value:function(e){return e.offsets[e.offsets.length-1]}},{key:"_getAccessor",value:function(e){return"function"==typeof e?function(t){return e(t.object)}:e}},{key:"getAnchorXFromTextAnchor",value:function(e){return function(t){var n="function"==typeof e?e(t.object):e;if(!ye.hasOwnProperty(n))throw new Error("Invalid text anchor parameter: ".concat(n));return ye[n]}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return function(t){var n="function"==typeof e?e(t.object):e;if(!_e.hasOwnProperty(n))throw new Error("Invalid alignment baseline parameter: ".concat(n));return _e[n]}}},{key:"renderLayers",value:function(){var e=this,t=this.state,n=t.data,i=t.scale,r=t.iconAtlas,a=t.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.fp64,p=o.billboard,g=o.sdf,m=o.sizeScale,y=o.sizeUnits,_=o.sizeMinPixels,b=o.sizeMaxPixels,x=o.transitions,w=o.updateTriggers;return new(this.getSubLayerClass("characters",te))({sdf:g,iconAtlas:r,iconMapping:a,getPosition:function(e){return s(e.object)},getColor:this._getAccessor(u),getSize:this._getAccessor(c),getAngle:this._getAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this._getAccessor(d),fp64:v,billboard:p,sizeScale:m*i,sizeUnits:y,sizeMinPixels:_*i,sizeMaxPixels:b*i,transitions:x&&{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:w.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:w.getPosition,getAngle:w.getAngle,getColor:w.getColor,getSize:w.getSize,getPixelOffset:w.getPixelOffset,getAnchorX:w.getTextAnchor,getAnchorY:w.getAlignmentBaseline}}),{data:n,getIcon:function(e){return e.text},getShiftInQueue:function(t){return e.getLetterOffset(t)},getLengthOfQueue:function(t){return e.getTextLength(t)}})}}]),t}(ee.a);we.layerName="TextLayer",we.defaultProps=xe;var Ee=n(81);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return S}),n.d(t,"IconLayer",function(){return B}),n.d(t,"LineLayer",function(){return U.a}),n.d(t,"PointCloudLayer",function(){return X}),n.d(t,"ScatterplotLayer",function(){return Y.a}),n.d(t,"ColumnLayer",function(){return Z.a}),n.d(t,"GridCellLayer",function(){return q.a}),n.d(t,"PathLayer",function(){return K.a}),n.d(t,"PolygonLayer",function(){return Q.a}),n.d(t,"GeoJsonLayer",function(){return J.a}),n.d(t,"TextLayer",function(){return we}),n.d(t,"SolidPolygonLayer",function(){return Ee.a}),n.d(t,"_MultiIconLayer",function(){return te})},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(118),v=n(23),p=["longitude","latitude","zoom","bearing","pitch"],g=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(56),u=n(119),c=n(15),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0}})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(57),u=n(14),c=n(15),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],p=["keydown"],g=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e){var t=this.controllerStateProps,n=t.width,i=t.height;return e[0]>=0&&e[0]<=n&&e[1]>=0&&e[1]<=i}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,g=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,_=e.keyboard,b=void 0===_||_,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(g||y)),this.toggleEvents(v,x&&c),this.toggleEvents(p,x&&b),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=g,this.touchRotate=y,this.keyboard=b}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,Object.assign({},e.getInteractiveState(),n)),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0})}},{key:"_onPan",value:function(e){var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1})}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e);if(!this.isDragging())return!1;var n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0})}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0})}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l)}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0})}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0})}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1})}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps())}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState;switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut();break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn();break;case 37:t=n?i.rotateLeft():i.moveLeft();break;case 39:t=n?i.rotateRight():i.moveRight();break;case 38:t=n?i.rotateUp():i.moveUp();break;case 40:t=n?i.rotateDown():i.moveDown();break;default:return!1}return this.updateViewport(t,this._getTransitionProps())}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(64),r=n(52);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"b",function(){return p});var i=n(4),r=n(6),a=n(129),o=n(43),s=n(51),u=n(46),c=function(e,t){var n=Array.isArray(e)||ArrayBuffer.isView(e),i=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&i&&e.length===t.length){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),c(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function p(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(54))},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(148),r="7.1.3",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},function(e,t,n){"use strict";(function(e){var i=n(24),r=n(147),a=!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||r.a;t.a=a}).call(this,n(50))},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(18),h=n.n(f),d=n(9),v=n.n(d),p=n(80),g=n(7),m=n.n(g),y=n(1),_=n(21).experimental.Tesselator,b=y.fp64.fp64LowPart,x=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3},endPositions:{size:3},leftPositions:{size:3},rightPositions:{size:3},startEndPositions64XyLow:{size:4,fp64Only:!0},neighborPositions64XyLow:{size:4,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){return Math.max(0,this.getPathLength(e)-1)}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.leftPositions,o=n.rightPositions,s=n.startEndPositions64XyLow,u=n.neighborPositions64XyLow,c=this.fp64,l=t.geometrySize+1;if(!(l<2))for(var f,h=this.isClosed(e),d=this.getPointOnPath(e,0),v=this.getPointOnPath(e,1),p=h?this.getPointOnPath(e,l-2):d,g=t.vertexStart,m=1;m 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n // if joint is rounded, test distance from the corner\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n // Enable to debug joints\n // gl_FragColor = vec4(0., 1., 0., 1.);\n // return;\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n // Enable to debug joints\n // gl_FragColor = vec4(0., 0., 1., 1.);\n // return;\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n // Enable to debug joints\n // gl_FragColor = vec4(0., 1., 1., 1.);\n // return;\n discard;\n }\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n";n.d(t,"a",function(){return S});var E=[0,0,0,255],P={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},rounded:!1,miterLimit:{type:"number",min:0,value:4},fp64:!1,dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:E},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},O={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return this.use64bitProjection()?{vs:"\n#define SHADER_NAME path-layer-vertex-shader-64\n\nattribute vec3 positions;\n\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec4 instanceStartEndPositions64xyLow;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceNeighborPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\n\nvec3 lineJoin(vec2 prevPoint64[2], vec2 currPoint64[2], vec2 nextPoint64[2]) {\n\n float widthPixels = clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0;\n float width = project_pixel_size(widthPixels);\n\n vec2 deltaA64[2];\n vec2 deltaB64[2];\n\n vec2_sub_fp64(currPoint64, prevPoint64, deltaA64);\n vec2_sub_fp64(nextPoint64, currPoint64, deltaB64);\n\n vec2 lengthA64 = vec2_length_fp64(deltaA64);\n vec2 lengthB64 = vec2_length_fp64(deltaB64);\n\n vec2 deltaA = vec2(deltaA64[0].x, deltaA64[1].x);\n vec2 deltaB = vec2(deltaB64[0].x, deltaB64[1].x);\n\n float lenA = lengthA64.x;\n float lenB = lengthB64.x;\n\n vec2 offsetVec;\n float offsetScale;\n float offsetDirection;\n\n // when two points are closer than PIXEL_EPSILON in pixels,\n // assume they are the same point to avoid precision issue\n lenA = lenA / width > EPSILON ? lenA : 0.0;\n lenB = lenB / width > EPSILON ? lenB : 0.0;\n vec2 dirA = lenA > 0. ? deltaA / lenA : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? deltaB / lenB : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n\n // tangent of the corner\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n // direction of the corner\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n // width offset from current position\n vec2 perp = mix(perpB, perpA, positions.x);\n float L = mix(lenB, lenA, positions.x);\n\n // cap super sharp angles\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n // relative position to the corner:\n // -1: inside (smaller side of the angle)\n // 0: center\n // 1: outside (bigger side of the angle)\n float cornerPosition = mix(\n flipIfTrue(turnsRight == (positions.y > 0.0)),\n 0.0,\n positions.z\n );\n\n offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n // do not bevel if line segment is too short\n cornerPosition *= float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) / width * cosHalfA);\n // trim if inside corner extends further than the line segment\n offsetScale = mix(\n offsetScale,\n min(offsetScale, L / width / max(cosHalfA, EPSILON)),\n float(cornerPosition < 0.0)\n );\n\n vMiterLength = mix(\n offsetScale * cornerPosition,\n mix(offsetScale, 0.0, cornerPosition),\n step(0.0, cornerPosition)\n ) - sinHalfA * jointType;\n offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n\n // special treatment for start cap and end cap\n // using a small number as the limit for determining if the lenA or lenB is 0\n float isStartCap = step(lenA, 1.0e-5);\n float isEndCap = step(lenB, 1.0e-5);\n float isCap = max(isStartCap, isEndCap);\n\n // 0: center, 1: side\n cornerPosition = isCap * (1.0 - positions.z);\n\n // start of path: use next - curr\n offsetVec = mix(offsetVec, mix(dirB, perpB, cornerPosition), isStartCap);\n // end of path: use curr - prev\n offsetVec = mix(offsetVec, mix(dirA, perpA, cornerPosition), isEndCap);\n\n // extend out a triangle to envelope the round cap\n offsetScale = mix(\n offsetScale,\n mix(4.0 * jointType, 1.0, cornerPosition),\n isCap\n );\n vMiterLength = mix(vMiterLength, 1.0 - cornerPosition, isCap);\n\n offsetDirection = mix(\n offsetDirection,\n mix(flipIfTrue(isStartCap > 0.), positions.y, cornerPosition),\n isCap\n );\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n\n // Generate variables for dash calculation\n vDashArray = instanceDashArrays;\n vPathLength = L / width;\n float isEnd = positions.x;\n vec2 offsetFromStartOfPath = mix(vCornerOffset, vCornerOffset + deltaA / width, isEnd);\n vec2 dir = mix(dirB, dirA, isEnd);\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n\n return vec3(vCornerOffset * width, 0.0);\n}\n\nvoid main() {\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n // Calculate current position 64bit\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceStartEndPositions64xyLow.xy, instanceStartEndPositions64xyLow.zw, isEnd);\n vec2 projected_curr_position[2];\n project_position_fp64(currPosition.xy, currPosition64xyLow, projected_curr_position);\n float projected_curr_position_z = project_size(currPosition.z);\n\n // Calculate previous position\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceNeighborPositions64xyLow.xy, instanceStartEndPositions64xyLow.xy, isEnd);\n\n // Calculate prev position 64bit\n\n vec2 projected_prev_position[2];\n project_position_fp64(prevPosition.xy, prevPosition64xyLow, projected_prev_position);\n\n // Calculate next positions\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceStartEndPositions64xyLow.zw, instanceNeighborPositions64xyLow.zw, isEnd);\n\n // Calculate next position 64bit\n\n vec2 projected_next_position[2];\n project_position_fp64(nextPosition.xy, nextPosition64xyLow, projected_next_position);\n\n vec3 pos = lineJoin(projected_prev_position, projected_curr_position, projected_next_position);\n vec2 vertex_pos_modelspace[4];\n\n vertex_pos_modelspace[0] = sum_fp64(vec2(pos.x, 0.0), projected_curr_position[0]);\n vertex_pos_modelspace[1] = sum_fp64(vec2(pos.y, 0.0), projected_curr_position[1]);\n vertex_pos_modelspace[2] = vec2(pos.z + projected_curr_position_z, 0.0);\n vertex_pos_modelspace[3] = vec2(1.0, 0.0);\n\n gl_Position = project_common_position_to_clipspace_fp64(vertex_pos_modelspace);\n}\n",fs:w,modules:["project64","picking"]}:{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec4 instanceStartEndPositions64xyLow;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceNeighborPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\n\n// calculate line join positions\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n\n // when two points are closer than PIXEL_EPSILON in pixels,\n // assume they are the same point to avoid precision issue\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n\n // tangent of the corner\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n // direction of the corner\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n // width offset from current position\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n\n // cap super sharp angles\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n\n // do not bevel if line segment is too short\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n\n // trim if inside corner extends further than the line segment\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n\n // special treatment for start cap and end cap\n // TODO - This has an issue. len is always positive because it is length.\n // Step returns zero if -lenA<0, so practically this is a comparison of\n // lenA with zero, with lots of problems because of the -lenA. Can we use EPSILON?\n bool isStartCap = step(0.0, -lenA) > 0.5;\n bool isEndCap = step(0.0, -lenB) > 0.5;\n bool isCap = isStartCap || isEndCap;\n\n // 0: center, 1: side\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n\n // start of path: use next - curr\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n\n // end of path: use curr - prev\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n\n // extend out a triangle to envelope the round cap\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n\n // Generate variables for dash calculation\n vDashArray = instanceDashArrays;\n vPathLength = L;\n // vec2 offsetFromStartOfPath = isEnd ? vCornerOffset + deltaA : vCornerOffset;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n\n return currPoint + vec3(vCornerOffset * width, 0.0);\n}\n\n// calculate line join positions\n// extract params from attributes and uniforms\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n // relative position to the corner:\n // -1: inside (smaller side of the angle)\n // 0: center\n // 1: outside (bigger side of the angle)\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels)\n );\n}\n\n// In clipspace extrusion, if a line extends behind the camera, clip it to avoid visual artifacts\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceNeighborPositions64xyLow.xy, instanceStartEndPositions64xyLow.xy, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceStartEndPositions64xyLow.xy, instanceStartEndPositions64xyLow.zw, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceStartEndPositions64xyLow.zw, instanceNeighborPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n // Extrude in clipspace\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n // Extrude in commonspace\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec3 pos = lineJoin(prevPosition, currPosition, nextPosition);\n gl_Position = project_common_position_to_clipspace(vec4(pos, 1.0));\n }\n}\n",fs:w,modules:["project32","picking"]}}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({instanceStartPositions:{size:3,transition:O,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0},instanceEndPositions:{size:3,transition:O,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0},instanceStartEndPositions64xyLow:{size:4,update:this.calculateInstanceStartEndPositions64xyLow,noAlloc:!0},instanceLeftPositions:{size:3,accessor:"getPath",update:this.calculateLeftPositions,noAlloc:!0},instanceRightPositions:{size:3,accessor:"getPath",update:this.calculateRightPositions,noAlloc:!0},instanceNeighborPositions64xyLow:{size:4,update:this.calculateInstanceNeighborPositions64xyLow,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:O,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:4,type:m.a.UNSIGNED_BYTE,accessor:"getColor",transition:O,defaultValue:E},instancePickingColors:{size:3,type:m.a.UNSIGNED_BYTE,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new x({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||i.fp64!==n.fp64||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions()}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),a.invalidateAll()}if(i.fp64!==n.fp64){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new y.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new y.Geometry({drawMode:m.a.TRIANGLES,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateInstanceStartEndPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startEndPositions64XyLow"):new Float32Array(4)}},{key:"calculateLeftPositions",value:function(e){var t=this.state.pathTesselator;e.value=t.get("leftPositions")}},{key:"calculateRightPositions",value:function(e){var t=this.state.pathTesselator;e.value=t.get("rightPositions")}},{key:"calculateInstanceNeighborPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("neighborPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(7),v=n.n(d),p=n(117),g=n(1),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(g.withParameters)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,p=void 0===v||v,g=e.effects,m=e.effectProps,y=this.gl;p&&this.clearCanvas(y);var _=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:g,effectProps:m});_.push(l)}),_}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(g.withParameters)(e,{scissorTest:!0,scissor:l},function(){return Object(g.clear)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(g.setParameters)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(g.withParameters)(e,{viewport:[0,0,t,n]},function(){e.clear(v.a.COLOR_BUFFER_BIT|v.a.DEPTH_BUFFER_BIT)})}}]),t}(p.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return E});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(125),v=n(23),p=n(58),g=n(86),m=n(56),y=n(57),_={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},b={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?_.orbitAxis:s,f=e.rotationX,h=void 0===f?_.rotationX:f,d=e.rotationOrbit,v=void 0===d?_.rotationOrbit:d,p=e.target,g=void 0===p?_.target:p,m=e.zoom,y=void 0===m?_.zoom:m,b=e.fovy,x=void 0===b?_.fovy:b,w=e.minZoom,E=void 0===w?_.minZoom:w,P=e.maxZoom,O=void 0===P?_.maxZoom:P,S=e.startPanPosition,A=e.startTarget,T=e.startRotationX,k=e.startRotationOrbit,C=e.startZoomPosition,M=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:g,fovy:x,zoom:y,minZoom:E,maxZoom:O})))._interactiveState={startPanPosition:S,startTarget:A,startRotationX:T,startRotationOrbit:k,startZoomPosition:C,startZoom:M},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),p=x(d),g=(o/2-f[0])*(p/v-1),m=(s/2-f[1])*(p/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[g,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(b.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==_()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==_()(n)||null===n)return"".concat(u," changed shallowly");for(var c in n)if(!(c in r)){if(!(c in t))return"".concat(u,".").concat(c," dropped");var l=t[c],f=n[c],h=o[c],d=h&&h.equal;if(d&&!d(l,f,h))return"".concat(u,".").concat(c," changed deeply");if(!d&&(d=l&&f&&l.equals)&&!d.call(l,f))return"".concat(u,".").concat(c," changed deeply");if(!d&&f!==l)return"".concat(u,".").concat(c," changed shallowly")}for(var v in t)if(!(v in r||v in n))return"".concat(u,".").concat(v," added: undefined -> ").concat(t[v]);return null}function E(e,t,n){var i=e.updateTriggers[n];i=null==i?{}:i;var r=t.updateTriggers[n];return w({oldProps:r=null==r?{}:r,newProps:i,triggerName:n})}function P(e){var t=e._component,n=t&&t.constructor;return n?n._propTypes:{}}var O=n(121),S=n(14),A=n(7),T=n.n(A),k=n(1),C=n(96),M=n(66),j={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return F(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return L(e,t)}},accessor:{validate:function(e,t){var n=N(e);return"function"===n||n===N(t.value)},equal:function(e,t,n){return"function"==typeof t||L(e,t)}},array:{validate:function(e,t){return t.optional&&!e||F(e)},equal:function(e,t,n){return n.compare?L(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function L(e,t){if(e===t)return!0;if(!F(e)||!F(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=G,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps={},this.oldProps)this.oldAsyncProps[e]=this.oldProps[e]}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(b.a)(void 0!==t),this.freezeAsyncOldProps(),t=this._postProcessValue(e,t),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){return n._setAsyncPropValue(e,t,r)}).catch(function(e){return S.a.error(e)()})}},{key:"_postProcessValue",value:function(e,t){var n=(this.component?this.component.props:{}).dataTransform;return"data"===e&&n&&(t=n(t)),t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),H=0,X=function(){function e(){o()(this,e),this.props=function(){for(var e=B(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(C.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(Z.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(b.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(b.a)(Array.isArray(e)),Object(C.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){S.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(b.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){S.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(b.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitProjection",value:function(){if(this.props.fp64){if(this.props.coordinateSystem===p.a.LNGLAT_DEPRECATED)return!0;S.a.once(0,"Legacy 64-bit mode only works with coordinateSystem set to\n COORDINATE_SYSTEM.LNGLAT_DEPRECATED. Rendering in 32-bit mode instead")()}return!1}},{key:"use64bitPositions",value:function(){return this.props.fp64||this.props.coordinateSystem===p.a.LNGLAT||this.props.coordinateSystem===p.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return S.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(b.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(b.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();t.dataChanged&&n&&n.invalidateAll()}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(S.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(S.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=this.getModels();if(r.length>0)for(var a=t.getChangedAttributes({clearChangedFlags:!0}),o=0,s=r.length;o2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=p,a[3*l+2]=g,u&&(o[2*l]=x(v),o[2*l+1]=x(p)),s[l]=1,l++}if(h)for(var m=0;m0&&void 0!==arguments[0]?arguments[0]:[];return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}}]),e}(),u=function(){function e(){Object(i.a)(this,e),this.shaderModules={},this.defaultShaderModules=[]}return Object(r.a)(e,[{key:"setDefaultShaderModules",value:function(e){this.defaultShaderModules=this.resolveModules(e)}},{key:"registerShaderModules",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof s)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof s)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new s(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"c",function(){return h}),n.d(t,"a",function(){return d});var c=new u;function l(e){c.setDefaultShaderModules(e)}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;c.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(c.defaultShaderModules),v(e=c.resolveModules(e))}function d(e){return c.getShaderModule(e)}function v(e){var t={},n={};return p({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function p(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]=0&&e=0&&e0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,g=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},p({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:g}))}},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var p,g=e[Symbol.iterator]();!(l=(p=g.next()).done);l=!0){c+=f(p.value)}}catch(e){d=!0,v=e}finally{try{l||null==g.return||g.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var p=0,g=!0,m=!1,y=void 0;try{for(var _,b=e[Symbol.iterator]();!(g=(_=b.next()).done);g=!0){p=c(i,p,_.value,t),r.push(p)}}catch(e){m=!0,y=e}finally{try{g||null==b.return||b.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function p(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,t,n){"use strict";(function(e,i){n.d(t,"a",function(){return a});var r=n(124),a="object"!==(void 0===e?"undefined":Object(r.a)(e))||"[object process]"!==String(e)||e.browser;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document}).call(this,n(50),n(54))},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(65),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(1),v=n(94),p=n(68),g={color:[255,255,255],intensity:1},m=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],y=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n.applyDefaultLights(),n}return h()(t,e),o()(t,[{key:"getParameters",value:function(e){var t=this.ambientLight,n=this.getProjectedPointLights(e);return{lightSources:{ambientLight:t,directionalLights:this.getProjectedDirectionalLights(e),pointLights:n}}}},{key:"applyDefaultLights",value:function(){var e=this.ambientLight,t=this.pointLights,n=this.directionalLights;e||0!==t.length||0!==n.length||(this.ambientLight=new d.AmbientLight(g),this.directionalLights.push(new v.a(m[0])),this.directionalLights.push(new v.a(m[1])))}},{key:"getProjectedPointLights",value:function(e){for(var t=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.withParameters)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new v.ClipSpace(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(v.clear)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(117).a),g=n(146);n.d(t,"a",function(){return m});var m=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(g.a)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=b(t),a=new p(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=b(t,r),s="".concat(n,"-").concat(a);return new p(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return y(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return _(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(20),r=n.n(i),a=n(27),o=n(84),s=n(40),u=n(41),c=n(29);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],p=h[2];if(i){var g=s.c([],[d,v,p,1],i),m=r()(g,3);d=m[0],v=m[1],p=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,p],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],p+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,p]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,p])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),p=l(s,i,!0);return u.h(v,v,p),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(4),r=n(6),a=n(12),o=n(11),s=n(13),u=n(28),c=n(22),l=n(39),f=n(29),h=n(19),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),p=Object(c.a)(v,3),g=p[0],m=p[1],y=p[2];return Number.isFinite(u)?[g,m,y]:Number.isFinite(r)?[g,m,r]:[g,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),p=n(130),g=n(36);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,p=void 0===v?0:v,g=n.pitch,m=void 0===g?0:g,y=n.bearing,_=void 0===y?0:y,b=n.altitude,x=void 0===b?1.5:b,w=n.nearZMultiplier,E=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(f.l)(p);x=Math.max(.75,x);var O=Object(f.g)([d,l],P);O[2]=0;var S=Object(f.d)({width:r,height:s,pitch:m,bearing:_,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:E||1.01}),A=Object(f.f)({height:s,center:O,pitch:m,bearing:_,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:A,projectionMatrix:S}))).latitude=l,e.longitude=d,e.zoom=p,e.pitch=m,e.bearing=_,e.altitude=x,e.scale=P,e.center=O,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=g.a([],r,g.e([],i)),o=g.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(p.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,function(e,t,n){"use strict";(function(e){var t=n(65),i=n(92);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function g(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return g(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var _,b,x=n(111);n.d(t,"c",function(){return S}),n.d(t,"b",function(){return A}),n.d(t,"a",function(){return T});var w=(_={},Object(r.a)(_,a.b,"vertex"),Object(r.a)(_,a.a,"fragment"),_),E=(b={},Object(r.a)(b,a.b,{}),Object(r.a)(b,a.a,{}),b),P={},O="precision highp float;\n\n";function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");E[a][s]=Object.assign(t,{signature:o})}function A(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);P[e]=P[e]||{},P[e][o]=P[e][o]||{},Object(s.a)(!P[e][o][n],"Module injection already created"),P[e][o][n]={injection:i,order:a}}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.vs,i=t.fs,r=Object(o.c)(t.modules||[]);return{gl:e,vs:k(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:k(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:C(r),modules:M(r)}}function k(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=void 0===o?[]:o,c=t.defines,l=void 0===c?{}:c,f=t.inject,h=void 0===f?{}:f,v=t.prologue,g=void 0===v||v,_=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var b=r===a.b,S=i.split("\n"),A=100,T="",k=i;0===S[0].indexOf("#version ")&&(A=300,T=S[0],k=S.slice(1).join("\n"));var C={};u.forEach(function(e){Object.assign(C,e.getDefines())}),Object.assign(C,l);var M=g?"".concat(T,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(w[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(w[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&p(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&p(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(C),"\n").concat(b?"":O,"\n"):"".concat(T,"\n"),j=!1,L={},R={};for(var I in h){var F="string"==typeof h[I]?{injection:h[I],order:0}:h[I];I.match(/^(v|f)s:/)?"#"===I[3]?R[I]=[F]:L[I]=[F]:R[I]=[F]}var N=!0,D=!1,B=void 0;try{for(var U,z=u[Symbol.iterator]();!(N=(U=z.next()).done);N=!0){var V=U.value;switch(V.name){case"inject":j=!0;break;default:if(V.checkDeprecations(k,_),M+=V.getModuleSource(r,A),P[V.name]){var G=P[V.name][r];for(var W in G)W.match(/^(v|f)s:#/)?(R[W]=R[W]||[],R[W].push(G[W])):(L[W]=L[W]||[],L[W].push(G[W]))}}}}catch(e){D=!0,B=e}finally{try{N||null==z.return||z.return()}finally{if(D)throw B}}return M+=function(e,t){var n="",i=E[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,L),M+=k,M=Object(x.b)(M,r,R,j)}function C(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function M(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.a)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;var n=Array.isArray(e)||ArrayBuffer.isView(e),i=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&i&&e.length===t.length){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,p=void 0===v?0:v,m=n.nearZMultiplier,_=void 0===m?.1:m,b=n.farZMultiplier,x=void 0===b?10:b,w=n.orthographic,E=void 0!==w&&w,P=n.width,O=n.height,S=n.altitude,A=void 0===S?1.5:S;P=P||1,O=O||1,A=Math.max(.75,A);var T=Object(y.e)({width:P,height:O,pitch:d,altitude:A,nearZMultiplier:_,farZMultiplier:x}),k=T.fov,C=T.aspect,M=T.focalDistance,j=T.near,L=T.far,R=Object(y.f)({height:O,pitch:d,bearing:p,altitude:A}),I=Object.assign({},n,{width:P,height:O,viewMatrix:R,longitude:s,latitude:r,zoom:c,orthographic:E,fovyRadians:k,aspect:C,orthographicFocalDistance:M,near:j,far:L});return(e=l()(this,h()(t).call(this,I))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=p,e.altitude=A,e.orthographic=E,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(g()(g()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(g()(g()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(g()(g()(e))),Object.freeze(g()(g()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=b.a([],r,b.e([],i)),o=b.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(_.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);E.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(120),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(15),l=n(1),f=n(31),h=n.n(f),d=n(80),v=n(66),p=n(14),g=n(53),m=n(187),y=n(34),_=n(47),b=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},b,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l._ShaderCache({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(_.e)(this._initSeer),Object(_.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return p.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(g.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){p.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?p.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&p.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(_.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(_.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){p.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var g=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||g}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){p.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){p.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(p.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):p.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){p.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){p.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){p.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,p.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(_.b)(e),Object(_.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(_.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(20),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(8),l=n.n(c),f=n(5),h=n.n(f),d=n(9),v=n.n(d),p=n(58),g=n(86),m=n(23),y=n(48);function _(e,t){return Number.isFinite(e)?e:t}var b=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),p=e.startPanPosition,g=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,_=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:p,startRotateCenter:g,startRotateViewport:m,startZoomPos:y,startZoom:_},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=_(s,this._viewportProps.translationX),u=_(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(g.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,b,e))}return v()(t,e),t}(p.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(58),v=n(79),p=n(56),g=n(57),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new p.a(["target","zoom"]),transitionInterruption:g.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(20),u=n.n(s),c=n(8),l=n.n(c),f=n(5),h=n.n(f),d=n(18),v=n.n(d),p=n(9),g=n.n(p),m=n(7),y=n.n(m),_=n(1),b=n(15),x=n(71),w=n(53),E=[],P=[[0,1/0]];var O=n(14),S=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(_.uid)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?y.a.ELEMENT_ARRAY_BUFFER:y.a.ARRAY_BUFFER,this.type=o,u&&!o&&(this.type=t&&Object(_.hasFeature)(t,_.FEATURES.ELEMENT_INDEX_UINT32)?y.a.UNSIGNED_INT:y.a.UNSIGNED_SHORT),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a);for(var o=this.offset/4,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,p=i.bufferLayout,g=void 0===p?null:p,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var _=i.shaderAttributes;for(var b in _){var x=_[b];n.shaderAttributes[b]=new t(n.gl,Object.assign({},x,{id:b,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,A,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:g}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return g()(t,e),o()(t,[{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getInstanceCount",value:function(){return null!==this.value?this.value.length/this.size:0}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===P)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=P}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=E}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;var n=this.getInstanceCount();if((0===n||n=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(S);function k(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){case y.a.FLOAT:return Float32Array;case y.a.UNSIGNED_SHORT:case y.a.UNSIGNED_SHORT_5_6_5:case y.a.UNSIGNED_SHORT_4_4_4_4:case y.a.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;case y.a.UNSIGNED_INT:return Uint32Array;case y.a.UNSIGNED_BYTE:return n?Uint8ClampedArray:Uint8Array;case y.a.BYTE:return Int8Array;case y.a.SHORT:return Int16Array;case y.a.INT:return Int32Array;default:throw new Error("Failed to deduce type from array")}}function C(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof _.Buffer){var c=new Float32Array(r),l=t.getData({}),f=n.size,h=n.constant,d=h?n.getValue():n.getBuffer().getData({}),v=h?function(e,t){return u(d,t)}:function(e,t){return u(d.subarray(e,e+f),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.getData,a=e.sourceLayout,o=e.targetLayout;if(!Array.isArray(o))return C({source:t,target:n,getData:r}),n;for(var s=0,u=0,c=r&&function(e,t){return r(e+u,t)},l=Math.min(a.length,o.length),f=0;f0),this.needsRedraw=!0;var n=Object.assign({},F,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return U});function D(){}var B={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;O.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;B.savedMessages=[],B.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;B.savedMessages&&B.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-B.timeStart),a="".concat(r,"ms");O.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=B.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;O.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}O.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),B.savedMessages=null}},U=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new N(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(B.onLog=t||D),void 0!==n&&(B.onUpdateStart=n||D),void 0!==i&&(B.onUpdate=i||D),void 0!==r&&(B.onUpdateEnd=r||D)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in B.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h],this.numInstances)||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&B.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&O.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new T(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),O.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&B.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);B.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(18),h=n.n(f),d=n(9),v=n.n(d),p=n(71),g=n(80),m=n(7),y=n.n(m),_=n(1),b=n(154),x=n.n(b),w=n(14),E=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(_.uid)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;w.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n // project center of column\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n // Light calculations\n // Worldspace is the linear space after Mercator projection\n\n vec3 normals_commonspace = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.0;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.0;\n }\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","gouraud-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:4,type:y.a.UNSIGNED_BYTE,transition:!0,accessor:"getFillColor",defaultValue:S},instanceLineColors:{size:4,type:y.a.UNSIGNED_BYTE,transition:!0,accessor:"getLineColor",defaultValue:S},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=n.fp64!==i.fp64;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new E({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:4,transition:!0,type:y.a.UNSIGNED_BYTE,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:y.a.UNSIGNED_BYTE,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new _.Model(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new _.Geometry({drawMode:y.a.TRIANGLE_FAN,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(p.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var _=m.value;h.index++;var x=s(_,h);u[c++]=b(x[0]),u[c++]=b(x[1])}}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(g.a);E.layerName="ScatterplotLayer",E.defaultProps=w},function(e,t,n){"use strict";var i=n(20),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(8),l=n.n(c),f=n(5),h=n.n(f),d=n(9),v=n.n(d),p=n(23),g=n(58),m=n(86),y=n(97),_=n(39),b=85.05113,x=-85.05113;var w=n(15),E=n(56),P=n(57);n.d(t,"a",function(){return C});var O={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new E.a,transitionInterruption:P.a.BREAK},S={transitionDuration:0},A={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},T={pitch:0,bearing:0,altitude:1.5},k=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?T.bearing:c,d=n.pitch,v=void 0===d?T.pitch:d,p=n.altitude,g=void 0===p?T.altitude:p,m=n.maxZoom,y=void 0===m?A.maxZoom:m,_=n.minZoom,b=void 0===_?A.minZoom:_,x=n.maxPitch,E=void 0===x?A.maxPitch:x,P=n.minPitch,O=void 0===P?A.minPitch:P,S=n.startPanLngLat,k=n.startZoomLngLat,C=n.startBearing,M=n.startPitch,j=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:g,maxZoom:y,minZoom:b,maxPitch:E,minPitch:O})))._interactiveState={startPanLngLat:S,startZoomLngLat:k,startBearing:C,startPitch:M,startZoom:j},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(p.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(p.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(_.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(_.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,b])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),C=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,k,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return O}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,S,{isDragging:!0})}}]),t}(g.a)},function(e,t,n){"use strict";var i,r=n(0),a=n(49),o=n(73);n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u=/void main\s*\([^)]*\)\s*\{\n?/,c=/}\n?[^{}]*$/,l=[];function f(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),l.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(14),u=n(8),c=n.n(u),l=n(5),f=n.n(l),h=n(18),d=n.n(h),v=n(9),p=n.n(v),g=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return p()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(78).a),m=n(122),y=n(123),_=n(95),b=n(1);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new g(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,p=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,g=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h}),m=this.lastPostProcessEffect?this.screenBuffer:b.Framebuffer.getDefaultFramebuffer(this.gl),y=p.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:g,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof _.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new b.Framebuffer(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new b.Framebuffer(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof _.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:b.Framebuffer.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(24),r=n(114);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(50))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(24);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(50))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(6),a=n(12),o=n(11),s=n(13),u=n(23);var c=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"clone",value:function(){return(new this.constructor).copy(this).check()}},{key:"copy",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(23),u=n(15),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){var i=n(173),r=n(174),a=n(175);e.exports=function(e){return i(e)||r(e)||a()}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(33),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(18),h=n.n(f),d=n(9),v=n.n(d),p=n(78),g=n(1),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(g.withParameters)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[v.ONE,v.ZERO,v.CONSTANT_ALPHA,v.ZERO],blendEquation:v.FUNC_ADD,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(p.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(15);function r(e){return Object(i.a)("boolean"==typeof e,"Invalid useDevicePixels"),e&&"undefined"!=typeof window?window.devicePixelRatio:1}},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(6),a=n(12),o=n(11),s=n(13),u=n(83),c=n(36),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(83).a),g=n(19),m=n(36),y=n(41),_=n(40);n.d(t,"a",function(){return x});var b=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,p=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=p,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,p=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=p,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return g.a(this)}},{key:"identity",value:function(){return this.copy(b)}},{key:"fromQuaternion",value:function(e){return g.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return g.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return g.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return g.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return g.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return g.p(this,this),this.check()}},{key:"invert",value:function(){return g.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return g.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return g.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return g.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return g.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return g.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return g.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?g.n(this,this,e):g.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return g.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.i(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new p,_.c(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,_.c(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,_.c(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new p,_.c(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(18),h=n.n(f),d=n(9),v=n.n(d),p=n(80),g=n(14),m=n(53),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){h()(l()(t.prototype),"setState",this).call(this,e),this.setLayerNeedsUpdate()}},{key:"getPickingInfo",value:function(e){return e.info}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,f=t.coordinateOrigin,h=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,p=t._subLayerProps,g={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:v};return e&&Object.assign(g,e,p&&p[e.id],{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers)}),g}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?g.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,g.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(p.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(104),u=n(15),c=n(87),l=n(38),f=n(34),h=n(14),d=n(53),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return o()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"project",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{topLeft:!0},n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.contains(e,t))return r.project(e,t)}return null}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.containsPixel(e,t))return r.unproject(e)}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(u.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(d.b)(e,{filter:Boolean}).map(function(e){return e instanceof f.a?new l.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(c.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):h.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this,t=this.width,n=this.height,i=this.views,r=this.controllers;for(var a in this.controllers={},this._viewports=i.map(function(i){var a=e.getViewState(i),o=i.makeViewport({width:t,height:n,viewState:a});return e.controllers[i.id]=e._updateController(i,a,o,r[i.id]),o}),r)r[a]&&!this.controllers[a]&&r[a].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),p=n(102),g=n(93),m=function(){function e(){r()(this,e),this.effects=[],this._needsRedraw="Initial render",this.defaultLightingEffect=new g.a,this.needApplyDefaultLighting=!1}return o()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(c.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed")),this.checkLightingEffect()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){var e=this.effects;return this.needApplyDefaultLighting&&(e=this.effects.slice()).push(this.defaultLightingEffect),e}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}this.effects.length=0}},{key:"checkLightingEffect",value:function(){var e=!1,t=!0,n=!1,i=void 0;try{for(var r,a=this.effects[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){if(r.value instanceof g.a){e=!0;break}}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}this.needApplyDefaultLighting=!e}}]),e}(),y=n(68),_=n(112),b=n(1),x=n(123),w=n(122),E={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function P(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,d=-1,v=0,p=0;pf)v+=4*c;else for(var y=0;y=0){var _=y+s-i,b=_*_+m;b<=f&&(f=b,d=v)}v+=4}}if(d>=0){var x=t[d+3]-1,w=t.slice(d,d+4),P=n[x];if(P){var O=P.decodePickingColor(w);return{pickedColor:w,pickedLayer:P,pickedObjectIndex:O}}h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return E}function O(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var p=n.index,g=n.layerId,m=h&&h.props.id;if(m!==g||d!==p){if(m!==g){var y=r.find(function(e){return e.props.id===g});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var _={viewports:a}.viewports[0],b=_&&_.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:b,lngLat:b,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=S({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function S(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var A=function(){function e(t){r()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new w.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(x.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new b.Framebuffer(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-r*f),v=Math.round(a*f),p=this.pickingFBO,g=p.width,m=p.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:g,deviceHeight:m}),_=[],b={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:p,redrawReason:s}),layers:t}),m=new Map;return g.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=S({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(u.a)(r),Object(u.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(u.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,c=r.y,l=r.width,f=r.height,h=new Uint8Array(l*f*4);return Object(b.readPixelsToArray)(o,{sourceX:s,sourceY:c,sourceWidth:l,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight;if(!(t>=0&&n>=0&&t0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&I&&0===e.which&&(t=F),this.pressed&&(t&F&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var z=U;var V=z?[[z.Rotate,{enable:!1}],[z.Pinch,{enable:!1}],[z.Swipe,{enable:!1}],[z.Pan,{threshold:0,enable:!1}],[z.Press,{enable:!1}],[z.Tap,{event:"doubletap",taps:2,enable:!1}],[z.Tap,{event:"anytap",enable:!1}],[z.Tap,{enable:!1}]]:null,G={rotate:["pinch"],doubletap:["anytap"],anytap:["tap"]},W={doubletap:["tap"]},H={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},X=["keydown","keyup"],Y=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],Z=["wheel","mousewheel","DOMMouseScroll"],q={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",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"},K={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Q=n(75),J=-1!==Q.b.indexOf("firefox"),$=Z,ee=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(j.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=$.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!Q.a&&{passive:!1})})}return Object(L.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;Q.c.WheelEvent&&(J&&e.deltaMode===Q.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=Q.c.devicePixelRatio),e.deltaMode===Q.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),te=Y,ne=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(j.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=te.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(L.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),ie=X,re=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(j.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=ie.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(L.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),ae=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(j.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(L.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),oe=1,se=2,ue=4,ce={pointerdown:oe,pointermove:se,pointerup:ue,mousedown:oe,mousemove:se,mouseup:ue},le=1,fe=2,he=3,de=0,ve=1,pe=2,ge=1,me=2,ye=4;var _e=function(){function e(t){Object(j.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(L.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(j.a)(this,e),this.options=Object.assign({},be,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(L.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||V}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(G).forEach(function(e){var n=t.manager.get(e);n&&G[e].forEach(function(e){n.recognizeWith(e)})}),this.wheelInput=new ee(e,this._onOtherEvent,{enable:!1}),this.moveInput=new ne(e,this._onOtherEvent,{enable:!1}),this.keyInput=new re(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new ae(e,this._onOtherEvent,{enable:!1});var r=!0,a=!1,o=void 0;try{for(var s,u=this.events[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=Object(M.a)(s.value,2),l=c[0],f=c[1];f.isEmpty()||(this._toggleRecognizer(f.recognizerName,!0),this.manager.on(l,f.handleEvent))}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=W[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=K[e]||e,o=r.get(a);o||(o=new _e(this),r.set(a,o),o.recognizerName=q[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=K[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=H[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),we=n(27);function Ee(){}n.d(t,"a",function(){return Oe});var Pe={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,_animate:!1,onWebGLInitialized:Ee,onResize:Ee,onViewStateChange:Ee,onBeforeRender:Ee,onAfterRender:Ee,onLoad:Ee,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Oe=function(){function e(t){r()(this,e),t=Object.assign({},Pe,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerLeave=this._onPointerLeave.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new C.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return o()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&h.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&h.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(u.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new b.AnimationLoop({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(b.createGLContext)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new p.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_requestPick",value:function(e){var t=e.event,n=e.callback,i=e.mode,r=this._pickRequest;if("pointerleave"===t.type)r.x=-1,r.y=-1,r.radius=0;else{var a=t.offsetCenter;if(!a)return;r.x=a.x,r.y=a.y,r.radius=this.props.pickingRadius}r.callback=n,r.event=t,r.mode=i}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(b.trackContextState)(e,{enable:!0,copyState:!0})),Object(b.setParameters)(e,{blend:!0,blendFunc:[k.a.SRC_ALPHA,k.a.ONE_MINUS_SRC_ALPHA,k.a.ONE,k.a.ONE_MINUS_SRC_ALPHA],polygonOffsetFill:!0,depthTest:!0,depthFunc:k.a.LEQUAL}),this.props.onWebGLInitialized(e),this.eventManager=new xe(e.canvas,{events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerLeave}}),we.b)this.eventManager.on(t,this._onEvent);this.viewManager=new v({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(u.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new s.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new m,this.deckRenderer=new _.a(e),this.deckPicker=new A(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(b.setParameters)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),h.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=we.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y})}},{key:"_onPointerMove",value:function(e){e.leftButton||e.rightButton||this._requestPick({callback:this.props.onHover,event:e,mode:"hover"})}},{key:"_onPointerLeave",value:function(e){this._requestPick({callback:this.props.onHover,event:e,mode:"hover"})}},{key:"_getFrameStats",value:function(){this.stats.get("frameRate").timeEnd(),this.stats.get("frameRate").timeStart();var e=this.animationLoop.stats;this.stats.get("GPU Time").addTime(e.get("GPU Time").lastTiming),this.stats.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){this.metrics.fps=this.stats.get("frameRate").getHz(),this.metrics.setPropsTime=this.stats.get("setProps Time").time,this.metrics.updateAttributesTime=this.stats.get("Update Attributes").time,this.metrics.framesRedrawn=this.stats.get("Redraw Count").count,this.metrics.pickTime=this.stats.get("pickObject Time").time+this.stats.get("pickMultipleObjects Time").time+this.stats.get("pickObjects Time").time,this.metrics.pickCount=this.stats.get("Pick Count").count,this.metrics.gpuTime=this.stats.get("GPU Time").time,this.metrics.cpuTime=this.stats.get("CPU Time").time,this.metrics.gpuTimePerFrame=this.stats.get("GPU Time").getAverageTime(),this.metrics.cpuTimePerFrame=this.stats.get("CPU Time").getAverageTime();var e=b.lumaStats.get("Memory Usage");this.metrics.bufferMemory=e.get("Buffer Memory").count,this.metrics.textureMemory=e.get("Texture Memory").count,this.metrics.renderbufferMemory=e.get("Renderbuffer Memory").count,this.metrics.gpuMemory=e.get("GPU Memory").count}}]),e}();Oe.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(y.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Oe.defaultProps=Pe},function(e,t,n){"use strict";var i=n(0);t.a={enable:function(e,t){return e(Object(i.a)({},t,!0))},disable:function(e,t){return e(Object(i.a)({},t,!1))},pixelStorei:function(e,t,n){return e(Object(i.a)({},t,n))},hint:function(e,t,n){return e(Object(i.a)({},t,n))},bindFramebuffer:function(e,t,n){var r;switch(t){case 36160:return e((r={},Object(i.a)(r,36006,n),Object(i.a)(r,36010,n),r));case 36009:return e(Object(i.a)({},36006,n));case 36008:return e(Object(i.a)({},36010,n));default:return null}},blendColor:function(e,t,n,r,a){return e(Object(i.a)({},32773,new Float32Array([t,n,r,a])))},blendEquation:function(e,t){var n;return e((n={},Object(i.a)(n,32777,t),Object(i.a)(n,34877,t),n))},blendEquationSeparate:function(e,t,n){var r;return e((r={},Object(i.a)(r,32777,t),Object(i.a)(r,34877,n),r))},blendFunc:function(e,t,n){var r;return e((r={},Object(i.a)(r,32969,t),Object(i.a)(r,32968,n),Object(i.a)(r,32971,t),Object(i.a)(r,32970,n),r))},blendFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,32969,t),Object(i.a)(o,32968,n),Object(i.a)(o,32971,r),Object(i.a)(o,32970,a),o))},clearColor:function(e,t,n,r,a){return e(Object(i.a)({},3106,new Float32Array([t,n,r,a])))},clearDepth:function(e,t){return e(Object(i.a)({},2931,t))},clearStencil:function(e,t){return e(Object(i.a)({},2961,t))},colorMask:function(e,t,n,r,a){return e(Object(i.a)({},3107,[t,n,r,a]))},cullFace:function(e,t){return e(Object(i.a)({},2885,t))},depthFunc:function(e,t){return e(Object(i.a)({},2932,t))},depthRange:function(e,t,n){return e(Object(i.a)({},2928,new Float32Array([t,n])))},depthMask:function(e,t){return e(Object(i.a)({},2930,t))},frontFace:function(e,t){return e(Object(i.a)({},2886,t))},lineWidth:function(e,t){return e(Object(i.a)({},2849,t))},polygonOffset:function(e,t,n){var r;return e((r={},Object(i.a)(r,32824,t),Object(i.a)(r,10752,n),r))},sampleCoverage:function(e,t,n){var r;return e((r={},Object(i.a)(r,32938,t),Object(i.a)(r,32939,n),r))},scissor:function(e,t,n,r,a){return e(Object(i.a)({},3088,new Int32Array([t,n,r,a])))},stencilMask:function(e,t){var n;return e((n={},Object(i.a)(n,2968,t),Object(i.a)(n,36005,t),n))},stencilMaskSeparate:function(e,t,n){return e(Object(i.a)({},1028===t?2968:36005,n))},stencilFunc:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2962,t),Object(i.a)(a,2967,n),Object(i.a)(a,2963,r),Object(i.a)(a,34816,t),Object(i.a)(a,36003,n),Object(i.a)(a,36004,r),a))},stencilFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2962:34816,n),Object(i.a)(o,1028===t?2967:36003,r),Object(i.a)(o,1028===t?2963:36004,a),o))},stencilOp:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2964,t),Object(i.a)(a,2965,n),Object(i.a)(a,2966,r),Object(i.a)(a,34817,t),Object(i.a)(a,34818,n),Object(i.a)(a,34819,r),a))},stencilOpSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2964:34817,n),Object(i.a)(o,1028===t?2965:34818,r),Object(i.a)(o,1028===t?2966:34819,a),o))},viewport:function(e,t,n,r,a){return e(Object(i.a)({},2978,new Int32Array([t,n,r,a])))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(22),r=n(97),a=n(61);function o(e){var t=e.width,n=e.height,o=e.bounds,s=e.padding,u=void 0===s?0:s,c=e.offset,l=void 0===c?[0,0]:c,f=Object(i.a)(o,2),h=Object(i.a)(f[0],2),d=h[0],v=h[1],p=Object(i.a)(f[1],2),g=p[0],m=p[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else Object(a.a)(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var y=new r.a({width:t,height:n,longitude:0,latitude:0,zoom:0}),_=y.project([d,m]),b=y.project([g,v]),x=[Math.abs(b[0]-_[0]),Math.abs(b[1]-_[1])],w=[t-u.left-u.right-2*Math.abs(l[0]),n-u.top-u.bottom-2*Math.abs(l[1])];Object(a.a)(w[0]>0&&w[1]>0);var E=w[0]/x[0],P=w[1]/x[1],O=(u.right-u.left)/2/E,S=(u.bottom-u.top)/2/P,A=[(b[0]+_[0])/2+O,(b[1]+_[1])/2+S],T=y.unproject(A),k=y.zoom+Math.log2(Math.abs(Math.min(E,P)));return{longitude:T[0],latitude:T[1],zoom:k}}},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(22),r=n(4),a=n(6),o=n(23),s=n(48),u=n(41),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.c(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},,,,function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(38),v=n(34),p=n(133),g=n(126),m=n(105);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new p.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new g.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(3),r=n.n(i),a=n(2),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(38),v=n(34),p=n(126),g=n(79),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new p.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var _=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,p=void 0===v?"Z":v,g=e.target,m=void 0===g?[0,0,0]:g,_=e.rotationX,b=void 0===_?0:_,x=e.rotationOrbit,w=void 0===x?0:x,E=e.zoom,P=void 0===E?0:E;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:p,rotationX:b,rotationOrbit:w,zoom:P}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return h()(t,e),t}(v.a),b=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:_})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.b,ViewportType:_})}}]),t}(d.a);b.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(3),r=n.n(i),a=n(5),o=n.n(a),s=n(2),u=n.n(s),c=n(8),l=n.n(c),f=n(9),h=n.n(f),d=n(38),v=n(34),p=n(126),g=n(106),m=(new p.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new p.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var _=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,p=void 0===d?0:d,g=e.target,_=void 0===g?[0,0,0]:g;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:_,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:p}))}return h()(t,e),t}(v.a),b=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:_})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.a,ViewportType:_})}}]),t}(d.a);b.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(1),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.CubeGeometry}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(108).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(1),v=n(71),p=n(127),g=n(81),m=n(72),y=n(89),_=new d.PhongMaterial,b={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,fp64:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=e.changeFlags;(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon))&&(this.state.paths=this._getPaths(t))}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.object&&t.object.object||t.object})}},{key:"_getPaths",value:function(e){var t=e.data,n=e.getPolygon,i=[],r="XY"===e.positionFormat?2:3,a=Object(v.a)(t),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++;var p=y.c(n(d,s),r),g=p.positions,m=p.holeIndices;if(m)for(var _=0;_<=m.length;_++){var b=g.subarray(m[_-1]||0,m[_]||g.length);i.push({path:b,object:d})}else i.push({path:g,object:d})}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return i}},{key:"_getAccessor",value:function(e){return"function"==typeof e?function(t){return e(t.object)}:e}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.stroked,i=e.filled,r=e.extruded,a=e.wireframe,o=e.elevationScale,s=e.transitions,u=this.props,c=u.lineWidthUnits,l=u.lineWidthScale,f=u.lineWidthMinPixels,h=u.lineWidthMaxPixels,d=u.lineJointRounded,v=u.lineMiterLimit,p=u.lineDashJustified,y=u.fp64,_=this.props,b=_.getFillColor,x=_.getLineColor,w=_.getLineWidth,E=_.getLineDashArray,P=_.getElevation,O=_.getPolygon,S=_.updateTriggers,A=_.material,T=this.state.paths,k=this.getSubLayerClass("fill",g.a),C=this.getSubLayerClass("stroke",m.a),M=this.shouldRenderSubLayer("fill",T)&&new k({extruded:r,elevationScale:o,fp64:y,filled:i,wireframe:a,getElevation:P,getFillColor:b,getLineColor:x,material:A,transitions:s},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:S.getPolygon,getElevation:S.getElevation,getFillColor:S.getFillColor,getLineColor:S.getLineColor}}),{data:t,getPolygon:O});return[!r&&M,!r&&n&&this.shouldRenderSubLayer("stroke",T)&&new C({fp64:y,widthUnits:c,widthScale:l,widthMinPixels:f,widthMaxPixels:h,rounded:d,miterLimit:v,dashJustified:p,transitions:s&&{getWidth:s.getLineWidth,getColor:s.getLineColor,getPath:s.getPolygon},getColor:this._getAccessor(x),getWidth:this._getAccessor(w),getDashArray:this._getAccessor(E)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:S.getLineWidth,getColor:S.getLineColor,getDashArray:S.getLineDashArray}}),{data:T,getPath:function(e){return e.path}}),r&&M]}}]),t}(p.a);x.layerName="PolygonLayer",x.defaultProps=b},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(18),h=n.n(f),d=n(9),v=n.n(d),p=n(71),g=n(80),m=n(7),y=n.n(m),_=n(1),b="#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n";n.d(t,"a",function(){return P});var x=_.fp64.fp64LowPart,w=[0,0,0,255],E={fp64:!1,getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:w},getTargetColor:{type:"accessor",value:w},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},P=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return this.use64bitProjection()?{vs:"#define SHADER_NAME arc-layer-vertex-shader-64\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\n\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\n\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\n\nvec2 paraboloid_fp64(vec2 source[2], vec2 target[2], float ratio) {\n\n vec2 x[2];\n vec2_mix_fp64(source, target, ratio, x);\n vec2 center[2];\n vec2_mix_fp64(source, target, 0.5, center);\n\n vec2 dSourceCenter = vec2_distance_fp64(source, center);\n vec2 dXCenter = vec2_distance_fp64(x, center);\n return mul_fp64(sum_fp64(dSourceCenter, dXCenter), sub_fp64(dSourceCenter, dXCenter));\n}\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvoid get_pos_fp64(vec2 source[2], vec2 target[2], float segmentRatio, out vec2 position[4]) {\n\n vec2 vertex_height = paraboloid_fp64(source, target, segmentRatio);\n\n vec2 position_temp[2];\n\n vec2_mix_fp64(source, target, segmentRatio, position_temp);\n\n position[0] = position_temp[0];\n position[1] = position_temp[1];\n\n if (vertex_height.x < 0.0 || (vertex_height.x == 0.0 && vertex_height.y <= 0.0)) {\n vertex_height = vec2(0.0, 0.0);\n }\n\n position[2] = sqrt_fp64(vertex_height);\n position[3] = vec2(1.0, 0.0);\n}\n\nvoid main(void) {\n vec2 projected_source_coord[2];\n vec2 projected_target_coord[2];\n\n project_position_fp64(instancePositions.xy, instancePositions64Low.xy, projected_source_coord);\n project_position_fp64(instancePositions.zw, instancePositions64Low.zw, projected_target_coord);\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n\n // if it's the first point, use next - current as direction\n // otherwise use current - prev\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec2 curr_pos_modelspace[4];\n\n get_pos_fp64(projected_source_coord, projected_target_coord, segmentRatio,\n curr_pos_modelspace);\n\n vec2 next_pos_modelspace[4];\n\n get_pos_fp64(projected_source_coord, projected_target_coord, nextSegmentRatio,\n next_pos_modelspace);\n\n vec4 curr_pos_clipspace = project_common_position_to_clipspace_fp64(curr_pos_modelspace);\n vec4 next_pos_clipspace = project_common_position_to_clipspace_fp64(next_pos_modelspace);\n\n // Multiply out width and clamp to limits\n // mercator pixels are interpreted as screen pixels\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n\n vec2 offset = getExtrusionOffset(next_pos_clipspace.xy - curr_pos_clipspace.xy, positions.y, widthPixels);\n\n gl_Position = curr_pos_clipspace + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n",fs:b,modules:["project64","picking"]}:{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n vec2 source = project_position(vec3(instancePositions.xy, 0.0), instancePositions64Low.xy).xy;\n vec2 target = project_position(vec3(instancePositions.zw, 0.0), instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n // if it's the first point, use next - current as direction\n // otherwise use current - prev\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n\n // Multiply out width and clamp to limits\n // mercator pixels are interpreted as screen pixels\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n\n // extrude\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels);\n gl_Position = curr + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n",fs:b,modules:["picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:4,type:y.a.UNSIGNED_BYTE,transition:!0,accessor:"getSourceColor",defaultValue:w},instanceTargetColors:{size:4,type:y.a.UNSIGNED_BYTE,transition:!0,accessor:"getTargetColor",defaultValue:w},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new _.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new _.Geometry({drawMode:y.a.TRIANGLE_STRIP,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(p.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var _=m.value;h.index++;var b=o(_,h);u[c++]=b[0],u[c++]=b[1];var x=s(_,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(p.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,g=!1,m=void 0;try{for(var y,_=h[Symbol.iterator]();!(v=(y=_.next()).done);v=!0){var b=y.value;d.index++;var w=s(b,d);c[l++]=x(w[0]),c[l++]=x(w[1]);var E=u(b,d);c[l++]=x(E[0]),c[l++]=x(E[1])}}catch(e){g=!0,m=e}finally{try{v||null==_.return||_.return()}finally{if(g)throw m}}}else e.value=new Float32Array(4)}}]),t}(g.a);P.layerName="ArcLayer",P.defaultProps=E},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(18),h=n.n(f),d=n(9),v=n.n(d),p=n(71),g=n(80),m=n(7),y=n.n(m),_=n(1);n.d(t,"a",function(){return w});var b=_.fp64.fp64LowPart,x={fp64:!1,getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n // Position\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n\n // Multiply out width and clamp to limits\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n \n // linear interpolation of source & target to pick right coord\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n\n // extrude\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n\n // Color\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},instanceColors:{size:4,type:y.a.UNSIGNED_BYTE,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new _.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new _.Geometry({drawMode:y.a.TRIANGLE_STRIP,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(p.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,g=!1,m=void 0;try{for(var y,_=h[Symbol.iterator]();!(v=(y=_.next()).done);v=!0){var x=y.value;d.index++;var w=s(x,d),E=u(x,d);c[l++]=b(w[0]),c[l++]=b(w[1]),c[l++]=b(E[0]),c[l++]=b(E[1])}}catch(e){g=!0,m=e}finally{try{v||null==_.return||_.return()}finally{if(g)throw m}}}else e.value=new Float32Array(4)}}]),t}(g.a);w.layerName="LineLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(9),h=n.n(f),d=n(127),v=n(109),p=n(72),g=n(1),m=n(81);function y(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}function _(e,t,n){var i=e.type,r=e.coordinates,a=t.pointFeatures,o=t.lineFeatures,s=t.polygonFeatures,u=t.polygonOutlineFeatures;switch(function(e,t){var n=x[e];y(n,"Unknown GeoJSON type ".concat(e));for(;t&&--n>0;)t=t[0];y(t&&Number.isFinite(t[0]),"".concat(e," coordinates are malformed"))}(i,r),i){case"Point":a.push({geometry:e,sourceFeature:n});break;case"MultiPoint":r.forEach(function(e){a.push({geometry:{type:"Point",coordinates:e},sourceFeature:n})});break;case"LineString":o.push({geometry:e,sourceFeature:n});break;case"MultiLineString":r.forEach(function(e){o.push({geometry:{type:"LineString",coordinates:e},sourceFeature:n})});break;case"Polygon":s.push({geometry:e,sourceFeature:n}),r.forEach(function(e){u.push({geometry:{type:"LineString",coordinates:e},sourceFeature:n})});break;case"MultiPolygon":r.forEach(function(e){s.push({geometry:{type:"Polygon",coordinates:e},sourceFeature:n}),e.forEach(function(e){u.push({geometry:{type:"LineString",coordinates:e},sourceFeature:n})})})}}function b(e){return e.sourceFeature.feature}var x={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return S});var w=new g.PhongMaterial,E={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,fp64:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:w};function P(e){return e.geometry.coordinates}function O(e){return"function"!=typeof e?e:function(t){return e(b(t))}}var S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props;if(e.changeFlags.dataChanged){var n=function(e){if(Array.isArray(e))return e;switch(y(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return y(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data);this.state.features=function(e){for(var t={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},n=0;n=t.min)}}};function o(e,t){switch(s(t)){case"object":return function(e){var t=e.type;(a[t]||{}).typeValidator;return e}(t=function(e,t){if(!("type"in t))return"value"in t?Object.assign({name:e,type:s(t.value)},t):{name:e,type:"object",value:t};return Object.assign({name:e},t)}(e,t));case"array":return function(e,t){if(/color/i.test(e)&&(3===t.length||4===t.length))return{name:e,type:"color",value:t};return{name:e,type:"array",value:t}}(e,t);case"boolean":return{name:e,type:"boolean",value:t};case"number":return function(e,t){var n=/radius|scale|width|height|pixel|size|miter/i.test(e)&&/^((?!scale).)*$/.test(e)?100:1;return{name:e,type:"number",max:Math.max(t,n),min:Math.min(t,0),value:t}}(e,t);case"function":return{name:e,type:"function",value:t};default:return{name:e,type:"unknown",value:t}}}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":null===e?"null":Object(i.a)(e)}function u(e){if(!e.normalized){if(e.normalized=!0,e.uniforms){var t=function(e){for(var t={},n={},i=0,a=Object.entries(e);i=0}).call(this,n(50))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(24),r=n(149);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(50))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(24);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(50))},function(e,t,n){var i=n(171);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(30),a=n.n(r),o=n(76);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(50))},function(e,t){},function(e,t){},function(e,t,n){var i=n(10);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var b=n;bu&&(u=l),d>c&&(c=d);p=0!==(p=Math.max(u-i,c-s))?1/p:0}return o(y,_,n,i,s,p),_}function r(e,t,n,i,r){var a,o;if(r===O(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(E(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(E(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,p,g=e;e.prev!==e.next;)if(v=e.prev,p=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(p.i/n),E(e),e=p.next,g=p.next;else if((e=p)===g){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(p(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,g=e.nextZ;v&&v.z>=f&&g&&g.z<=h;){if(v!==e.prev&&v!==e.next&&p(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,g!==e.prev&&g!==e.next&&p(r.x,r.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&p(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;g&&g.z<=h;){if(g!==e.prev&&g!==e.next&&p(r.x,r.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&_(r,i,i.next,a)&&b(r,a)&&b(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),E(i),E(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&g(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&p(an.x)&&b(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&_(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&b(e,t)&&b(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function _(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function b(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function E(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(165),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=b;var f="suspendedStart",h="suspendedYield",d="executing",v="completed",p={},g={};g[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(M([])));y&&y!==i&&r.call(y,o)&&(g=y);var _=P.prototype=w.prototype=Object.create(g);E.prototype=_.constructor=P,P.constructor=E,P[u]=E.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,P):(e.__proto__=P,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(_),e},l.awrap=function(e){return{__await:e}},O(S.prototype),S.prototype[s]=function(){return this},l.AsyncIterator=S,l.async=function(e,t,n,i){var r=new S(b(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},O(_),_[u]="Generator",_[o]=function(){return this},_.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=M,C.prototype={constructor:C,reset:function(e){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(k),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;k(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:M(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),p}}}function b(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new C(i||[]);return a._invoke=function(e,t,n){var i=f;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return j()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=A(o,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function E(){}function P(){}function O(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function S(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function A(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,A(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,p):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function M(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("h3"),require("S2"));else if("function"==typeof define&&define.amd)define(["h3","S2"],t);else{var n="object"==typeof exports?t(require("h3"),require("S2")):t(e.h3,e.S2);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=158)}([function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.r(t);var i=n(4),r=n(6),a=n(66),o=n(31),s=n(23),u=n(24),c=n(0),l=n(112),f="7.1.10",h=Object(l.a)();var d=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(i.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(r),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(r.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function v(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var g={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function p(e){return"string"==typeof e?g[e.toUpperCase()]||g.WHITE:e}function m(e,t){if(!e)throw new Error(t||"Assertion failed")}var y=n(44);function b(){var e;if(h&&y.b.performance)e=y.b.performance.now();else if(y.a.hrtime){var t=y.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var _={debug:h&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},x={enabled:!1,priority:0};function w(){}var P={};var O=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(i.a)(this,e),this.id=t,this.VERSION=f,this._startTs=b(),this._deltaTs=b(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new d("__probe-".concat(this.id,"__"),x),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(r.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((b()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((b()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){m(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?w:h?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(c.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(161)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:w}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,r=e.scale,a=void 0===r?1:r;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=v(o,i,a);(e=console).log.apply(e,Object(u.a)(t))},o.src=t,w}var s,c=t.nodeName||"";if("img"===c.toLowerCase())return(s=console).log.apply(s,Object(u.a)(v(t,i,a))),w;if("canvas"===c.toLowerCase()){var l=new Image;return l.onload=function(){var e;return(e=console).log.apply(e,Object(u.a)(v(l,i,a)))},l.src=t.toDataURL(),w}return w}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||w})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||w})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=b(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),m(t);var n=e.message,i=e.tag||e.message;if(e.once){if(P[i])return w;P[i]=b()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(u.a)(e.args)))}return w}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(s.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return m(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,i=e.args,r=void 0===i?[]:i,a=e.opts,o={priority:this._normalizePriority(t),message:n,args:r};switch(Object(s.a)(t)){case"string":case"function":void 0!==n&&r.unshift(n),Object.assign(o,{message:t});break;case"object":Object.assign(o,t)}return"function"==typeof o.message&&(o.message=this._shouldLog(o.priority)?o.message():""),m("string"==typeof o.message||"object"===Object(s.a)(o.message)),Object.assign(o,a)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,h||"string"!=typeof r||(a&&(a=p(a),r="[".concat(a,"m").concat(r,"")),o&&(a=p(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();O.VERSION=f;var k=new O({id:"luma"}).enable(),S=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=b(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(b()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}(),j=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new S(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}(),C=(n(98),new(function(){function e(){Object(i.a)(this,e),this.stats=new Map}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new j({id:e})),this.stats.get(e)}}]),e}()));if(o.b.luma&&"7.1.0-beta.1"!==o.b.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(o.b.luma.VERSION," vs ").concat("7.1.0-beta.1"));o.b.luma||(a.a&&k.log(1,"luma.gl ".concat("7.1.0-beta.1"," - ").concat("set luma.log.priority=1 (or higher) to trace rendering"))(),o.b.luma=o.b.luma||{VERSION:"7.1.0-beta.1",version:"7.1.0-beta.1",log:k,stats:C,globals:{modules:{},nodeIO:{}}});o.b.luma;var E=n(50),A=n(21);function T(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var M={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(u.a)(t))},blendEquation:function(e,t){t=T(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(u.a)(t))},blendFunc:function(e,t){t=T(t)&&2===t.length?[].concat(Object(u.a)(t),Object(u.a)(t)):t,e.blendFuncSeparate.apply(e,Object(u.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(u.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(u.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(u.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(u.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(u.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(u.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=T(t)?t:[t,t],i=Object(A.a)(n,2),r=i[0],a=i[1];e.stencilMaskSeparate(1028,r),e.stencilMaskSeparate(1029,a)},stencilFunc:function(e,t){var n=t=T(t)&&3===t.length?[].concat(Object(u.a)(t),Object(u.a)(t)):t,i=Object(A.a)(n,6),r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5];e.stencilFuncSeparate(1028,r,a,o),e.stencilFuncSeparate(1029,s,c,l)},stencilOp:function(e,t){var n=t=T(t)&&3===t.length?[].concat(Object(u.a)(t),Object(u.a)(t)):t,i=Object(A.a)(n,6),r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5];e.stencilOpSeparate(1028,r,a,o),e.stencilOpSeparate(1029,s,c,l)},viewport:function(e,t){return e.viewport.apply(e,Object(u.a)(t))}};function L(e,t){for(var n in Object(E.f)(e,t),t){var i=M[n];i&&i(e,t[n],n)}}var I=n(61),F=n(45);function R(e,t,n){if(Object(F.b)(t))return n(e);var i,r=t.nocatch,a=void 0===r||r;if(Object(F.a)(!t.frameBuffer),Object(I.c)(e),L(e,t),a)i=n(e),Object(I.b)(e);else try{i=n(e)}finally{Object(I.b)(e)}return i}var N="luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",D=null;function z(){var e=n(162);if(!e)throw new Error(N);return e.apply(void 0,arguments)}if(!a.a)try{D=n(163)}catch(e){}var B=function e(){Object(i.a)(this,e)},U=D||o.b,V=(U.WebGLRenderingContext,U.WebGLProgram,U.WebGLShader,U.WebGLBuffer),G=void 0===V?B:V;U.WebGLFramebuffer,U.WebGLRenderbuffer,U.WebGLTexture,U.WebGLUniformLocation,U.WebGLActiveInfo,U.WebGLShaderPrecisionFormat;var W=o.b.WebGL2RenderingContext||function e(){Object(i.a)(this,e)};o.b.Image;function H(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"id";Y[e]=Y[e]||1;var t=Y[e]++;return"".concat(e,"-").concat(t)}function K(e){return Z("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function J(e){var t=!0;for(var n in e){t=!1;break}return t}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,i=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,i=void 0===n?16:n,r=t.size,a=void 0===r?1:r,o="[",s=0;s0&&(o+=",".concat(s%a==0?" ":"")),o+=$(e[s],t);var u=e.length>i?"...":"]";return"".concat(o).concat(u)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return i?"0":"0.";if(i)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var r=e.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function ee(e,t,n,i){var r="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),a=Object.getPrototypeOf(e);i.forEach(function(e){a.methodName||(a[e]=function(){throw k.removed("Calling removed method ".concat(t,".").concat(e,": "),r)(),new Error(e)})})}function te(e,t,n){var i=n.removedProps,r=void 0===i?{}:i,a=n.deprecatedProps,o=void 0===a?{}:a,s=n.replacedProps,u=void 0===s?{}:s;for(var c in r)if(c in t){var l=r[c]?"".concat(e,".").concat(r[c]):"N/A";k.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];k.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var v in u)if(v in t){var g=u[v];k.deprecated("".concat(e,".").concat(v),"".concat(e,".").concat(g))(),(d=d||Object.assign({},t))[g]=t[v],delete d[v]}return d||t}var ne,ie=a.a&&"undefined"!=typeof document,re=ie&&"complete"===document.readyState;function ae(){return ne||(ne=ie?new Promise(function(e,t){if(ie&&"complete"===document.readyState)return re=!0,void e(document);window.onload=function(){re=!0,e(document)}}):Promise.resolve({})),ne}function oe(e){var t,n=e.canvas,i=e.width,r=e.height,a=e.onError,o=void 0===a?function(){}:a;return"string"==typeof n?(re||o("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:o}),t}function se(e){var t=e.getParameter(7936),n=e.getParameter(7937),i=e.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&e.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||t,renderer:i&&e.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}var ue="Invalid WebGLRenderingContext",ce="Requires WebGL2";function le(e){return Boolean(e&&Number.isFinite(e._version))}function fe(e){return Boolean(e&&2===e._version)}function he(e){Z(le(e),ue)}function de(e){Z(fe(e),ce)}function ve(e){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function ge(e){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var pe="Failed to deduce GL constant from typed array";function me(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(pe)}}function ye(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function be(e){for(var t=e.data,n=e.width,i=e.height,r=Math.round(n/2),a=Math.round(i/2),o=new Uint8Array(r*a*4),s=0;s1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),he(t);var r=n.id,a=n.userData,o=void 0===a?{}:a;this.gl=t,this.id=r||Q(this.constructor.name),this.userData=o,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z(e=_e(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=fe(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=fe(this.gl),o={},s=n||Object.keys(r),u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value,v=r[d];if(v&&(!("webgl2"in v)||a)&&(!("extension"in v)||this.gl.getExtension(v.extension))){var g=i?xe(this.gl,d):d;o[g]=this.getParameter(d,e),i&&"GLenum"===v.type&&(o[g]=xe(this.gl,o[g]))}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return o}},{key:"setParameter",value:function(e,t){Z(e=_e(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=fe(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=_e(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return ee(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(Se)}},{key:"_deleteHandle",value:function(){throw new Error(Se)}},{key:"_bindHandle",value:function(){throw new Error(Se)}},{key:"_getOptsFromHandle",value:function(){throw new Error(Se)}},{key:"_getParameter",value:function(e,t){throw new Error(Se)}},{key:"_setParameter",value:function(e,t){throw new Error(Se)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=C.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;C.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=C.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=C.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}(),Ce=n(114);function Ee(e,t,n){return(Ee=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&Object(Ce.a)(r,n.prototype),r}).apply(null,arguments)}var Ae,Te,Me,Le={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Ie={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Fe=function(){function e(){var t=this;Object(i.a)(this,e);for(var n=arguments.length,r=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=te("Accessor",e,Ie)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}(),Re={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"},Ne={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Re},De={removedProps:Re},ze=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Fe.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Fe.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=te("Buffer",e,Ne),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=te("Buffer",e,De))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new Fe(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Z(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(de(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return de(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;de(this.gl);var c,l,f=ye(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(r),d=o;n?c=(l=n.length)-d:l=d+(c=Math.min(h,u||h));var v=Math.min(h,c);return Z((u=u||v)<=v),n=n||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Z(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Z(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=me(e);return Z(i),this.setAccessor(new Fe(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Z(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/ye(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new Fe(this.accessor,{type:me(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return k.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return k.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Fe(this.accessor,e),this}},{key:"type",get:function(){return k.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return k.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(je),Be=(Ae={},Object(c.a)(Ae,6407,{dataFormat:6407,types:[5121,33635]}),Object(c.a)(Ae,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(c.a)(Ae,6406,{dataFormat:6406,types:[5121]}),Object(c.a)(Ae,6409,{dataFormat:6409,types:[5121]}),Object(c.a)(Ae,6410,{dataFormat:6410,types:[5121]}),Object(c.a)(Ae,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(c.a)(Ae,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(c.a)(Ae,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(c.a)(Ae,34836,{dataFormat:6408,types:[5126],gl2:!0}),Ae),Ue=(Te={},Object(c.a)(Te,6403,1),Object(c.a)(Te,36244,1),Object(c.a)(Te,33319,2),Object(c.a)(Te,33320,2),Object(c.a)(Te,6407,3),Object(c.a)(Te,36248,3),Object(c.a)(Te,6408,4),Object(c.a)(Te,36249,4),Object(c.a)(Te,6402,1),Object(c.a)(Te,34041,1),Object(c.a)(Te,6406,1),Object(c.a)(Te,6409,1),Object(c.a)(Te,6410,2),Te),Ve=(Me={},Object(c.a)(Me,5126,4),Object(c.a)(Me,5125,4),Object(c.a)(Me,5124,4),Object(c.a)(Me,5123,2),Object(c.a)(Me,5122,2),Object(c.a)(Me,5131,2),Object(c.a)(Me,5120,1),Object(c.a)(Me,5121,1),Me);var Ge=[9729,9728],We=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=n.id,o=void 0===a?Q("texture"):a,s=n.handle,u=n.target;return(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,{id:o,handle:s}))).target=u,r.hasFloatTexture=e.getExtension("OES_texture_float"),r.textureUnit=void 0,r.loaded=!1,r.width=void 0,r.height=void 0,r.depth=void 0,r.format=void 0,r.type=void 0,r.dataFormat=void 0,r.border=void 0,r.textureUnit=void 0,r.mipmaps=void 0,r}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&function(e,t){var n=Be[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=fe(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}(e,n))&&(!i||function(e,t){var n=Be[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}(e,n))),r}}]),Object(r.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var i=t.pixels,r=void 0===i?null:i,a=t.format,o=void 0===a?6408:a,s=t.type,u=void 0===s?5121:s,l=t.border,f=void 0===l?0:l,h=t.recreate,d=void 0!==h&&h,v=t.parameters,g=void 0===v?{}:v,p=t.pixelStore,m=void 0===p?{}:p,y=t.textureUnit,b=void 0===y?void 0:y,_=t.unpackFlipY,x=void 0===_||_,w=t.mipmaps,P=void 0===w||w;n||(n=r);var O=t.width,S=t.height,j=t.dataFormat,C=t.depth,E=void 0===C?0:C,A=this._deduceParameters({format:o,type:u,dataFormat:j,compressed:!1,data:n,width:O,height:S});O=A.width,S=A.height,j=A.dataFormat,this.width=O,this.height=S,this.depth=E,this.format=o,this.type=u,this.dataFormat=j,this.border=f,this.textureUnit=b,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var T=Object(c.a)({},37440,x),M=Object.assign({},T,m);return P&&this._isNPOT()&&(k.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),P=!1,this._updateForNPOT(g)),this.mipmaps=P,this.setImageData({data:n,width:O,height:S,depth:E,format:o,type:u,dataFormat:j,border:f,mipmaps:P,parameters:M}),P&&this.generateMipmap(),this.setParameters(g),d&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:!1}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindTexture(this.target,this.handle),R(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,v=void 0===d?{}:d,g=e.data,p=void 0===g?null:g,m=e.type,y=void 0===m?this.type:m,b=e.width,_=void 0===b?this.width:b,x=e.height,w=void 0===x?this.height:x,P=e.dataFormat,O=void 0===P?this.dataFormat:P,k=e.compressed,S=void 0!==k&&k;p||(p=r);var j=this._deduceParameters({format:u,type:y,dataFormat:O,compressed:S,data:p,width:_,height:w});y=j.type,O=j.dataFormat,S=j.compressed,_=j.width,w=j.height;var C=this.gl;C.bindTexture(this.target,this.handle);var E,A=this._getDataType({data:p,compressed:S});if(p=A.data,E=A.dataType,R(this.gl,v,function(){switch(E){case"null":C.texImage2D(n,o,u,_,w,l,O,y,p);break;case"typed-array":C.texImage2D(n,o,u,_,w,l,O,y,p,h);break;case"buffer":de(C),C.bindBuffer(35052,p.handle||p),C.texImage2D(n,o,u,_,w,l,O,y,h),C.bindBuffer(35052,null);break;case"browser-object":fe(C)?C.texImage2D(n,o,u,_,w,l,O,y,p):C.texImage2D(n,o,u,O,y,p);break;case"compressed":C.compressedTexImage2D(n,o,u,_,w,l,p);break;default:Z(!1,"Unknown image data type")}}),p&&p.byteLength)this._trackAllocatedMemory(p.byteLength,"Texture");else{var T=Ue[this.dataFormat]||4,M=Ve[this.type]||1;this._trackAllocatedMemory(this.width*this.height*T*M,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,v=e.height,g=void 0===v?this.height:v,p=e.level,m=void 0===p?0:p,y=e.format,b=void 0===y?this.format:y,_=e.type,x=void 0===_?this.type:_,w=e.dataFormat,P=void 0===w?this.dataFormat:w,O=e.compressed,k=void 0!==O&&O,S=e.offset,j=void 0===S?0:S,C=e.border,E=(void 0===C&&this.border,e.parameters),A=void 0===E?{}:E,T=this._deduceParameters({format:b,type:x,dataFormat:P,compressed:k,data:s,width:d,height:g});if(x=T.type,P=T.dataFormat,k=T.compressed,d=T.width,g=T.height,Z(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var M=s;s=M.data,d=M.shape[0],g=M.shape[1]}s instanceof ze&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),R(this.gl,A,function(){k?t.gl.compressedTexSubImage2D(i,m,c,f,d,g,b,s):null===s?t.gl.texSubImage2D(i,m,c,f,d,g,P,x,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,m,c,f,d,g,P,x,s,j):s instanceof G?(de(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,m,c,f,d,g,P,x,j),t.gl.bindBuffer(35052,null)):fe(t.gl)?t.gl.texSubImage2D(i,m,c,f,d,g,P,x,s):t.gl.texSubImage2D(i,m,c,f,P,x,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof ze?{data:t.handle,dataType:"buffer"}:t instanceof G?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=Be[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return Z(i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},"Could not deduced texture size"),Z(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Z(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Z(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!fe(this.gl)&&(!(!this.width||!this.height)&&(!K(this.width)||!K(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===Ge.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(je),He="";function Xe(e){He=e}function qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z("string"==typeof e),e=He+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function Ze(e,t){return Z("string"==typeof e),e=He+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}var Ye=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),he(e),(r instanceof Promise||"string"==typeof r)&&(r={data:r}),"string"==typeof r.data&&(r=Object.assign({},r,{data:Ze(r.data)})),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},r,{target:3553})))).initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e,t){return We.isSupported(e,t)}}]),t}(We),Qe=n(41),Ke=n.n(Qe),Je=n(62),$e=[34069,34070,34071,34072,34073,34074],et=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),he(e),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},r,{target:34067})))).initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(Je.a)(Ke.a.mark(function e(t){var n,i,r,a,o,s,u,c,l,f,h,d,v,g=this;return Ke.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,r=t.pixels,a=t.data,o=t.border,s=void 0===o?0:o,u=t.format,c=void 0===u?6408:u,l=t.type,f=void 0===l?5121:l,h=this.gl,d=r||a,e.next=5,Promise.all($e.map(function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:v=e.sent,this.bind(),$e.forEach(function(e,t){v[t].length>1&&!1!==g.opts.mipmaps&&k.warn("".concat(g.id," has mipmap and multiple LODs."))(),v[t].forEach(function(t,r){n&&i?h.texImage2D(e,r,c,n,i,s,c,f,t):h.texImage2D(e,r,c,c,f,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(We);et.FACES=$e;var tt,nt=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),de(e),r=Object.assign({depth:1},r,{target:32879,unpackFlipY:!1}),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return fe(e)}}]),Object(r.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,c=void 0===u?1:u,l=e.border,f=void 0===l?0:l,h=e.format,d=e.type,v=void 0===d?5121:d,g=e.offset,p=void 0===g?0:g,m=e.data,y=e.parameters,b=void 0===y?{}:y;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),R(this.gl,b,function(){ArrayBuffer.isView(m)&&t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,m),m instanceof ze&&(t.gl.bindBuffer(35052,m.handle),t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,p))}),m&&m.byteLength)this._trackAllocatedMemory(m.byteLength,"Texture");else{var _=Ue[this.dataFormat]||4,x=Ve[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*_*x,"Texture")}return this.loaded=!0,this}}]),t}(We),it="EXT_color_buffer_float",rt=(tt={},Object(c.a)(tt,33189,{bpp:2}),Object(c.a)(tt,33190,{gl2:!0,bpp:3}),Object(c.a)(tt,36012,{gl2:!0,bpp:4}),Object(c.a)(tt,36168,{bpp:1}),Object(c.a)(tt,34041,{bpp:4}),Object(c.a)(tt,35056,{gl2:!0,bpp:4}),Object(c.a)(tt,36013,{gl2:!0,bpp:5}),Object(c.a)(tt,32854,{bpp:2}),Object(c.a)(tt,36194,{bpp:2}),Object(c.a)(tt,32855,{bpp:2}),Object(c.a)(tt,33321,{gl2:!0,bpp:1}),Object(c.a)(tt,33330,{gl2:!0,bpp:1}),Object(c.a)(tt,33329,{gl2:!0,bpp:1}),Object(c.a)(tt,33332,{gl2:!0,bpp:2}),Object(c.a)(tt,33331,{gl2:!0,bpp:2}),Object(c.a)(tt,33334,{gl2:!0,bpp:4}),Object(c.a)(tt,33333,{gl2:!0,bpp:4}),Object(c.a)(tt,33323,{gl2:!0,bpp:2}),Object(c.a)(tt,33336,{gl2:!0,bpp:2}),Object(c.a)(tt,33335,{gl2:!0,bpp:2}),Object(c.a)(tt,33338,{gl2:!0,bpp:4}),Object(c.a)(tt,33337,{gl2:!0,bpp:4}),Object(c.a)(tt,33340,{gl2:!0,bpp:8}),Object(c.a)(tt,33339,{gl2:!0,bpp:8}),Object(c.a)(tt,32849,{gl2:!0,bpp:3}),Object(c.a)(tt,32856,{gl2:!0,bpp:4}),Object(c.a)(tt,32857,{gl2:!0,bpp:4}),Object(c.a)(tt,36220,{gl2:!0,bpp:4}),Object(c.a)(tt,36238,{gl2:!0,bpp:4}),Object(c.a)(tt,36975,{gl2:!0,bpp:4}),Object(c.a)(tt,36214,{gl2:!0,bpp:8}),Object(c.a)(tt,36232,{gl2:!0,bpp:8}),Object(c.a)(tt,36226,{gl2:!0,bpp:16}),Object(c.a)(tt,36208,{gl2:!0,bpp:16}),Object(c.a)(tt,33325,{gl2:it,bpp:2}),Object(c.a)(tt,33327,{gl2:it,bpp:4}),Object(c.a)(tt,34842,{gl2:it,bpp:8}),Object(c.a)(tt,33326,{gl2:it,bpp:4}),Object(c.a)(tt,33328,{gl2:it,bpp:8}),Object(c.a)(tt,34836,{gl2:it,bpp:16}),Object(c.a)(tt,35898,{gl2:it,bpp:4}),tt);var at,ot=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=fe(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,rt)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Z(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&fe(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*rt[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(je),st=256,ut=1024,ct=16384,lt=6144,ft=6145,ht=6146,dt=34041,vt="clear: bad arguments";function gt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.color,a=void 0===r?null:r,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};i&&(l.framebuffer=i);var f=0;a&&(f|=ct,!0!==a&&(l.clearColor=a)),s&&(f|=st,!0!==s&&(l.clearDepth=s)),c&&(f|=ut,!0!==s&&(l.clearStencil=s)),Z(0!==f,vt),R(e,l,function(){e.clear(f)})}function pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.buffer,a=void 0===r?lt:r,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;de(e),R(e,{framebuffer:i},function(){switch(a){case lt:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case ft:e.clearBufferfv(ft,0,[c]);break;case ht:e.clearBufferiv(ht,0,[c]);break;case dt:var t=Object(A.a)(c,2),n=t[0],i=t[1];e.clearBufferfi(dt,0,n,i);break;default:Z(!1,vt)}})}function mt(e){switch(e){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 Z(!1),0}}function yt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,g=Ot(e),p=g.framebuffer,m=g.deleteFramebuffer;Z(p);var y=p.gl,b=p.handle,_=p.attachments;h=h||p.width,d=d||p.height,36064===c&&null===b&&(c=1028),Z(_[c]),f=function(e,t,n,i,r){if(e)return e;var a=ye(t=t||5121,{clamped:!1}),o=mt(n);return new a(i*r*o)}(f,v=v||_[c].type,s,h,d),v=v||me(f);var x=y.bindFramebuffer(36160,b);return y.readPixels(i,a,h,d,s,v,f),y.bindFramebuffer(36160,x||null),m&&p.delete(),f}function bt(e,t){var n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.target,c=void 0===u?null:u,l=t.targetByteOffset,f=void 0===l?0:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,g=Ot(e),p=g.framebuffer,m=g.deleteFramebuffer;Z(p);var y=p.gl;if(h=h||p.width,d=d||p.height,de(y),v=v||(c?c.type:5121),!c){var b=mt(s),_=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Z(!1),0}}(v);c=new ze(y,{byteLength:f+h*d*b*_,accessor:{type:v,size:b}})}return c.bind({target:35051}),R(y,{framebuffer:p},function(){y.readPixels(i,a,h,d,s,v,f)}),c.unbind({target:35051}),m&&p.delete(),c}function _t(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=yt(e,{sourceAttachment:i}),s=e.width,u=e.height;u>a;){var c=be({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}!function(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=_t(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function wt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,a=n.sourceY,o=void 0===a?0:a,s=n.targetX,u=n.targetY,c=n.targetZ,l=n.targetMipmaplevel,f=void 0===l?0:l,h=n.targetInternalFormat,d=void 0===h?6408:h,v=n.width,g=n.height,p=Ot(e),m=p.framebuffer,y=p.deleteFramebuffer;Z(m);var b=m.gl,_=m.handle,x=void 0!==s||void 0!==u||void 0!==c;s=s||0,u=u||0,c=c||0;var w=b.bindFramebuffer(36160,_);Z(t);var P=null;if(t instanceof We&&(P=t,v=Number.isFinite(v)?v:P.width,g=Number.isFinite(g)?g:P.height,P.bind(0),t=P.target),x)switch(t){case 3553:case 34067:b.copyTexSubImage2D(t,f,s,u,r,o,v,g);break;case 35866:case 32879:b.copyTexSubImage3D(t,f,s,u,c,r,o,v,g)}else b.copyTexImage2D(t,f,d,r,o,v,g,0);return P&&P.unbind(),b.bindFramebuffer(36160,w||null),y&&m.delete(),P}function Pt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,s=n.sourceY0,u=void 0===s?0:s,c=n.sourceX1,l=n.sourceY1,f=n.targetX0,h=void 0===f?0:f,d=n.targetY0,v=void 0===d?0:d,g=n.targetX1,p=n.targetY1,m=n.color,y=void 0===m||m,b=n.depth,_=void 0!==b&&b,x=n.stencil,w=void 0!==x&&x,P=n.mask,O=void 0===P?0:P,S=n.filter,j=void 0===S?9728:S,C=Ot(e),E=C.framebuffer,A=C.deleteFramebuffer,T=Ot(t),M=T.framebuffer,L=T.deleteFramebuffer;Z(E),Z(M);var I=M.gl,F=M.handle,R=M.width,N=M.height,D=M.readBuffer;de(I),E.handle||36064!==r||(r=1028),y&&(O|=16384),_&&(O|=256),w&&(O|=1024),(A||L)&&1280&O&&(O=16384,k.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Z(O),c=void 0===c?E.width:c,l=void 0===l?E.height:l,g=void 0===g?R:g,p=void 0===p?N:p;var z=I.bindFramebuffer(36009,F),B=I.bindFramebuffer(36008,E.handle);return I.readBuffer(r),I.blitFramebuffer(o,u,c,l,h,v,g,p,O,j),I.readBuffer(D),I.bindFramebuffer(36008,B||null),I.bindFramebuffer(36009,z||null),A&&E.delete(),L&&M.delete(),M}function Ot(e){return e instanceof Dt?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,i=t.gl,r=t.width,a=t.height,o=t.id,s=new Dt(i,Object.assign({},n,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(c.a)({},36064,t)})),s),deleteFramebuffer:!0};var t,n,i,r,a,o,s}var kt,St=(at={},Object(c.a)(at,33902,{gl1:new Float32Array([1,1])}),Object(c.a)(at,33901,{gl1:new Float32Array([1,1])}),Object(c.a)(at,3379,{gl1:64,gl2:2048}),Object(c.a)(at,34076,{gl1:16}),Object(c.a)(at,34930,{gl1:8}),Object(c.a)(at,35661,{gl1:8}),Object(c.a)(at,35660,{gl1:0}),Object(c.a)(at,34024,{gl1:1}),Object(c.a)(at,36348,{gl1:8}),Object(c.a)(at,34921,{gl1:8}),Object(c.a)(at,36347,{gl1:128}),Object(c.a)(at,36349,{gl1:16}),Object(c.a)(at,3386,{gl1:new Int32Array([0,0])}),Object(c.a)(at,32883,{gl1:0,gl2:256}),Object(c.a)(at,35071,{gl1:0,gl2:256}),Object(c.a)(at,37447,{gl1:0,gl2:0}),Object(c.a)(at,36063,{gl1:0,gl2:4}),Object(c.a)(at,35379,{gl1:0,gl2:0}),Object(c.a)(at,35374,{gl1:0,gl2:0}),Object(c.a)(at,35377,{gl1:0,gl2:0}),Object(c.a)(at,34852,{gl1:0,gl2:4}),Object(c.a)(at,36203,{gl1:0,gl2:0}),Object(c.a)(at,33001,{gl1:0,gl2:0}),Object(c.a)(at,33e3,{gl1:0,gl2:0}),Object(c.a)(at,37157,{gl1:0,gl2:0}),Object(c.a)(at,35373,{gl1:0,gl2:0}),Object(c.a)(at,35657,{gl1:0,gl2:0}),Object(c.a)(at,36183,{gl1:0,gl2:0}),Object(c.a)(at,37137,{gl1:0,gl2:0}),Object(c.a)(at,34045,{gl1:0,gl2:0}),Object(c.a)(at,35978,{gl1:0,gl2:0}),Object(c.a)(at,35979,{gl1:0,gl2:0}),Object(c.a)(at,35968,{gl1:0,gl2:0}),Object(c.a)(at,35376,{gl1:0,gl2:0}),Object(c.a)(at,35375,{gl1:0,gl2:0}),Object(c.a)(at,35659,{gl1:0,gl2:0}),Object(c.a)(at,37154,{gl1:0,gl2:0}),Object(c.a)(at,35371,{gl1:0,gl2:0}),Object(c.a)(at,35658,{gl1:0,gl2:0}),Object(c.a)(at,35076,{gl1:0,gl2:-8,negative:!0}),Object(c.a)(at,35077,{gl1:0,gl2:7}),Object(c.a)(at,35380,{gl1:0,gl2:0}),at);function jt(e){if(e.luma=e.luma||{},!e.luma.limits){e.luma.limits={},e.luma.webgl1MinLimits={},e.luma.webgl2MinLimits={};var t=fe(e);for(var n in St){var i=St[n],r=i.gl1,a="gl2"in i?i.gl2:i.gl1,o=t?a:r,s="gl2"in i&&!t||"extension"in i&&!e.getExtension(i.extension)?o:e.getParameter(n);e.luma.limits[n]=s,e.luma.webgl1MinLimits[n]=r,e.luma.webgl2MinLimits[n]=a}}return e.luma.limits}function Ct(e){e.luma=e.luma||{};var t,n=se(e);e.luma.info||(e.luma.info=(t={},Object(c.a)(t,37445,n.vendor),Object(c.a)(t,37446,n.renderer),Object(c.a)(t,7936,n.vendorMasked),Object(c.a)(t,7937,n.rendererMasked),Object(c.a)(t,7938,n.version),Object(c.a)(t,35724,n.shadingLanguageVersion),t));return e.luma.info}function Et(e){return Object.assign(se(e),{limits:jt(e),info:Ct(e),webgl1MinLimits:e.luma.webgl1MinLimits,webgl2MinLimits:e.luma.webgl2MinLimits})}var At={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",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"},Tt=(kt={},Object(c.a)(kt,At.WEBGL2,[function(e){return fe(e)}]),Object(c.a)(kt,At.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(c.a)(kt,At.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(c.a)(kt,At.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(c.a)(kt,At.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(c.a)(kt,At.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(c.a)(kt,At.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(c.a)(kt,At.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(c.a)(kt,At.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(c.a)(kt,At.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(c.a)(kt,At.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(c.a)(kt,At.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(c.a)(kt,At.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(c.a)(kt,At.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(c.a)(kt,At.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(c.a)(kt,At.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(c.a)(kt,At.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(c.a)(kt,At.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(c.a)(kt,At.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(c.a)(kt,At.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(c.a)(kt,At.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),kt);function Mt(e,t){return Lt(e,t)}function Lt(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return Ft(e,t)})}function It(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=fe(e),Tt)e.luma.caps[t]=Ft(e,t);return e.luma.caps}function Ft(e,t){var n=Tt[t];Z(n,t);var i,r=fe(e)&&n[1]||n[0];if("function"==typeof r)i=r(e);else if(Array.isArray(r)){i=!0;var a=!0,o=!1,s=void 0;try{for(var u,c=r[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i=i&&Boolean(e.getExtension(l))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}else"string"==typeof r?i=Boolean(e.getExtension(r)):"boolean"==typeof r?i=r:Z(!1);return i}var Rt={};function Nt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Tt[t];if(Z(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in Rt)return Rt[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),Rt[t]=s,s}var Dt=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(fe(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(fe(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(Z(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Z(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&k.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,r=void 0!==i&&i,a=n.resizeAttachments,o=void 0===a||a,s={};r&&Object.keys(this.attachments).forEach(function(e){s[e]=null}),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){Z(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof ot)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=Object(A.a)(f,3),v=d[0],g=d[1],p=void 0===g?0:g,m=d[2],y=void 0===m?0:m;h=v,this._attachTexture({attachment:l,texture:v,layer:p,level:y})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(function(e){return(Dt.STATUS||{})[e]||"Framebuffer error ".concat(e)}(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&>(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){pt({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;de(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=xe(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?xe(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>k.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=_t(this,{maxHeight:100});return k.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,i,r){var a,o=null;e&&((o=o||{})[36064]=new Ye(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:(a={},Object(c.a)(a,10241,9728),Object(c.a)(a,10240,9728),Object(c.a)(a,10242,33071),Object(c.a)(a,10243,33071),a)}));return t&&n?(o=o||{})[33306]=new ot(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}):t?(o=o||{})[36096]=new ot(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}):n&&Z(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof ot?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Z(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;fe(t)?t.readBuffer(e):Z(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(fe(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Z(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=It(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(je);function zt(e,t){Z(e instanceof Ye||e instanceof et||e instanceof nt);var n=e.constructor,i=e.gl,r=e.width,a=e.height,o=e.format,s=e.type,u=e.dataFormat,c=e.border,l=e.mipmaps;return new n(i,Object.assign({width:r,height:a,format:o,type:s,dataFormat:u,border:c,mipmaps:l},t))}Dt.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];function Bt(e){return Boolean(e&&2===e._version)}var Ut={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Vt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(Ut,{width:1,height:1},e)}function Gt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},Ut,t),i=n.width,r=n.height;function o(e){if(t.throwOnError)throw new Error(e);return null}a.a?e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(oe({canvas:t.canvas,width:i,height:r,onError:o}),t):e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,a=e.onError;if(r&&!i)return a("headless-gl does not support WebGL2");if(!z)return a(X);var o=z(t,n,e);return o||a(q)}(H({},t,{width:i,height:r,onError:o}));return e?(function(e){var t=Bt(e)?"WebGL2":"WebGL1",n=se(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";k.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=Wt(e,t)),e):null}function Wt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==W&&e instanceof W)return 2;return 1}(e);var n=t=Object.assign({},Ut,t),i=n.manageState,r=n.debug;return i&&Object(I.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}function qt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}var Zt=35632,Yt=35633;function Qt(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||qt(t)||"(unnamed)",u="".concat(function(e){switch(e){case Zt:return"fragment";case Yt:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=Jt(a,r-o);return s+n+e})}(t);return{shaderName:u,errors:Kt(a,v),warnings:Kt(o,v)}}function Kt(e,t){for(var n="",i=0;i=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}var en,tn="Shader: GLSL source code must be a JavaScript string",nn=function(e){function t(e,n){var r;Object(i.a)(this,t),he(e),Z("string"==typeof n.source,tn);var a=qt(n.source,null)||n.id||Q("unnamed ".concat(t.getTypeName(n.shaderType)));return(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,{id:a}))).shaderType=n.shaderType,r.source=n.source,r.initialize(n),r}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"getTypeName",value:function(e){switch(e){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Z(!1),"unknown"}}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.source,n=qt(t,null);n&&(this.id=Q(n)),this._compile(t)}},{key:"getParameter",value:function(e){return this.gl.getShaderParameter(this.handle,e)}},{key:"toString",value:function(){return"".concat(t.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return qt(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var e=this.gl.getExtension("WEBGL.debug_shaders");return e?e.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL.debug_shaders not implemented"}},{key:"_compile",value:function(){if(this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){var e=Qt(this.gl.getShaderInfoLog(this.handle),this.source,this.shaderType,this.id),t=e.shaderName,n=e.errors,i=e.warnings;throw k.error("GLSL compilation errors in ".concat(t,"\n").concat(n))(),k.warn("GLSL compilation warnings in ".concat(t,"\n").concat(i))(),new Error("GLSL compilation errors in ".concat(t))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}]),t}(je),rn=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},n,{shaderType:35633})))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),t}(nn),an=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},n,{shaderType:35632})))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),t}(nn);function on(e,t,n){return(on="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(Pe.a)(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}var sn,un=(en={},Object(c.a)(en,5126,function(e,t,n){return e.uniform1fv(t,vn(n,1))}),Object(c.a)(en,35664,function(e,t,n){return e.uniform2fv(t,vn(n,2))}),Object(c.a)(en,35665,function(e,t,n){return e.uniform3fv(t,vn(n,3))}),Object(c.a)(en,35666,function(e,t,n){return e.uniform4fv(t,vn(n,4))}),Object(c.a)(en,5124,function(e,t,n){return e.uniform1iv(t,gn(n,1))}),Object(c.a)(en,35667,function(e,t,n){return e.uniform2iv(t,gn(n,2))}),Object(c.a)(en,35668,function(e,t,n){return e.uniform3iv(t,gn(n,3))}),Object(c.a)(en,35669,function(e,t,n){return e.uniform4iv(t,gn(n,4))}),Object(c.a)(en,35670,function(e,t,n){return e.uniform1iv(t,gn(n,1))}),Object(c.a)(en,35671,function(e,t,n){return e.uniform2iv(t,gn(n,2))}),Object(c.a)(en,35672,function(e,t,n){return e.uniform3iv(t,gn(n,3))}),Object(c.a)(en,35673,function(e,t,n){return e.uniform4iv(t,gn(n,4))}),Object(c.a)(en,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,vn(n,4))}),Object(c.a)(en,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,vn(n,9))}),Object(c.a)(en,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,vn(n,16))}),Object(c.a)(en,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,5125,function(e,t,n){return e.uniform1uiv(t,pn(n,1))}),Object(c.a)(en,36294,function(e,t,n){return e.uniform2uiv(t,pn(n,2))}),Object(c.a)(en,36295,function(e,t,n){return e.uniform3uiv(t,pn(n,3))}),Object(c.a)(en,36296,function(e,t,n){return e.uniform4uiv(t,pn(n,4))}),Object(c.a)(en,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,vn(n,6))}),Object(c.a)(en,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,vn(n,8))}),Object(c.a)(en,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,vn(n,6))}),Object(c.a)(en,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,vn(n,12))}),Object(c.a)(en,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,vn(n,8))}),Object(c.a)(en,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,vn(n,12))}),Object(c.a)(en,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36311,function(e,t,n){return e.uniform1i(t,n)}),en),cn={},ln={},fn={},hn=[0];function dn(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(hn[0]=e,e=hn);var r=e.length;if(r%t&&k.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(fe(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",Dn),n._isCached=!1,n.initialize(r),Object.seal(Object(Oe.a)(n)),n._setId(r.id),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new rn(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new an(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,Z(this.vs instanceof rn),Z(this.fs instanceof an),this.uniforms={},i&&(de(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Nn(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:on(Object(Pe.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,f=void 0!==l&&l,h=e.indexType,d=void 0===h?5123:h,v=e.isInstanced,g=void 0!==v&&v,p=e.instanceCount,m=void 0===p?0:p,y=e.vertexArray,b=void 0===y?null:y,_=e.transformFeedback,x=e.framebuffer,w=e.parameters,P=void 0===w?{}:w,O=e.uniforms,S=e.samplers;if((O||S)&&(k.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(O||{})),void 0!==n){var j=x?x.id:"default",C="mode=".concat(xe(this.gl,r)," verts=").concat(a," ")+"instances=".concat(m," indexType=").concat(xe(this.gl,d)," ")+"isInstanced=".concat(g," isIndexed=").concat(f," ")+"Framebuffer=".concat(j);k.log(n,C)()}return Z(b),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(b.bindForDraw(a,m,function(){if(void 0!==x&&(P=Object.assign({},P,{framebuffer:x})),_){var e=In(r);_.begin(e)}t._bindTextures(),R(t.gl,P,function(){f&&g?t.gl.drawElementsInstanced(r,a,d,s,m):f&&fe(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):f?t.gl.drawElements(r,a,d,s):g?t.gl.drawArraysInstanced(r,s,a,m):t.gl.drawArrays(r,s,a)}),_&&_.end()}),!0)}},{key:"setUniforms",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=!1,r={};for(var a in t)_n(this.uniforms[a],t[a])||(i=!0,r[a]=t[a],this.uniforms[a]=(e=t[a],Array.isArray(e)||ArrayBuffer.isView(e)?e.slice():e));return i&&(n(),function(e,t,n){for(var i in e){var r=e[i];if((!n||Boolean(n[i]))&&!bn(r))throw t=t?"".concat(t," "):"",console.error("".concat(t," Bad uniform ").concat(i),r),new Error("".concat(t," Bad uniform ").concat(i))}}(r,this.id,this._uniformSetters),this._setUniforms(r)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof Dt)i=i.texture;if(i instanceof We)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof Dt&&(n=n.texture),n instanceof We)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof Dt&&(n=n.texture),n instanceof We){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new rn({handle:u});break;case 35632:n.fs=new an({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Q(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),k.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),k.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||k.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=fe(e),i=Lt(e,At.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Z(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(r.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(je),Un=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),de(e),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).initialize(r),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return fe(e)}}]),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,J(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,k.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof ze==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(je),Vn=null;function Gn(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!Vn||Vn.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var a=r.id||r.program&&r.program.id;return(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},r,{id:a})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?fe(e)||"Chrome"===function(e){if(!e&&!Object(l.a)())return"Node";if(Object(Wn.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":y.b.chrome?"Chrome":y.b.safari?"Safari":y.b.mozInnerScreenX?"Firefox":"Unknown"}():fe(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Z(!1)}}}]),Object(r.a)(t,[{key:"delete",value:function(){on(Object(Pe.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Z(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Z(fe(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new ze(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=Gn(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=Hn.isSupported(t)?new Hn(t):Hn.getDefaultArray(t),ee(this,"VertexArray","v6.0",qn),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new ze(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof ze){var a=n;if(r){var o=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,o)}else{var s=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,s)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}(),Yn=5126,Qn=5124,Kn=5125,Jn=function(){function e(t){var n;for(var r in Object(i.a)(this,e),this.layout={},this.size=0,t)this._addUniform(r,t[r]);this.size+=(4-this.size%4)%4;var a=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,Yn,a),Object(c.a)(n,Qn,new Int32Array(a.buffer)),Object(c.a)(n,Kn,new Uint32Array(a.buffer)),n)}return Object(r.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[Yn]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Z(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Fn(t);Z(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}();function $n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,i=e.program,r=e.uniforms,a=e.undefinedOnly,o=void 0!==a&&a;Z(i);var s=i._uniformSetters,u={},l=Object.keys(s).sort(),f=0,h=!0,d=!1,v=void 0;try{for(var g,p=l[Symbol.iterator]();!(h=(g=p.next()).done);h=!0){var m=g.value;m.match(".*_.*")||m.match(".*Matrix")||ei({table:u,header:n,uniforms:r,uniformName:m,undefinedOnly:o})&&f++}}catch(e){d=!0,v=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw v}}var y=!0,b=!1,_=void 0;try{for(var x,w=l[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var P=x.value;P.match(".*Matrix")&&ei({table:u,header:n,uniforms:r,uniformName:P,undefinedOnly:o})&&f++}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var O=!0,k=!1,S=void 0;try{for(var j,C=l[Symbol.iterator]();!(O=(j=C.next()).done);O=!0){var E=j.value;u[E]||ei({table:u,header:n,uniforms:r,uniformName:E,undefinedOnly:o})&&f++}}catch(e){k=!0,S=e}finally{try{O||null==C.return||C.return()}finally{if(k)throw S}}var A=0,T={};if(!o)for(var M in r){var L=r[M];u[M]||(A++,T[M]=Object(c.a)({Type:"NOT USED: ".concat(L)},n,$(L)))}return{table:u,count:f,unusedTable:T,unusedCount:A}}function ei(e){var t,n=e.table,i=e.header,r=e.uniforms,a=e.uniformName,o=e.undefinedOnly,s=r[a],u=function(e){return null!=e}(s);return(!o||!u)&&(n[a]=(t={},Object(c.a)(t,i,u?$(s):"N/A"),Object(c.a)(t,"Uniform Type",u?s:"NOT PROVIDED"),t),!0)}function ti(e,t,n,i){var r,a,o,s,u=e.gl,l="NOT PROVIDED",f="N/A",h="N/A",d="N/A";if(n&&(l=n.type,f=n.size,a=-1!==(l=String(l).replace("Array","")).indexOf("nt")),t instanceof ze){var v,g,p=t,m=p.getDebugData(),y=m.data;if(o=m.modified?"*":"",s=y,h=(d=p.byteLength)/y.BYTES_PER_ELEMENT/f,n){var b=n.divisor>0;g="".concat(b?"I ":"P "," ").concat(h," (x").concat(f,"=").concat(d," bytes ").concat(xe(u,l),")")}else a=!0,g="".concat(d," bytes");return v={},Object(c.a)(v,i,"".concat(o).concat($(s,{size:f,isInteger:a}))),Object(c.a)(v,"Format ",g),v}return s=t,f=t.length,a=-1!==(l=String(t.constructor.name).replace("Array","")).indexOf("nt"),r={},Object(c.a)(r,i,"".concat($(s,{size:f,isInteger:a})," (constant)")),Object(c.a)(r,"Format ","".concat(f,"x").concat(l," (constant)")),r}function ni(e,t){var n=Rn(t.type,t.size);return n?"".concat(e," (").concat(n.name,")"):e}function ii(e){var t=e.accessor,n=Rn(t.type,t.size);return n?"".concat(n.name," ").concat(e.name):e.name}var ri={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ai=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id,r=void 0===n?Q("geometry"):n,a=t.drawMode,o=void 0===a?ri.TRIANGLES:a,s=t.mode,u=t.attributes,c=void 0===u?{}:u,l=t.indices,f=void 0===l?null:l,h=t.vertexCount,d=void 0===h?null:h;this.id=r,this.drawMode=0|o||0|s,this.attributes={},this.userData={},this._setAttributes(c,f),this.vertexCount=d||this._calculateVertexCount(this.attributes,this.indices)}return Object(r.a)(e,null,[{key:"DRAW_MODE",get:function(){return ri}}]),Object(r.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?H({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Z(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"indices"===n?(Z(!this.indices),this.indices=i,void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed)):this.attributes[n]=i}return this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}if(!Number.isFinite(n)){var s=e.POSITION||e.positions;s&&(n=s.value&&s.value.length/(s.size||3))}return Z(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}(),oi=function e(){Object(i.a)(this,e)},si=n(47),ui=[255,255,255],ci=[0,0,1],li=[0,0,-1],fi=[0,0,1],hi=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e),this.id=t.id||Q("light");var n=t.color,r=void 0===n?ui:n;this.color=r;var a=t.intensity,o=void 0===a?1:a;this.intensity=o},di=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).type="ambient",e}return Object(ke.a)(t,e),t}(hi),vi=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).type="directional";var r=n.direction,a=void 0===r?li:r;return e.direction=new si.a(a).normalize().toArray(),e}return Object(ke.a)(t,e),t}(hi),gi=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).type="point";var r=n.position,a=void 0===r?fi:r;return e.position=a,e.attenuation=e._getAttenuation(n),e}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:ci}}]),t}(hi),pi=0,mi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.onCreateContext,r=void 0===n?function(e){return Gt(e)}:n,a=t.onAddHTML,o=void 0===a?null:a,s=t.onInitialize,u=void 0===s?function(){}:s,c=t.onRender,l=void 0===c?function(){}:c,f=t.onFinalize,h=void 0===f?function(){}:f,d=t.gl,v=void 0===d?null:d,g=t.glOptions,p=void 0===g?{}:g,m=t.debug,y=void 0!==m&&m,b=t.createFramebuffer,_=void 0!==b&&b,x=t.autoResizeViewport,w=void 0===x||x,P=t.autoResizeDrawingBuffer,O=void 0===P||P,S=t.stats,j=void 0===S?C.get("animation-loop-".concat(pi++)):S,E=t.useDevicePixels,A=void 0===E||E;"useDevicePixelRatio"in t&&(k.deprecated("useDevicePixelRatio","useDevicePixels")(),A=t.useDevicePixelRatio),this.props={onCreateContext:r,onAddHTML:o,onInitialize:u,onRender:l,onFinalize:h,gl:v,glOptions:p,debug:y,createFramebuffer:_},this.gl=v,this.needsRedraw=null,this.timeline=null,this.stats=j,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:w,autoResizeDrawingBuffer:O,useDevicePixels:A}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Z("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,ae().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=Bn.isSupported(e.gl,["timers"])?new Bn(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),ge(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(Je.a)(Ke.a.mark(function e(){return Ke.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return k.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;ge(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||ve(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(s.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Wt(this.props.gl,e):this.onCreateContext(e),!le(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(E.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas,r=i.clientWidth,a=i.clientHeight;return r>0&&a>0?n=r/a:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Xt(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new Dt(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()&&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(){this.gl.canvas.addEventListener("mousemove",this._onMousemove),this.gl.canvas.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}}]),e}(),yi=new Uint8Array([0,0,0]);function bi(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function _i(e){var t=Object(A.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function xi(){return yi}var wi={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Pi(e,t){var n=(t||{}).attributeMap,i=void 0===n?wi:n;return i&&i[e]||e}function Oi(e,t){var n;switch(e){case"indices":n=n||"indices";break;case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2;break;case"indices":t.size=t.size||1,t.isIndexed=void 0===t.isIndexed||t.isIndexed,Z(t.value instanceof Uint16Array||t.value instanceof Uint32Array,'attribute array for "indices" must be of integer type')}Z(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var ki=n(25),Si=n(99),ji=n(30),Ci=n.n(ji),Ei={},Ai=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},Ti=new Map;Ci.a.listenFor("luma.gl",function(e){var t=Ei[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){o.d.__SEER_INITIALIZED__&&(Ti.has(e)||Ti.set(e,new Map),Ti.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();Ai(i,n,e.value),t.setUniforms(i)}});var Mi,Li=["renderPickingBuffer","pickingEnabled"],Ii=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Z(le(t));var r=n.id,a=void 0===r?Q("base-model"):r;this.id=a,this.gl=t,this.id=n.id||Q("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(r.a)(e,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props={},this.program=this._createProgram(e),this.vertexArray=new Zn(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete Ei[t],Ci.a.deleteItem("luma.gl",t)}},{key:"destroy",value:function(){this.delete()}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.getUniforms()}},{key:"setUniforms",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),function(e,t){if(o.d.__SEER_INITIALIZED__&&e){var n=Ti.get(e);n&&n.forEach(function(e,n){Ai(t,n,e)})}}(this.id,t),t=this._extractAnimatedUniforms(t),this.program.setUniforms(t,function(){e._checkForDeprecatedUniforms(t)}),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return gt(this.program.gl,e),this}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,s=t.attributes,u=void 0===s?{}:s,c=t.transformFeedback,l=void 0===c?this.transformFeedback:c,f=t.parameters,h=void 0===f?{}:f,d=t.vertexArray,v=void 0===d?this.vertexArray:d,g=t.animationProps;Ei[(e=this).id]||(Ei[e.id]=e,Ci.a.listItem("luma.gl",e.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(g);var p=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&k.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,b=m.indexType,_=m.indexOffset,x=this.isInstanced,w=this.instanceCount,P=function(){},O=this.props,S=O.onBeforeRender,j=void 0===S?P:S,C=O.onAfterRender,E=void 0===C?P:C;j(),this._timerQueryStart();var A=this.program.draw(Object.assign({},t,{logPriority:p,uniforms:null,framebuffer:r,parameters:h,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:b,isInstanced:x,instanceCount:w,offset:y?_:0}));return this._timerQueryEnd(),E(),this._logDrawCallEnd(p,v,r),A}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(c.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&Bn.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&k.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,s=e.defines,u=void 0===s?{}:s,c=e.inject,l=void 0===c?{}:c,f=e.shaderCache,h=void 0===f?null:f,d=e.varyings,v=void 0===d?null:d,g=e.bufferMode,p=void 0===g?35981:g,m=e.program,y=void 0===m?null:m;this.getModuleUniforms=function(e){};var b=this.id;if(!y){n=n||ki.a.vs,r=r||ki.a.fs;var _=Object(Si.a)(this.gl,{vs:n,fs:r,modules:o,inject:l,defines:u,log:k});n=_.vs,r=_.fs,y=h?h.getProgram(this.gl,{id:b,vs:n,fs:r}):new zn(this.gl,{id:b,vs:n,fs:r,varyings:v,bufferMode:p}),this.getModuleUniforms=_.getUniforms||function(e){}}return Z(y instanceof zn,"Model needs a program"),y}},{key:"_checkForDeprecatedUniforms",value:function(e){Li.forEach(function(t){t in e&&k.deprecated(t,"use picking shader module and Model class updateModuleSettings()")()})}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!J(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new Bn(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,k.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(k.priority>> DRAWING MODEL ".concat(this.id),{collapsed:k.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=ti(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),c=t.accessors[s.location];c&&(u="".concat(o,": ").concat(ni(s.name,c))),r[u]=ti(t,a[o],c,i)}}return r}({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=$n({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,l=$n({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),f=l.table;l.count>0&&k.log("MISSING UNIFORMS",Object.keys(f))(),u>0&&k.log("UNUSED UNIFORMS",Object.keys(s))();var h=function(e){var t={},n="Accessors for ".concat(e.id),i=!0,r=!1,a=void 0;try{for(var o,s=e.attributeInfos[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(u){var l=ii(u);t["in ".concat(l)]=Object(c.a)({},n,JSON.stringify(u.accessor))}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}var f=!0,h=!1,d=void 0;try{for(var v,g=e.varyingInfos[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;if(p){var m=ii(p);t["out ".concat(m)]=Object(c.a)({},n,JSON.stringify(p.accessor))}}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}return t}(this.vertexArray.configuration);k.table(e,r)(),k.table(e,o)(),k.table(e+1,h)(),function(e,t){if(Ci.a.isReady()&&!Ci.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);Ci.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),k.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}(),Fi=function(e){function t(e,n){Object(i.a)(this,t);var r=n.id,a=void 0===r?Q("model"):r;return Object(we.a)(this,Object(Pe.a)(t).call(this,e,H({},n,{id:a})))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};on(Object(Pe.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Z(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){on(Object(Pe.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){on(Object(Pe.a)(t.prototype),"delete",this).call(this),this._deleteGeometryBuffers()}},{key:"destroy",value:function(){this.delete()}},{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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Z(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Z(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=function(e,t,n){var i={};for(var r in t.attributes){var a=t.attributes[r],o=Pi(r,n);if(a.constant)i[o]=a.value;else{var s=a.value,u=H({},a);delete u.value,i[o]=[new ze(e,s),u],Oi(r,u)}}return t.indices&&(i.indices=new ze(e,{data:t.indices.value||t.indices,target:34963})),i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(J(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(c.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return k.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof ze&&t.delete()}}},{key:"_setAnimationProps",value:function(e){var t=this;if(this.animated){Z(e,"Model.draw(): animated uniforms but no animationProps");var n=this._evaluateAnimateUniforms(e);this.program.setUniforms(n,function(){t._checkForDeprecatedUniforms(n)})}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(J(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new Un(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new Bn(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,k.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}}]),t}(Ii),Ri=n(110),Ni=n(76),Di=n(136),zi="transform_uSampler_",Bi="transform_uSize_",Ui="transform_position";function Vi(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,s={},u=t,c={};if(a>0||i){var l=u.split("\n"),f=l.slice();if(l.forEach(function(e,t,r){if(a>0){var u=function(e,t){var n={},i=function(e){return Object(Ni.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(zi).concat(e),n="".concat(Bi).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),u=s.samplerName,c=s.sizeName,l=s.uniformDeclerations,f=Object(Ni.e)(r),h=" ".concat(r," ").concat(a," = transform_getInput(").concat(u,", ").concat(c,").").concat(f,";\n");n[u]=a;var d={"vs:#decl":l,"vs:#main-start":h};return{updatedLine:o,inject:d,samplerTextureMap:n}}return null}(e,n);if(u){var l=u.updatedLine,h=u.inject;f[t]=l,c=Object(Ri.a)([c,h]),Object.assign(s,u.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(Ni.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Z(r);var h="".concat(Bi).concat(i),d={"vs:#decl":"uniform vec2 ".concat(h,";\n"),"vs:#main-start":" vec2 ".concat(Ui," = transform_getPos(").concat(h,");\n gl_Position = vec4(").concat(Ui,", 0, 1.);\n")};c=Object(Ri.a)([c,d])}u=f.join("\n")}return{vs:u,targetTextureType:o,inject:c,samplerTextureMap:s}}var Gi=(Mi={},Object(c.a)(Mi,10241,9728),Object(c.a)(Mi,10240,9728),Object(c.a)(Mi,10242,33071),Object(c.a)(Mi,10243,33071),Mi),Wi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Z(fe(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this._createdBuffers={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(r.a)(e,null,[{key:"isSupported",value:function(e){return fe(e)}}]),Object(r.a)(e,[{key:"delete",value:function(){for(var e in this._createdBuffers)this._createdBuffers[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof ze?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Z(!n||n===this.targetTextureVarying);var o=yt(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,u=Object(Ni.d)(this.targetTextureType),c=new s(o.length*u/4),l=0,f=0;f0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,Z(s=this.framebuffers[this.currentIndex]),r.viewport=[0,0,s.width,s.height],o&&this.gl.clear(this.gl.COLOR_BUFFER_BIT)),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){k.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Z(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Z(r[o]instanceof ze||r[o].buffer instanceof ze);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(Gi)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Z(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(k.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(k.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,f=e._swapTexture;for(var h in Z(a&&(s||n||c)&&o),t||{})Z(t[h]instanceof ze||t[h].buffer instanceof ze);for(var d in u||{})Z(u[d]instanceof Ye);return Z(!c||l),Z(!f||u[f]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n);Z(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e){var t;if(e instanceof Ye)return e;var n=this.sourceTextures[0][e];return n?(this._targetRefTexName=e,zt(n,{parameters:(t={},Object(c.a)(t,10241,9728),Object(c.a)(t,10240,9728),Object(c.a)(t,10242,33071),Object(c.a)(t,10243,33071),t),pixelStore:Object(c.a)({},37440,!1)})):null}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=new ze(this.gl,{byteLength:o,usage:s,accessor:u});this._createdBuffers[r]&&this._createdBuffers[r].delete(),this._createdBuffers[r]=c,this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new ze(this.gl,t);return this._createdBuffers[e]&&(this._createdBuffers[e].delete(),this._createdBuffers[e]=n),n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Z(this.feedbackBuffers[t][i]instanceof ze))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new Fi(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){J(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new Un(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new Un(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new Dt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(c.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new Dt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(c.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new ze(this.gl,{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,s=Object(Ri.a)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:Object(Ni.b)({version:$t(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Di.a].concat(e.modules||[]):e.modules,uniforms:i,inject:s,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return Vi({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}(),Hi="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",Xi=[-1,-1,1,-1,-1,1,1,1],qi=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=Xi.map(function(e){return-1===e?0:e});return(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},n,{vs:Hi,geometry:new ai({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(Xi)},aTexCoord:{size:2,value:new Float32Array(a)},aCoordinate:{size:2,value:new Float32Array(a)}}})})))).setVertexCount(4),r}return Object(ke.a)(t,e),t}(Fi),Zi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Z(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Z("string"==typeof t),Z(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new rn(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Z("string"==typeof t),Z(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new an(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Z(this._compareContexts(e,this.gl)),Z("string"==typeof t.vs),Z("string"==typeof t.fs),Z("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new zn(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}(),Yi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.onInitialize,a=void 0===r?function(){}:r,o=n.onFinalize,s=void 0===o?function(){}:o,u=n.useDevicePixels,c=void 0===u||u,l=n.autoResizeDrawingBuffer,f=void 0===l||l;this.props={onInitialize:a,onFinalize:s},this.setProps({autoResizeDrawingBuffer:f,useDevicePixels:c}),Z(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._resolveNextFrame=null,this._nextFramePromise=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(r.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.addEventListener("message",function(n){switch(n.data.command){case"start":i=n.data.opts.canvas,r=new Map,i.addEventListener=function(e,n){t.postMessage({command:"addEventListener",type:e}),r.has(e)||r.set(e,[]),r.get(e).push(n)},i.removeEventListener=function(e,n){t.postMessage({command:"removeEventListener",type:e});var i=r.get(e);i&&i.splice(i.indexOf(n),1)},i.dispatchEvent=function(e,t){var n=r.get(e);n&&n.forEach(function(e){return e(t)})},t.canvas=i,e.start(n.data.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=n.data.width,t.canvas.height=n.data.height;break;case"event":t.canvas.dispatchEvent(n.data.type,n.data.event)}var i,r})}}}]),Object(r.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,ae().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=ve(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(ge(this._animationFrameId),this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"waitForRender",value:function(){var e=this;return this._nextFramePromise||(this._nextFramePromise=new Promise(function(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(s.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._animationFrameId=ve(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=oe(e);t.transferControlToOffscreen||k.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),Qi=function(){function e(t,n){Object(i.a)(this,e);var r=n.id,a=void 0===r?"pass":r;this.id=a,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(r.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=Dt.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),R(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),Ki=function(e){function t(e,n){return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(Qi),Ji=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(i.a)(this,e),this.gl=t,this.framebuffer1=new Dt(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new Dt(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(r.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),$i=function(e){function t(e,n){var r;return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"multi-pass"},n)))).renderState=new Ji(e,n),r}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(Ki),er=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.gl,n=this.props.clearBits,i=void 0===n?16640:n;t.clear(i)}}]),t}(Qi),tr=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(Qi),nr="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",ir=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},r)))).clipspace=new qi(e,{id:"copy-pass",fs:nr}),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Qi),rr="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",ar=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t),n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"texture-pass"},r)));var a=r.texture,o=r.opacity,s=void 0===o?1:o;return n.clipspace=new qi(e,{id:"texture-pass",fs:rr,uniforms:{uDiffuseSampler:a,uOpacity:s}}),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Qi),or=n(145),sr=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Qi),ur=function(e){function t(e,n){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t);var o="".concat(n.name,"-pass");Object(or.a)(n);var s=function(e,t,n,i){if(t.filter||t.sampler){var r=hr(t),a=new sr(e,{id:n,model:cr(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=hr(t,r),s="".concat(n,"-").concat(o.length+1);return new sr(e,Object.assign({id:s,model:cr(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,o,a);return(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:o,passes:s},a)))).module=n,r}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.module.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1,c.uniforms&&c.model.setUniforms(c.uniforms),c.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(Ki);function cr(e,t,n,i,r){var a=new qi(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var lr=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},fr=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function hr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return lr(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return fr(i)}return null}var dr={x:[2,0,1],y:[0,1,2],z:[1,2,0]},vr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("truncated-code-geometry"):n,a=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,P=x(b),O=_(b),k=v?-2:0,S=l+(p?2:0),j=u+1,C=new Uint16Array(u*(l+m)*6),E=dr[h],A=new Float32Array(3*y),T=new Float32Array(3*y),M=new Float32Array(2*y),L=0,I=0,F=k;F<=S;F++){var R=F/l,N=o*R,D=void 0;F<0?(N=0,R=1,D=n):F>l?(N=o,R=1,D=r):D=n+F/l*(r-n),-2!==F&&F!==l+2||(D=0,R=0),N-=o/2;for(var z=0;zl?0:B*P,T[L+E[1]]=F<0?-1:F>l?1:O,T[L+E[2]]=F<0||F>l?0:U*P,M[I+0]=z/u,M[I+1]=R,I+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("cone-geometry"):n,a=e.radius,o=void 0===a?1:a,s=e.cap,u=void 0===s||s;return Object(we.a)(this,Object(Pe.a)(t).call(this,H({},e,{id:r,topRadius:0,topCap:Boolean(u),bottomCap:Boolean(u),bottomRadius:o})))}return Object(ke.a)(t,e),t}(vr),pr=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]),mr=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]),yr=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]),br=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]),_r={POSITION:{size:3,value:new Float32Array(mr)},NORMAL:{size:3,value:new Float32Array(yr)},TEXCOORD_0:{size:2,value:new Float32Array(br)}},xr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("cube-geometry"):n;return Object(we.a)(this,Object(Pe.a)(t).call(this,H({},e,{id:r,indices:{size:1,value:new Uint16Array(pr)},attributes:H({},_r,e.attributes)})))}return Object(ke.a)(t,e),t}(ai),wr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("cylinder-geometry"):n,a=e.radius,o=void 0===a?1:a;return Object(we.a)(this,Object(Pe.a)(t).call(this,H({},e,{id:r,bottomRadius:o,topRadius:o})))}return Object(ke.a)(t,e),t}(vr),Pr=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],Or=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],kr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("ico-sphere-geometry"):n,a=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).iterations,t=void 0===e?0:e,n=Math.PI,i=2*n,r=[].concat(Pr),a=[].concat(Or);r.push(),a.push();for(var o=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,a=t>n?t:n,o="".concat(i,"|").concat(a);if(o in e)return e[o];var s=r[t],u=r[t+1],c=r[t+2],l=r[n],f=r[n+1],h=r[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,r.push(d,v,g),e[o]=r.length/3-1}}(),s=0;s=0;g-=3){var p=a[g+0],m=a[g+1],y=a[g+2],b=3*p,_=3*m,x=3*y,w=2*p,P=2*m,O=2*y,k=r[b+0],S=r[b+1],j=r[b+2],C=Math.acos(j/Math.sqrt(k*k+S*S+j*j)),E=Math.atan2(S,k)+n,A=C/n,T=1-E/i,M=r[_+0],L=r[_+1],I=r[_+2],F=Math.acos(I/Math.sqrt(M*M+L*L+I*I)),R=Math.atan2(L,M)+n,N=F/n,D=1-R/i,z=r[x+0],B=r[x+1],U=r[x+2],V=Math.acos(U/Math.sqrt(z*z+B*B+U*U)),G=Math.atan2(B,z)+n,W=V/n,H=1-G/i,X=[z-M,B-L,U-I],q=[k-M,S-L,j-I],Z=new si.a(X).cross(q).normalize(),Y=void 0;(0===T||0===D||0===H)&&(0===T||T>.5)&&(0===D||D>.5)&&(0===H||H>.5)&&(r.push(r[b+0],r[b+1],r[b+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=A,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z,r.push(r[_+0],r[_+1],r[_+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=N,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z,r.push(r[x+0],r[x+1],r[x+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=W,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z),d[b+0]=d[_+0]=d[x+0]=Z.x,d[b+1]=d[_+1]=d[x+1]=Z.y,d[b+2]=d[_+2]=d[x+2]=Z.z,v[w+0]=T,v[w+1]=A,v[P+0]=D,v[P+1]=N,v[O+0]=H,v[O+1]=W}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(r)},NORMAL:{size:3,value:new Float32Array(d)},TEXCOORD_0:{size:2,value:new Float32Array(v)}}}}(e),o=a.indices,s=a.attributes;return Object(we.a)(this,Object(Pe.a)(t).call(this,H({},e,{id:r,indices:o,attributes:H({},s,e.attributes)})))}return Object(ke.a)(t,e),t}(ai);var Sr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("plane-geometry"):n,a=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")],f=e["".concat(c[1],"len")],h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,P=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=P,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*P-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*P-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*P-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0}y+=2,b+=3}for(var O=h+1,k=new Uint16Array(h*d*6),S=0;S0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("sphere-geometry"):n,a=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,P=s*y,O=Math.sin(w),k=Math.cos(w),S=Math.sin(P),j=Math.cos(P),C=k*S,E=j,A=O*S,T=o(C,E,A,m,y);f[x+0]=T*C,f[x+1]=T*E,f[x+2]=T*A,h[x+0]=C,h[x+1]=E,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var M=n+1,L=0;L1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Z(e),t=t||this.matrix;var n=new Tr.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{key:"transform",value:function(){if(this.parent){var e=this.parent;this.endPosition.set(this.position.add(e.endPosition)),this.endRotation.set(this.rotation.add(e.endRotation)),this.endScale.set(this.scale.add(e.endScale))}else this.endPosition.set(this.position),this.endRotation.set(this.rotation),this.endScale.set(this.scale);for(var t=this.children,n=0;n0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var r=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===r?[]:r;return a.every(function(e){return Z(e instanceof Mr)}),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).children=a,e}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),on(Object(Pe.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new Tr.a:n,r=new Tr.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l instanceof t?l.traverse(e,{worldMatrix:r}):e(l,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return k.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(Mr),Ir=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof Fi?(n.model=e,n._setModelNodeProps(r)):n.model=new Fi(e,r),n.managedResources=r.managedResources||[],n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return on(Object(Pe.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(Mr),Fr=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(ke.a)(t,e),t}(Mr);n.d(t,"isWebGL",function(){return le}),n.d(t,"isWebGL2",function(){return fe}),n.d(t,"lumaStats",function(){return C}),n.d(t,"createGLContext",function(){return Gt}),n.d(t,"destroyGLContext",function(){return Ht}),n.d(t,"resizeGLContext",function(){return Xt}),n.d(t,"setGLContextDefaults",function(){return Vt}),n.d(t,"getContextInfo",function(){return Et}),n.d(t,"getGLContextInfo",function(){return Ct}),n.d(t,"getContextLimits",function(){return jt}),n.d(t,"FEATURES",function(){return At}),n.d(t,"hasFeature",function(){return Mt}),n.d(t,"hasFeatures",function(){return Lt}),n.d(t,"getFeatures",function(){return It}),n.d(t,"canCompileGLGSExtension",function(){return Nt}),n.d(t,"cloneTextureFrom",function(){return zt}),n.d(t,"getKeyValue",function(){return _e}),n.d(t,"getKey",function(){return xe}),n.d(t,"setContextDefaults",function(){return Vt}),n.d(t,"glGetDebugInfo",function(){return se}),n.d(t,"trackContextState",function(){return I.a}),n.d(t,"resetParameters",function(){return E.d}),n.d(t,"getParameter",function(){return E.b}),n.d(t,"getParameters",function(){return E.c}),n.d(t,"setParameter",function(){return E.e}),n.d(t,"setParameters",function(){return L}),n.d(t,"withParameters",function(){return R}),n.d(t,"getModifiedParameters",function(){return E.a}),n.d(t,"Buffer",function(){return ze}),n.d(t,"Shader",function(){return nn}),n.d(t,"VertexShader",function(){return rn}),n.d(t,"FragmentShader",function(){return an}),n.d(t,"Program",function(){return zn}),n.d(t,"Framebuffer",function(){return Dt}),n.d(t,"Renderbuffer",function(){return ot}),n.d(t,"Texture2D",function(){return Ye}),n.d(t,"TextureCube",function(){return et}),n.d(t,"clear",function(){return gt}),n.d(t,"clearBuffer",function(){return pt}),n.d(t,"readPixelsToArray",function(){return yt}),n.d(t,"readPixelsToBuffer",function(){return bt}),n.d(t,"copyToDataUrl",function(){return _t}),n.d(t,"copyToImage",function(){return xt}),n.d(t,"copyToTexture",function(){return wt}),n.d(t,"blit",function(){return Pt}),n.d(t,"Query",function(){return Bn}),n.d(t,"Texture3D",function(){return nt}),n.d(t,"TransformFeedback",function(){return Un}),n.d(t,"VertexArrayObject",function(){return Hn}),n.d(t,"VertexArray",function(){return Zn}),n.d(t,"UniformBufferLayout",function(){return Jn}),n.d(t,"setPathPrefix",function(){return Xe}),n.d(t,"loadFile",function(){return qe}),n.d(t,"loadImage",function(){return Ze}),n.d(t,"_Accessor",function(){return Fe}),n.d(t,"_clearBuffer",function(){return pt}),n.d(t,"Geometry",function(){return ai}),n.d(t,"Material",function(){return oi}),n.d(t,"AmbientLight",function(){return di}),n.d(t,"DirectionalLight",function(){return vi}),n.d(t,"PointLight",function(){return gi}),n.d(t,"AnimationLoop",function(){return mi}),n.d(t,"encodePickingColor",function(){return bi}),n.d(t,"decodePickingColor",function(){return _i}),n.d(t,"getNullPickingColor",function(){return xi}),n.d(t,"Model",function(){return Fi}),n.d(t,"Transform",function(){return Wi}),n.d(t,"ClipSpace",function(){return qi}),n.d(t,"_ShaderCache",function(){return Zi}),n.d(t,"_AnimationLoopProxy",function(){return Yi}),n.d(t,"_MultiPassRenderer",function(){return $i}),n.d(t,"_RenderState",function(){return Ji}),n.d(t,"_Pass",function(){return Qi}),n.d(t,"_CompositePass",function(){return Ki}),n.d(t,"_ClearPass",function(){return er}),n.d(t,"_RenderPass",function(){return tr}),n.d(t,"_CopyPass",function(){return ir}),n.d(t,"_TexturePass",function(){return ar}),n.d(t,"_ShaderModulePass",function(){return ur}),n.d(t,"ConeGeometry",function(){return gr}),n.d(t,"CubeGeometry",function(){return xr}),n.d(t,"CylinderGeometry",function(){return wr}),n.d(t,"IcoSphereGeometry",function(){return kr}),n.d(t,"PlaneGeometry",function(){return Sr}),n.d(t,"SphereGeometry",function(){return jr}),n.d(t,"TruncatedConeGeometry",function(){return vr}),n.d(t,"PhongMaterial",function(){return Er}),n.d(t,"PBRMaterial",function(){return Ar}),n.d(t,"ScenegraphNode",function(){return Mr}),n.d(t,"GroupNode",function(){return Lr}),n.d(t,"ModelNode",function(){return Ir}),n.d(t,"CameraNode",function(){return Fr}),n.d(t,"registerShaderModules",function(){return ki.u}),n.d(t,"setDefaultShaderModules",function(){return ki.v}),n.d(t,"assembleShaders",function(){return ki.c}),n.d(t,"createShaderHook",function(){return ki.g}),n.d(t,"createModuleInjection",function(){return ki.f}),n.d(t,"combineInjects",function(){return ki.d}),n.d(t,"normalizeShaderModule",function(){return ki.p}),n.d(t,"fp32",function(){return ki.j}),n.d(t,"fp64",function(){return ki.k}),n.d(t,"project",function(){return ki.t}),n.d(t,"lights",function(){return ki.o}),n.d(t,"dirlight",function(){return ki.i}),n.d(t,"picking",function(){return ki.s}),n.d(t,"diffuse",function(){return ki.h}),n.d(t,"gouraudlighting",function(){return ki.n}),n.d(t,"phonglighting",function(){return ki.r}),n.d(t,"pbr",function(){return ki.q}),n.d(t,"_transform",function(){return ki.b}),n.d(t,"MODULAR_SHADERS",function(){return ki.a}),n.d(t,"getQualifierDetails",function(){return ki.m}),n.d(t,"getPassthroughFS",function(){return ki.l}),n.d(t,"typeToChannelSuffix",function(){return ki.x}),n.d(t,"typeToChannelCount",function(){return ki.w}),n.d(t,"convertToVec4",function(){return ki.e}),n.d(t,"log",function(){return k}),n.d(t,"assert",function(){return Z}),n.d(t,"uid",function(){return Q}),n.d(t,"self",function(){return o.c}),n.d(t,"window",function(){return o.d}),n.d(t,"global",function(){return o.b}),n.d(t,"document",function(){return o.a})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var f={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(e){return"string"==typeof e?f[e.toUpperCase()]||f.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(58),g={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!1,priority:0};function m(){}var y={};var b=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(166)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var f=new Image;return f.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(f,i,o)))},f.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=h(a),r="[".concat(a,"m").concat(r,"")),o&&(a=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();b.VERSION=u.a;t.a=new b({id:"deck"}).enable()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){e.exports=n(180)},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"c",function(){return a});var i=1e-6,r="undefined"!=typeof Float32Array?Float32Array:Array,a=Math.random;Math.PI},function(e,t,n){n(5);var i=n(176);function r(t,n,a){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=r=Reflect.get:e.exports=r=function(e,t,n){var r=i(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}},r(t,n,a||t)}e.exports=r},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return g}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return b});var i=n(16);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],g=t[13],p=t[14],m=t[15],y=n*s-i*o,b=n*u-r*o,_=n*c-a*o,x=i*u-r*s,w=i*c-a*s,P=r*c-a*u,O=l*g-f*v,k=l*p-h*v,S=l*m-d*v,j=f*p-h*g,C=f*m-d*g,E=h*m-d*p,A=y*E-b*C+_*j+x*S-w*k+P*O;return A?(A=1/A,e[0]=(s*E-u*C+c*j)*A,e[1]=(r*C-i*E-a*j)*A,e[2]=(g*P-p*w+m*x)*A,e[3]=(h*w-f*P-d*x)*A,e[4]=(u*S-o*E-c*k)*A,e[5]=(n*E-r*S+a*k)*A,e[6]=(p*_-v*P-m*b)*A,e[7]=(l*P-h*_+d*b)*A,e[8]=(o*C-s*S+c*O)*A,e[9]=(i*S-n*C-a*O)*A,e[10]=(v*w-g*_+m*y)*A,e[11]=(f*_-l*w-d*y)*A,e[12]=(s*k-o*j-u*O)*A,e[13]=(n*j-i*k+r*O)*A,e[14]=(g*b-v*x-p*y)*A,e[15]=(l*x-f*b+h*y)*A,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],v=e[13],g=e[14],p=e[15];return(t*o-n*a)*(f*p-h*g)-(t*s-i*a)*(l*p-h*v)+(t*u-r*a)*(l*g-f*v)+(n*s-i*o)*(c*p-h*d)-(n*u-r*o)*(c*g-f*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],g=t[12],p=t[13],m=t[14],y=t[15],b=n[0],_=n[1],x=n[2],w=n[3];return e[0]=b*i+_*s+x*f+w*g,e[1]=b*r+_*u+x*h+w*p,e[2]=b*a+_*c+x*d+w*m,e[3]=b*o+_*l+x*v+w*y,b=n[4],_=n[5],x=n[6],w=n[7],e[4]=b*i+_*s+x*f+w*g,e[5]=b*r+_*u+x*h+w*p,e[6]=b*a+_*c+x*d+w*m,e[7]=b*o+_*l+x*v+w*y,b=n[8],_=n[9],x=n[10],w=n[11],e[8]=b*i+_*s+x*f+w*g,e[9]=b*r+_*u+x*h+w*p,e[10]=b*a+_*c+x*d+w*m,e[11]=b*o+_*l+x*v+w*y,b=n[12],_=n[13],x=n[14],w=n[15],e[12]=b*i+_*s+x*f+w*g,e[13]=b*r+_*u+x*h+w*p,e[14]=b*a+_*c+x*d+w*m,e[15]=b*o+_*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,f,h,d,v,g=n[0],p=n[1],m=n[2];return t===e?(e[12]=t[0]*g+t[4]*p+t[8]*m+t[12],e[13]=t[1]*g+t[5]*p+t[9]*m+t[13],e[14]=t[2]*g+t[6]*p+t[10]*m+t[14],e[15]=t[3]*g+t[7]*p+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=v,e[12]=i*g+s*p+f*m+t[12],e[13]=r*g+u*p+h*m+t[13],e[14]=a*g+c*p+d*m+t[14],e[15]=o*g+l*p+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,f,h,d,v,g,p,m,y,b,_,x,w,P,O,k,S,j,C,E=r[0],A=r[1],T=r[2],M=Math.sqrt(E*E+A*A+T*T);return M0&&void 0!==arguments[0]?arguments[0]:l;return e.viewport?Object(c.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]},h={name:"project32",dependencies:[f],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"},d=n(84),v=a.fp64.fp64ify,g=a.fp64.fp64ifyMatrix4,p={name:"project64",dependencies:[f,a.fp64],vs:"\nconst vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);\n\nuniform vec2 project64_uScale;\nuniform vec2 project_uViewProjectionMatrixFP64[16];\nvoid mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) {\n\n#if defined(NVIDIA_FP64_WORKAROUND)\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64 * ONE);\n#else\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64);\n#endif\n out_val[1] = sub_fp64(PI_FP64,\n log_fp64(tan_fp64(sum_fp64(PI_4_FP64, radians_fp64(lnglat_fp64.zw) / 2.0))));\n return;\n}\n\nvoid project_position_fp64(vec4 position_fp64, out vec2 out_val[2]) {\n vec2 pos_fp64[2];\n mercatorProject_fp64(position_fp64, pos_fp64);\n vec2 x_fp64 = mul_fp64(pos_fp64[0], project64_uScale);\n vec2 y_fp64 = mul_fp64(pos_fp64[1], project64_uScale);\n out_val[0] = mul_fp64(x_fp64, WORLD_SCALE_FP64);\n out_val[1] = mul_fp64(y_fp64, WORLD_SCALE_FP64);\n\n return;\n}\n\nvoid project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val[2]) {\n vec4 position64xy = vec4(\n position.x, position64xyLow.x,\n position.y, position64xyLow.y);\n\n project_position_fp64(position64xy, out_val);\n}\n\nvec4 project_common_position_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n vec2 vertex_pos_clipspace[4];\n mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace,\n vertex_pos_clipspace);\n return vec4(\n vertex_pos_clipspace[0].x,\n vertex_pos_clipspace[1].x,\n vertex_pos_clipspace[2].x,\n vertex_pos_clipspace[3].x\n );\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec2 offset64[4];\n vec4_fp64(vec4(offset, 0.0), offset64);\n\n float z = project_size(position.z);\n vec2 projectedPosition64xy[2];\n project_position_fp64(position.xy, position64xyLow, projectedPosition64xy);\n\n vec2 commonPosition64[4];\n commonPosition64[0] = sum_fp64(offset64[0], projectedPosition64xy[0]);\n commonPosition64[1] = sum_fp64(offset64[1], projectedPosition64xy[1]);\n commonPosition64[2] = sum_fp64(offset64[2], vec2(z, 0.0));\n commonPosition64[3] = vec2(1.0, 0.0);\n\n commonPosition = vec4(projectedPosition64xy[0].x, projectedPosition64xy[1].x, z, 1.0);\n\n return project_common_position_to_clipspace_fp64(commonPosition64);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(\n position, position64xyLow, offset, commonPosition\n );\n}\nvec4 project_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n return project_common_position_to_clipspace_fp64(vertex_pos_modelspace);\n}\n",getUniforms:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return m({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},m=Object(d.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=g(t),r=v(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}});if(i.a.deck&&"7.1.10"!==i.a.deck.VERSION)throw new Error("deck.gl - multiple versions detected: ".concat(i.a.deck.VERSION," vs ").concat("7.1.10"));i.a.deck||(r.a.log(0,"deck.gl ".concat("7.1.10"," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),i.a.deck=i.a.deck||{VERSION:"7.1.10",version:"7.1.10",log:r.a},Object(a.registerShaderModules)([a.fp32,a.fp64,f,h,p,a.gouraudlighting,a.phonglighting,a.picking]),Object(a.setDefaultShaderModules)([f]));var y=n(26),b=n(92),_=n(2),x=n.n(_),w=n(3),P=n.n(w),O=n(7),k=n.n(O),S=n(5),j=n.n(S),C=n(8),E=n.n(C),A=n(95),T=function(e){function t(e){var n;return x()(this,t),(n=k()(this,j()(t).call(this,e))).projectedLight=new a.PointLight(e),n}return E()(t,e),P()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=Object(A.b)(this.position,{viewport:n,coordinateSystem:r,coordinateOrigin:a,fromCoordinateSystem:n.isGeospatial?y.a.LNGLAT:y.a.IDENTITY,fromCoordinateOrigin:[0,0,0]});return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=o,this.projectedLight}}]),t}(a.PointLight),M=n(93),L=function(e){function t(){return x()(this,t),k()(this,j()(t).apply(this,arguments))}return E()(t,e),P()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=i.modelMatrix,s=Object(c.b)({viewport:n,modelMatrix:o,coordinateSystem:r,coordinateOrigin:a}).project_uCameraPosition;return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=s,this.projectedLight}}]),t}(T),I=n(149),F=n.n(I),R=Math.PI/180,N=864e5,D=2440588,z=2451545,B=23.4397*R,U=357.5291,V=.98560028,G=280.147,W=360.9856235;function H(e,t,n){var i,r,a,o,s,u,c=R*-n,l=R*t,f=function(e){return function(e){return e/N-.5+D}(e)-z}(e),h=(i=R*(U+V*f),r=R*(1.9148*Math.sin(i)+.02*Math.sin(2*i)+3e-4*Math.sin(3*i)),a=i+r+102.9372*R+Math.PI,{declination:(o=a,s=0,u=o,Math.asin(Math.sin(s)*Math.cos(B)+Math.cos(s)*Math.sin(B)*Math.sin(u))),rightAscension:X(a,0)}),d=function(e,t){return R*(G+W*e)-t}(f,c)-h.rightAscension;return{azimuth:q(d,l,h.declination),altitude:Z(d,l,h.declination)}}function X(e,t){var n=e;return Math.atan2(Math.sin(n)*Math.cos(B)-Math.tan(t)*Math.sin(B),Math.cos(n))}function q(e,t,n){var i=e,r=t,a=n;return Math.atan2(Math.sin(i),Math.cos(i)*Math.sin(r)-Math.tan(a)*Math.cos(r))}function Z(e,t,n){var i=e,r=t,a=n;return Math.asin(Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos(i))}var Y=function(e){function t(e){var n,i=e.timestamp,r=F()(e,["timestamp"]);return x()(this,t),(n=k()(this,j()(t).call(this,r))).timestamp=i,n}return E()(t,e),P()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer.context.viewport,n=t.latitude,i=t.longitude;return this.direction=function(e,t,n){var i=H(e,t,n),r=i.azimuth,a=i.altitude,o=r+Math.PI;return[-Math.sin(o),-Math.cos(o),-Math.sin(a)]}(this.timestamp,n,i),this}}]),t}(a.DirectionalLight),Q=n(94),K=n(77),J=n(127),$=n(103),ee=n(106),te=n(79),ne=n(126),ie=n(111),re=n(33),ae=n(102),oe=n(37),se=n(101),ue=n(137),ce=n(132),le=n(47),fe=n(125);var he=function(e){function t(){return x()(this,t),k()(this,j()(t).apply(this,arguments))}return E()(t,e),P()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.bearing,i=t.pitch,r=t.position,a=t.up,o=50*t.zoom,s=function(e){var t=e.bearing,n=e.pitch;return new ce.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:n,pitch:i}).scale(-o).multiply(new le.a(1,1,-1)),u=(new fe.a).multiplyRight((new fe.a).lookAt({eye:s,center:r,up:a}));return new re.a(Object.assign({},e,{id:this.id,zoom:null,viewMatrix:u}))}}]),t}(oe.a);he.displayName="ThirdPersonView";var de=n(138),ve=n(18),ge=Math.PI/180,pe=function(e){function t(){return x()(this,t),k()(this,j()(t).apply(this,arguments))}return E()(t,e),P()(t,[{key:"_getViewport",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.viewState,o=a.eye,s=a.lookAt,u=void 0===s?[0,0,0]:s,c=a.up,l=void 0===c?[0,1,0]:c,f=e.fovy||a.fovy||75,h=e.near||a.near||1,d=e.far||a.far||100,v=Number.isFinite(a.aspect)?a.aspect:i/r,g=f*ge;return new re.a({id:this.id,x:t,y:n,width:i,height:r,viewMatrix:ve.f([],o,u,l),projectionMatrix:ve.i([],g,v,h,d)})}}]),t}(oe.a);pe.displayName="PerspectiveView";var me=n(139),ye=n(57),be=n(109),_e=n(104),xe=n(78),we=n(105),Pe=n(67),Oe=n(56),ke=n(55),Se=n(117),je=n(22),Ce=n(38),Ee=n(28),Ae=n(35),Te=.01,Me=["longitude","latitude","zoom"];var Le=["bearing","pitch"],Ie=function(e){function t(){return x()(this,t),k()(this,j()(t).call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]}))}return E()(t,e),P()(t,[{key:"interpolateProps",value:function(e,t,n){for(var i=function(e,t,n){var i={},r=e.zoom,a=[e.longitude,e.latitude],o=Object(Ee.l)(r),s=t.zoom,u=[t.longitude,t.latitude],c=Object(Ee.l)(s-r),l=Object(Ee.g)(a,o),f=Object(Ee.g)(u,o),h=Ae.g([],f,l),d=Math.max(e.width,e.height),v=d/c,g=Ae.c(h);if(Math.abs(g)0&&void 0!==arguments[0]?arguments[0]:{}).overAlloc,n=void 0===t?1:t;x()(this,e),this.overAlloc=n}return P()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=n.type,a=n.copy,o=void 0!==a&&a,s=t*i;if(e&&s<=e.length)return e;var u=Math.max(Math.ceil(s*this.overAlloc),1),c=this._allocate(r,u);return e&&o&&c.set(e),this._release(e),c}},{key:"_allocate",value:function(){return new(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Float32Array)(arguments.length>1?arguments[1]:void 0)}},{key:"_release",value:function(e){}}]),e}(),De=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};x()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=new Ne,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return P()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64;this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(Re.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null};function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var l="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",f="".concat(l,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),h={ONE:1};var d={name:"fp64",vs:f,fs:null,fp64ify:c,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var i=0;i<4;++i){var r=4*n+i;c(e[4*i+n],t,2*r)}return t},getUniforms:function(){return Object.assign({},h)}},v=("".concat(l),n(125)),g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p={modelMatrix:g,viewMatrix:g,projectionMatrix:g,cameraPositionWorld:[0,0,0]};var m="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",y={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new v.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(m,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(m)},b="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",_={name:"lights",vs:b,fs:b,getUniforms:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,r=n.pointLights,a=n.directionalLights,o=i||r&&r.length>0||a&&a.length>0;return o?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,a=void 0===r?[]:r,o={};o["lighting_uAmbientLight.color"]=t?w(t):[0,0,0];return i.forEach(function(e,t){o["lighting_uPointLight[".concat(t,"].color")]=w(e),o["lighting_uPointLight[".concat(t,"].position")]=e.position,o["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),o.lighting_uPointLightCount=i.length,a.forEach(function(e,t){o["lighting_uDirectionalLight[".concat(t,"].color")]=w(e),o["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),o.lighting_uDirectionalLightCount=a.length,o}({ambientLight:i,pointLights:r,directionalLights:a}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var s={pointLights:[],directionalLights:[]},u=!0,c=!1,l=void 0;try{for(var f,h=(t.lights||[])[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;switch(d.type){case"ambient":s.ambientLight=d;break;case"directional":s.directionalLights.push(d);break;case"point":s.pointLights.push(d)}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return e({lightSources:s})}return{}},defines:{MAX_LIGHTS:3}},x={};function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}var P={lightDirection:new Float32Array([1,1,2])};var O={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[y]},k={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};var S={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}},j={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var C={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},E="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",A={name:"gouraud-lighting",dependencies:[_],vs:E,defines:{LIGHTING_VERTEX:1},getUniforms:L},T={name:"phong-lighting",dependencies:[_],fs:E,defines:{LIGHTING_FRAGMENT:1},getUniforms:L},M={};function L(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor,t}(t):{lighting_uEnabled:!1}}var I="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",F={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[{name:"project2",vs:I,fs:I},_]},R=n(136);n.d(t,"a",function(){return N}),n.d(t,"u",function(){return i.b}),n.d(t,"v",function(){return i.d}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.a}),n.d(t,"p",function(){return o.a}),n.d(t,"m",function(){return s.c}),n.d(t,"l",function(){return s.b}),n.d(t,"x",function(){return s.e}),n.d(t,"w",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u}),n.d(t,"k",function(){return d}),n.d(t,"t",function(){return y}),n.d(t,"o",function(){return _}),n.d(t,"i",function(){return O}),n.d(t,"s",function(){return S}),n.d(t,"h",function(){return C}),n.d(t,"n",function(){return A}),n.d(t,"r",function(){return T}),n.d(t,"q",function(){return F}),n.d(t,"b",function(){return R.a});var N={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",defaultUniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r});var i={LNGLAT:1,LNGLAT_DEPRECATED:5,METER_OFFSETS:2,METERS:2,LNGLAT_OFFSETS:3,IDENTITY:0},r={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},function(e,t,n){"use strict";function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"l",function(){return p}),n.d(t,"i",function(){return m}),n.d(t,"g",function(){return y}),n.d(t,"j",function(){return b}),n.d(t,"c",function(){return _}),n.d(t,"b",function(){return x}),n.d(t,"a",function(){return w}),n.d(t,"f",function(){return P}),n.d(t,"e",function(){return O}),n.d(t,"d",function(){return k}),n.d(t,"k",function(){return S}),n.d(t,"h",function(){return j});var i=n(21),r=n(38),a=n(18),o=n(35),s=n(40),u=n(60),c=Math.PI,l=c/4,f=c/180,h=180/c,d=512,v=4003e4,g=1.5;function p(e){return Math.pow(2,e)}function m(e){return Math.log2(e)}function y(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1];Object(u.a)(Number.isFinite(r)&&Number.isFinite(t)),Object(u.a)(Number.isFinite(a)&&a>=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function P(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.d([],c)),d}function O(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function k(e){var t=e.width,n=e.height,i=e.pitch,r=O({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function S(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){e.exports=n(178)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";(function(e){n.d(t,"c",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},r=i.self||i.window||i.global,a=i.window||i.self||i.global,o=i.global||i.self||i.window,s=i.document||{}}).call(this,n(53))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=i=function(e){return n(e)}:e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},i(t)}e.exports=i},function(e,t,n){"use strict";var i=n(19),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(13),l=(n(39),n(14));var f=n(22),h=n(125),d=n(47),v=n(18),g=n(28);n.d(t,"a",function(){return b});var p=Math.PI/180,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=[0,0,0],b=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(86),v=n(14);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,P=t.modelMatrix,O=void 0===P?null:P,k=t.viewportInstance,S=void 0===k?null:k,j=t.type,C=void 0===j?c.a:j;Object(v.a)(!S||S instanceof c.a),this.viewportInstance=S,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:O}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(39);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.c([],t,e);return i.b(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return o});var i=n(16);function r(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function a(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function o(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}var s,u;s=new i.a(4),i.a!=Float32Array&&(s[0]=0,s[1]=0,s[2]=0,s[3]=0),u=s},function(e,t,n){"use strict";n.d(t,"c",function(){return r}),n.d(t,"d",function(){return o}),n.d(t,"b",function(){return u}),n.d(t,"i",function(){return c}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"a",function(){return d}),n.d(t,"h",function(){return p});var i=n(16);function r(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function a(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function o(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function s(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function u(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function c(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function l(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function f(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t){var n=a(e[0],e[1],e[2]),i=a(t[0],t[1],t[2]);s(n,n),s(i,i);var r=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var v,g,p=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e};v=new i.a(3),i.a!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0),g=v},function(e,t,n){e.exports=n(164)},function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return v}),n.d(t,"c",function(){return p});var i,r,a,o=n(24),s=n(0),u=n(45),c=(i={},Object(s.a)(i,3042,!1),Object(s.a)(i,32773,new Float32Array([0,0,0,0])),Object(s.a)(i,32777,32774),Object(s.a)(i,34877,32774),Object(s.a)(i,32969,1),Object(s.a)(i,32968,0),Object(s.a)(i,32971,1),Object(s.a)(i,32970,0),Object(s.a)(i,3106,new Float32Array([0,0,0,0])),Object(s.a)(i,3107,[!0,!0,!0,!0]),Object(s.a)(i,2884,!1),Object(s.a)(i,2885,1029),Object(s.a)(i,2929,!1),Object(s.a)(i,2931,1),Object(s.a)(i,2932,513),Object(s.a)(i,2928,new Float32Array([0,1])),Object(s.a)(i,2930,!0),Object(s.a)(i,3024,!0),Object(s.a)(i,36006,null),Object(s.a)(i,2886,2305),Object(s.a)(i,33170,4352),Object(s.a)(i,2849,1),Object(s.a)(i,32823,!1),Object(s.a)(i,32824,0),Object(s.a)(i,10752,0),Object(s.a)(i,32938,1),Object(s.a)(i,32939,!1),Object(s.a)(i,3089,!1),Object(s.a)(i,3088,new Int32Array([0,0,1024,1024])),Object(s.a)(i,2960,!1),Object(s.a)(i,2961,0),Object(s.a)(i,2968,4294967295),Object(s.a)(i,36005,4294967295),Object(s.a)(i,2962,519),Object(s.a)(i,2967,0),Object(s.a)(i,2963,4294967295),Object(s.a)(i,34816,519),Object(s.a)(i,36003,0),Object(s.a)(i,36004,4294967295),Object(s.a)(i,2964,7680),Object(s.a)(i,2965,7680),Object(s.a)(i,2966,7680),Object(s.a)(i,34817,7680),Object(s.a)(i,34818,7680),Object(s.a)(i,34819,7680),Object(s.a)(i,2978,new Int32Array([0,0,1024,1024])),Object(s.a)(i,3333,4),Object(s.a)(i,3317,4),Object(s.a)(i,37440,!1),Object(s.a)(i,37441,!1),Object(s.a)(i,37443,37444),Object(s.a)(i,35723,4352),Object(s.a)(i,36010,null),Object(s.a)(i,35977,!1),Object(s.a)(i,3330,0),Object(s.a)(i,3332,0),Object(s.a)(i,3331,0),Object(s.a)(i,3314,0),Object(s.a)(i,32878,0),Object(s.a)(i,3316,0),Object(s.a)(i,3315,0),Object(s.a)(i,32877,0),i),l=function(e,t,n){return t?e.enable(n):e.disable(n)},f=function(e,t,n){return e.hint(n,t)},h=function(e,t,n){return e.pixelStorei(n,t)},d=(r={},Object(s.a)(r,3042,l),Object(s.a)(r,32773,function(e,t){return e.blendColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,32777,"blendEquation"),Object(s.a)(r,34877,"blendEquation"),Object(s.a)(r,32969,"blendFunc"),Object(s.a)(r,32968,"blendFunc"),Object(s.a)(r,32971,"blendFunc"),Object(s.a)(r,32970,"blendFunc"),Object(s.a)(r,3106,function(e,t){return e.clearColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,3107,function(e,t){return e.colorMask.apply(e,Object(o.a)(t))}),Object(s.a)(r,2884,l),Object(s.a)(r,2885,function(e,t){return e.cullFace(t)}),Object(s.a)(r,2929,l),Object(s.a)(r,2931,function(e,t){return e.clearDepth(t)}),Object(s.a)(r,2932,function(e,t){return e.depthFunc(t)}),Object(s.a)(r,2928,function(e,t){return e.depthRange.apply(e,Object(o.a)(t))}),Object(s.a)(r,2930,function(e,t){return e.depthMask(t)}),Object(s.a)(r,3024,l),Object(s.a)(r,35723,f),Object(s.a)(r,36006,function(e,t){var n=Object(u.c)(e)?36009:36160;return e.bindFramebuffer(n,t)}),Object(s.a)(r,2886,function(e,t){return e.frontFace(t)}),Object(s.a)(r,33170,f),Object(s.a)(r,2849,function(e,t){return e.lineWidth(t)}),Object(s.a)(r,32823,l),Object(s.a)(r,32824,"polygonOffset"),Object(s.a)(r,10752,"polygonOffset"),Object(s.a)(r,35977,l),Object(s.a)(r,32938,"sampleCoverage"),Object(s.a)(r,32939,"sampleCoverage"),Object(s.a)(r,3089,l),Object(s.a)(r,3088,function(e,t){return e.scissor.apply(e,Object(o.a)(t))}),Object(s.a)(r,2960,l),Object(s.a)(r,2961,function(e,t){return e.clearStencil(t)}),Object(s.a)(r,2968,function(e,t){return e.stencilMaskSeparate(1028,t)}),Object(s.a)(r,36005,function(e,t){return e.stencilMaskSeparate(1029,t)}),Object(s.a)(r,2962,"stencilFuncFront"),Object(s.a)(r,2967,"stencilFuncFront"),Object(s.a)(r,2963,"stencilFuncFront"),Object(s.a)(r,34816,"stencilFuncBack"),Object(s.a)(r,36003,"stencilFuncBack"),Object(s.a)(r,36004,"stencilFuncBack"),Object(s.a)(r,2964,"stencilOpFront"),Object(s.a)(r,2965,"stencilOpFront"),Object(s.a)(r,2966,"stencilOpFront"),Object(s.a)(r,34817,"stencilOpBack"),Object(s.a)(r,34818,"stencilOpBack"),Object(s.a)(r,34819,"stencilOpBack"),Object(s.a)(r,2978,function(e,t){return e.viewport.apply(e,Object(o.a)(t))}),Object(s.a)(r,3333,h),Object(s.a)(r,3317,h),Object(s.a)(r,37440,h),Object(s.a)(r,37441,h),Object(s.a)(r,37443,h),Object(s.a)(r,3330,h),Object(s.a)(r,3332,h),Object(s.a)(r,3331,h),Object(s.a)(r,36010,function(e,t){return e.bindFramebuffer(36008,t)}),Object(s.a)(r,3314,h),Object(s.a)(r,32878,h),Object(s.a)(r,3316,h),Object(s.a)(r,3315,h),Object(s.a)(r,32877,h),r),v={blendEquation:function(e,t){return e.blendEquationSeparate(t[32777],t[34877])},blendFunc:function(e,t){return e.blendFuncSeparate(t[32969],t[32968],t[32971],t[32970])},polygonOffset:function(e,t){return e.polygonOffset(t[32824],t[10752])},sampleCoverage:function(e,t){return e.sampleCoverage(t[32938],t[32939])},stencilFuncFront:function(e,t){return e.stencilFuncSeparate(1028,t[2962],t[2967],t[2963])},stencilFuncBack:function(e,t){return e.stencilFuncSeparate(1029,t[34816],t[36003],t[36004])},stencilOpFront:function(e,t){return e.stencilOpSeparate(1028,t[2964],t[2965],t[2966])},stencilOpBack:function(e,t){return e.stencilOpSeparate(1029,t[34817],t[34818],t[34819])}},g=function(e,t){return e.isEnabled(t)},p=(a={},Object(s.a)(a,3042,g),Object(s.a)(a,2884,g),Object(s.a)(a,2929,g),Object(s.a)(a,3024,g),Object(s.a)(a,32823,g),Object(s.a)(a,32926,g),Object(s.a)(a,32928,g),Object(s.a)(a,3089,g),Object(s.a)(a,2960,g),Object(s.a)(a,35977,g),a)},function(t,n){t.exports=e},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(23),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(53),n(49))},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n(100);function r(e){for(var t in e)return!1;return!0}function a(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"c",function(){return a}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(119),r=n.n(i),a=n(30),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(6),a=n(11),o=n(10),s=n(12),u=n(82),c=n(22),l=n(40),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.b(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.e(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.f(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.g(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&u0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&(M(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&M(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new _.Texture2D(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:A})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(_.readPixelsToBuffer)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:A}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(x.a)(e.url).then(function(r){var a=T(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},A,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),I=_.fp64.fp64LowPart,F=[0,0,0,255],R={iconAtlas:null,iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},fp64:!1,billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:F},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},N=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0)); \n gl_Position.xy += project_pixel_size_to_clipspace(pixelOffset);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common); \n }\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors / 255.;\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","picking"]}}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new L(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:4,type:5121,transition:!0,accessor:"getColor",defaultValue:F},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),i.fp64!==n.fp64){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new _.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new _.Geometry({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(S.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=I(p[0]),a[o++]=I(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(S.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(S.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(S.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(b.a);N.layerName="IconLayer",N.defaultProps=R;var D=n(143),z=_.fp64.fp64LowPart,B=[0,0,0,255],U=[0,0,1],V=new _.PhongMaterial,G={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},fp64:!1,getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:U},getColor:{type:"accessor",value:B},material:V,radiusPixels:{deprecatedFor:"pointSize"}},W=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n unitPosition = positions.xy;\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), position_commonspace);\n gl_Position.xy += project_pixel_size_to_clipspace(positions.xy * radiusPixels);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, position_commonspace.xyz, project_normal(instanceNormals));\n vColor = vec4(lightColor, instanceColors.a * opacity) / 255.0;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","gouraud-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:U},instanceColors:{size:4,type:5121,transition:!0,accessor:"getColor",defaultValue:B}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new _.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new _.Geometry({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(S.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var b=s(y,h);u[c++]=z(b[0]),u[c++]=z(b[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(b.a);W.layerName="PointCloudLayer",W.defaultProps=G;var H=n(108),X=n(107),q=n(140),Z=n(71),Y=n(141),Q=n(144),K=n(13),J=n(126),$=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0)); \n gl_Position.xy += project_pixel_size_to_clipspace(pixelOffset);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common); \n }\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getLengthOfQueue,f=r.getShiftInQueue,h=e.value,d=n*e.size,v=Object(S.a)(a,n,i).iterable,g=!0,p=!1,m=void 0;try{for(var y,b=v[Symbol.iterator]();!(g=(y=b.next()).done);g=!0){var _=y.value,x=o[s(_)]||{},w=l(_),P=f(_);h[d++]=(u(_)-1)*w/2+x.width/2+P||0,h[d++]=x.height/2*c(_)||0}}catch(e){p=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(p)throw m}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(S.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(N);$.layerName="MultiIconLayer",$.defaultProps={getShiftInQueue:{type:"accessor",value:function(e){return e.shift||0}},getLengthOfQueue:{type:"accessor",value:function(e){return e.len||1}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ee=n(155),te=n.n(ee);var ne=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ie=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),re="Monaco, monospace",ae="normal",oe=64,se=2,ue=.25,ce=3,le=new ne(3),fe=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function he(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};fe.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=le.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=le.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),le.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");de(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(de(h,r,o,a),u){var b=new te.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,P=void 0;try{for(var O,k=t[Symbol.iterator]();!(x=(O=k.next()).done);x=!0){var S=O.value;he(b.draw(S),_),h.putImageData(_,v[S].x-s,v[S].y-s)}}catch(e){w=!0,P=e}finally{try{x||null==k.return||k.return()}finally{if(w)throw P}}}else{var j=!0,C=!1,E=void 0;try{for(var A,T=t[Symbol.iterator]();!(j=(A=T.next()).done);j=!0){var M=A.value;h.fillText(M,v[M].x,v[M].y+.9*o)}}catch(e){C=!0,E=e}finally{try{j||null==T.return||T.return()}finally{if(C)throw E}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=le.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),ge={fontSize:oe,buffer:se,sdf:!1,radius:ce,cutoff:ue},pe={start:1,middle:0,end:-1},me={top:1,center:0,bottom:-1},ye=["fontSize","buffer","sdf","radius","cutoff"],be={fp64:!1,billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ie,fontFamily:re,fontWeight:ae,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},_e=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new ve(this.context.gl)}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps,i=e.changeFlags,r=this.fontChanged(n,t);r&&this.updateFontAtlas({oldProps:n,props:t}),(i.dataChanged||r||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getText))&&this.transformStringToLetters()}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},ge,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return ye.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this.props,t=e.data,n=e.getText,i=this.state.iconMapping,r=[],a=Object(S.a)(t),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=function(){var e=f.value;s.index++;var t=n(e,s);if(t){var a=Array.from(t),o=[0],u=0;a.forEach(function(n,a){var c={text:n,index:a,offsets:o,len:t.length,object:e,objectIndex:s.index},l=i[n];l?u+=l.width:(K.a.warn("Missing character: ".concat(n))(),u+=32),o.push(u),r.push(c)})}},d=o[Symbol.iterator]();!(u=(f=d.next()).done);u=!0)h()}catch(e){c=!0,l=e}finally{try{u||null==d.return||d.return()}finally{if(c)throw l}}this.setState({data:r})}},{key:"getLetterOffset",value:function(e){return e.offsets[e.index]}},{key:"getTextLength",value:function(e){return e.offsets[e.offsets.length-1]}},{key:"_getAccessor",value:function(e){return"function"==typeof e?function(t){return e(t.object)}:e}},{key:"getAnchorXFromTextAnchor",value:function(e){return function(t){var n="function"==typeof e?e(t.object):e;if(!pe.hasOwnProperty(n))throw new Error("Invalid text anchor parameter: ".concat(n));return pe[n]}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return function(t){var n="function"==typeof e?e(t.object):e;if(!me.hasOwnProperty(n))throw new Error("Invalid alignment baseline parameter: ".concat(n));return me[n]}}},{key:"renderLayers",value:function(){var e=this,t=this.state,n=t.data,i=t.scale,r=t.iconAtlas,a=t.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.fp64,g=o.billboard,p=o.sdf,m=o.sizeScale,y=o.sizeUnits,b=o.sizeMinPixels,_=o.sizeMaxPixels,x=o.transitions,w=o.updateTriggers;return new(this.getSubLayerClass("characters",$))({sdf:p,iconAtlas:r,iconMapping:a,getPosition:function(e){return s(e.object)},getColor:this._getAccessor(u),getSize:this._getAccessor(c),getAngle:this._getAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this._getAccessor(d),fp64:v,billboard:g,sizeScale:m*i,sizeUnits:y,sizeMinPixels:b*i,sizeMaxPixels:_*i,transitions:x&&{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:w.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:w.getPosition,getAngle:w.getAngle,getColor:w.getColor,getSize:w.getSize,getPixelOffset:w.getPixelOffset,getAnchorX:w.getTextAnchor,getAnchorY:w.getAlignmentBaseline}}),{data:n,getIcon:function(e){return e.text},getShiftInQueue:function(t){return e.getLetterOffset(t)},getLengthOfQueue:function(t){return e.getTextLength(t)}})}}]),t}(J.a);_e.layerName="TextLayer",_e.defaultProps=be;var xe=n(80);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return O}),n.d(t,"IconLayer",function(){return N}),n.d(t,"LineLayer",function(){return D.a}),n.d(t,"PointCloudLayer",function(){return W}),n.d(t,"ScatterplotLayer",function(){return H.a}),n.d(t,"ColumnLayer",function(){return X.a}),n.d(t,"GridCellLayer",function(){return q.a}),n.d(t,"PathLayer",function(){return Z.a}),n.d(t,"PolygonLayer",function(){return Y.a}),n.d(t,"GeoJsonLayer",function(){return Q.a}),n.d(t,"TextLayer",function(){return _e}),n.d(t,"SolidPolygonLayer",function(){return xe.a}),n.d(t,"_MultiIconLayer",function(){return $})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(117),v=n(22),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(55),u=n(118),c=n(14),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0}})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(56),u=n(13),c=n(14),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,Object.assign({},e.getInteractiveState(),n)),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0})}},{key:"_onPan",value:function(e){var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1})}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e);if(!this.isDragging())return!1;var n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0})}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0})}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l)}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0})}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0})}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1})}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps())}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState;switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut();break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn();break;case 37:t=n?i.rotateLeft():i.moveLeft();break;case 39:t=n?i.rotateRight():i.moveRight();break;case 38:t=n?i.rotateUp():i.moveUp();break;case 40:t=n?i.rotateDown():i.moveDown();break;default:return!1}return this.updateViewport(t,this._getTransitionProps())}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(63),r=n(51);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"b",function(){return g});var i=n(4),r=n(6),a=n(128),o=n(42),s=n(50),u=n(45),c=function(e,t){var n=Array.isArray(e)||ArrayBuffer.isView(e),i=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&i&&e.length===t.length){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),c(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(53))},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(147),r="7.1.10",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},function(e,t,n){"use strict";(function(e){var i=n(23),r=n(146),a=!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||r.a;t.a=a}).call(this,n(49))},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(79),p=n(1),m=n(20).experimental.Tesselator,y=p.fp64.fp64LowPart,b=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3},endPositions:{size:3},leftPositions:{size:3},rightPositions:{size:3},startEndPositions64XyLow:{size:4,fp64Only:!0},neighborPositions64XyLow:{size:4,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){return Math.max(0,this.getPathLength(e)-1)}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.leftPositions,o=n.rightPositions,s=n.startEndPositions64XyLow,u=n.neighborPositions64XyLow,c=this.fp64,l=t.geometrySize+1;if(!(l<2))for(var f,h=this.isClosed(e),d=this.getPointOnPath(e,0),v=this.getPointOnPath(e,1),g=h?this.getPointOnPath(e,l-2):d,p=t.vertexStart,m=1;m 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n";n.d(t,"a",function(){return O});var x=[0,0,0,255],w={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},fp64:!1,dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:x},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},P={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},O=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return this.use64bitProjection()?{vs:"\n#define SHADER_NAME path-layer-vertex-shader-64\n\nattribute vec3 positions;\n\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec4 instanceStartEndPositions64xyLow;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceNeighborPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\n\nvec3 lineJoin(vec2 prevPoint64[2], vec2 currPoint64[2], vec2 nextPoint64[2]) {\n\n float widthPixels = clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0;\n float width = project_pixel_size(widthPixels);\n\n vec2 deltaA64[2];\n vec2 deltaB64[2];\n\n vec2_sub_fp64(currPoint64, prevPoint64, deltaA64);\n vec2_sub_fp64(nextPoint64, currPoint64, deltaB64);\n\n vec2 lengthA64 = vec2_length_fp64(deltaA64);\n vec2 lengthB64 = vec2_length_fp64(deltaB64);\n\n vec2 deltaA = vec2(deltaA64[0].x, deltaA64[1].x);\n vec2 deltaB = vec2(deltaB64[0].x, deltaB64[1].x);\n\n float lenA = lengthA64.x;\n float lenB = lengthB64.x;\n\n vec2 offsetVec;\n float offsetScale;\n float offsetDirection;\n lenA = lenA / width > EPSILON ? lenA : 0.0;\n lenB = lenB / width > EPSILON ? lenB : 0.0;\n vec2 dirA = lenA > 0. ? deltaA / lenA : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? deltaB / lenB : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = mix(perpB, perpA, positions.x);\n float L = mix(lenB, lenA, positions.x);\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n float cornerPosition = mix(\n flipIfTrue(turnsRight == (positions.y > 0.0)),\n 0.0,\n positions.z\n );\n\n offsetScale = 1.0 / max(sinHalfA, EPSILON);\n cornerPosition *= float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) / width * cosHalfA);\n offsetScale = mix(\n offsetScale,\n min(offsetScale, L / width / max(cosHalfA, EPSILON)),\n float(cornerPosition < 0.0)\n );\n\n vMiterLength = mix(\n offsetScale * cornerPosition,\n mix(offsetScale, 0.0, cornerPosition),\n step(0.0, cornerPosition)\n ) - sinHalfA * jointType;\n offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n float isStartCap = step(lenA, 1.0e-5);\n float isEndCap = step(lenB, 1.0e-5);\n float isCap = max(isStartCap, isEndCap);\n cornerPosition = isCap * (1.0 - positions.z);\n offsetVec = mix(offsetVec, mix(dirB, perpB, cornerPosition), isStartCap);\n offsetVec = mix(offsetVec, mix(dirA, perpA, cornerPosition), isEndCap);\n offsetScale = mix(\n offsetScale,\n mix(4.0 * jointType, 1.0, cornerPosition),\n isCap\n );\n vMiterLength = mix(vMiterLength, 1.0 - cornerPosition, isCap);\n\n offsetDirection = mix(\n offsetDirection,\n mix(flipIfTrue(isStartCap > 0.), positions.y, cornerPosition),\n isCap\n );\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L / width;\n float isEnd = positions.x;\n vec2 offsetFromStartOfPath = mix(vCornerOffset, vCornerOffset + deltaA / width, isEnd);\n vec2 dir = mix(dirB, dirA, isEnd);\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n\n return vec3(vCornerOffset * width, 0.0);\n}\n\nvoid main() {\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceStartEndPositions64xyLow.xy, instanceStartEndPositions64xyLow.zw, isEnd);\n vec2 projected_curr_position[2];\n project_position_fp64(currPosition.xy, currPosition64xyLow, projected_curr_position);\n float projected_curr_position_z = project_size(currPosition.z);\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceNeighborPositions64xyLow.xy, instanceStartEndPositions64xyLow.xy, isEnd);\n\n vec2 projected_prev_position[2];\n project_position_fp64(prevPosition.xy, prevPosition64xyLow, projected_prev_position);\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceStartEndPositions64xyLow.zw, instanceNeighborPositions64xyLow.zw, isEnd);\n\n vec2 projected_next_position[2];\n project_position_fp64(nextPosition.xy, nextPosition64xyLow, projected_next_position);\n\n vec3 pos = lineJoin(projected_prev_position, projected_curr_position, projected_next_position);\n vec2 vertex_pos_modelspace[4];\n\n vertex_pos_modelspace[0] = sum_fp64(vec2(pos.x, 0.0), projected_curr_position[0]);\n vertex_pos_modelspace[1] = sum_fp64(vec2(pos.y, 0.0), projected_curr_position[1]);\n vertex_pos_modelspace[2] = vec2(pos.z + projected_curr_position_z, 0.0);\n vertex_pos_modelspace[3] = vec2(1.0, 0.0);\n\n gl_Position = project_common_position_to_clipspace_fp64(vertex_pos_modelspace);\n}\n",fs:_,modules:["project64","picking"]}:{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec4 instanceStartEndPositions64xyLow;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceNeighborPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = step(0.0, -lenA) > 0.5;\n bool isEndCap = step(0.0, -lenB) > 0.5;\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n\n return currPoint + vec3(vCornerOffset * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels)\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceNeighborPositions64xyLow.xy, instanceStartEndPositions64xyLow.xy, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceStartEndPositions64xyLow.xy, instanceStartEndPositions64xyLow.zw, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceStartEndPositions64xyLow.zw, instanceNeighborPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec3 pos = lineJoin(prevPosition, currPosition, nextPosition);\n gl_Position = project_common_position_to_clipspace(vec4(pos, 1.0));\n }\n}\n",fs:_,modules:["project32","picking"]}}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({instanceStartPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0},instanceEndPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0},instanceStartEndPositions64xyLow:{size:4,update:this.calculateInstanceStartEndPositions64xyLow,noAlloc:!0},instanceLeftPositions:{size:3,accessor:"getPath",update:this.calculateLeftPositions,noAlloc:!0},instanceRightPositions:{size:3,accessor:"getPath",update:this.calculateRightPositions,noAlloc:!0},instanceNeighborPositions64xyLow:{size:4,update:this.calculateInstanceNeighborPositions64xyLow,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:P,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:4,type:5121,accessor:"getColor",transition:P,defaultValue:x},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new b({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||i.fp64!==n.fp64||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions()}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),a.invalidateAll()}if(i.fp64!==n.fp64){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new p.Geometry({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateInstanceStartEndPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startEndPositions64XyLow"):new Float32Array(4)}},{key:"calculateLeftPositions",value:function(e){var t=this.state.pathTesselator;e.value=t.get("leftPositions")}},{key:"calculateRightPositions",value:function(e){var t=this.state.pathTesselator;e.value=t.get("rightPositions")}},{key:"calculateInstanceNeighborPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("neighborPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(116),v=n(1),g=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.withParameters)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.withParameters)(e,{scissorTest:!0,scissor:l},function(){return Object(v.clear)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(v.setParameters)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.withParameters)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return P});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(124),v=n(22),g=n(57),p=n(85),m=n(55),y=n(56),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,P=void 0===w?b.minZoom:w,O=e.maxZoom,k=void 0===O?b.maxZoom:O,S=e.startPanPosition,j=e.startTarget,C=e.startRotationX,E=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:P,maxZoom:k})))._interactiveState={startPanPosition:S,startTarget:j,startRotationX:C,startRotationOrbit:E,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c in n)if(!(c in r)){if(!(c in t))return"".concat(u,".").concat(c," dropped");var l=t[c],f=n[c],h=o[c],d=h&&h.equal;if(d&&!d(l,f,h))return"".concat(u,".").concat(c," changed deeply");if(!d&&(d=l&&f&&l.equals)&&!d.call(l,f))return"".concat(u,".").concat(c," changed deeply");if(!d&&f!==l)return"".concat(u,".").concat(c," changed shallowly")}for(var v in t)if(!(v in r||v in n))return"".concat(u,".").concat(v," added: undefined -> ").concat(t[v]);return null}function P(e,t,n){var i=e.updateTriggers[n];i=null==i?{}:i;var r=t.updateTriggers[n];return w({oldProps:r=null==r?{}:r,newProps:i,triggerName:n})}function O(e){var t=e._component,n=t&&t.constructor;return n?n._propTypes:{}}var k=n(120),S=n(13),j=n(1),C=n(95),E=n(65),A={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return I(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return T(e,t)}},accessor:{validate:function(e,t){var n=F(e);return"function"===n||n===F(t.value)},equal:function(e,t,n){return"function"==typeof t||T(e,t)}},array:{validate:function(e,t){return t.optional&&!e||I(e)},equal:function(e,t,n){return n.compare?T(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function T(e,t){if(e===t)return!0;if(!I(e)||!I(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=U,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps={},this.oldProps)this.oldAsyncProps[e]=this.oldProps[e]}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),t=this._postProcessValue(e,t),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){return n._setAsyncPropValue(e,t,r)}).catch(function(e){return S.a.error(e)()})}},{key:"_postProcessValue",value:function(e,t){var n=(this.component?this.component.props:{}).dataTransform;return"data"===e&&n&&(t=n(t)),t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),G=0,W=function(){function e(){o()(this,e),this.props=function(){for(var e=N(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(C.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(X.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(C.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){S.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){S.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitProjection",value:function(){if(this.props.fp64){if(this.props.coordinateSystem===g.a.LNGLAT_DEPRECATED)return!0;S.a.once(0,"Legacy 64-bit mode only works with coordinateSystem set to\n COORDINATE_SYSTEM.LNGLAT_DEPRECATED. Rendering in 32-bit mode instead")()}return!1}},{key:"use64bitPositions",value:function(){return this.props.fp64||this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return S.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();t.dataChanged&&n&&n.invalidateAll()}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(S.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(S.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=this.getModels();if(r.length>0)for(var a=t.getChangedAttributes({clearChangedFlags:!0}),o=0,s=r.length;o2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=b(v),o[2*l+1]=b(g)),s[l]=1,l++}if(h)for(var m=0;m0&&void 0!==arguments[0]?arguments[0]:[];return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}}]),e}(),u=function(){function e(){Object(i.a)(this,e),this.shaderModules={},this.defaultShaderModules=[]}return Object(r.a)(e,[{key:"setDefaultShaderModules",value:function(e){this.defaultShaderModules=this.resolveModules(e)}},{key:"registerShaderModules",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof s)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof s)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new s(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"c",function(){return h}),n.d(t,"a",function(){return d});var c=new u;function l(e){c.setDefaultShaderModules(e)}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;c.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(c.defaultShaderModules),v(e=c.resolveModules(e))}function d(e){return c.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]=0&&e=0&&e0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,t,n){"use strict";(function(e,i){n.d(t,"a",function(){return a});var r=n(123),a="object"!==(void 0===e?"undefined":Object(r.a)(e))||"[object process]"!==String(e)||e.browser;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document}).call(this,n(49),n(53))},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(64),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=n(93),g=n(67),p={color:[255,255,255],intensity:1},m=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],y=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n.applyDefaultLights(),n}return h()(t,e),o()(t,[{key:"getParameters",value:function(e){var t=this.ambientLight,n=this.getProjectedPointLights(e);return{lightSources:{ambientLight:t,directionalLights:this.getProjectedDirectionalLights(e),pointLights:n}}}},{key:"applyDefaultLights",value:function(){var e=this.ambientLight,t=this.pointLights,n=this.directionalLights;e||0!==t.length||0!==n.length||(this.ambientLight=new d.AmbientLight(p),this.directionalLights.push(new v.a(m[0])),this.directionalLights.push(new v.a(m[1])))}},{key:"getProjectedPointLights",value:function(e){for(var t=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.withParameters)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new v.ClipSpace(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(v.clear)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(116).a),p=n(145);n.d(t,"a",function(){return m});var m=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(p.a)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=_(t),a=new g(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=_(t,r),s="".concat(n,"-").concat(a);return new g(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return y(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return b(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(19),r=n.n(i),a=n(26),o=n(83),s=n(39),u=n(40),c=n(28);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.c([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.h(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(4),r=n(6),a=n(11),o=n(10),s=n(12),u=n(27),c=n(21),l=n(38),f=n(28),h=n(18),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(129),p=n(35);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,P=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var O=Object(f.l)(g);x=Math.max(.75,x);var k=Object(f.g)([d,l],O);k[2]=0;var S=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:P||1.01}),j=Object(f.f)({height:s,center:k,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:j,projectionMatrix:S}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=O,e.center=k,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,function(e,t,n){"use strict";(function(e){var t=n(64),i=n(91);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(110);n.d(t,"c",function(){return S}),n.d(t,"b",function(){return j}),n.d(t,"a",function(){return C});var w=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),O={},k="precision highp float;\n\n";function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function j(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);O[e]=O[e]||{},O[e][o]=O[e][o]||{},Object(s.a)(!O[e][o][n],"Module injection already created"),O[e][o][n]={injection:i,order:a}}function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.vs,i=t.fs,r=Object(o.c)(t.modules||[]);return{gl:e,vs:E(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:E(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:A(r),modules:T(r)}}function E(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=void 0===o?[]:o,c=t.defines,l=void 0===c?{}:c,f=t.inject,h=void 0===f?{}:f,v=t.prologue,p=void 0===v||v,b=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var _=r===a.b,S=i.split("\n"),j=100,C="",E=i;0===S[0].indexOf("#version ")&&(j=300,C=S[0],E=S.slice(1).join("\n"));var A={};u.forEach(function(e){Object.assign(A,e.getDefines())}),Object.assign(A,l);var T=p?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(w[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(w[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(A),"\n").concat(_?"":k,"\n"):"".concat(C,"\n"),M=!1,L={},I={};for(var F in h){var R="string"==typeof h[F]?{injection:h[F],order:0}:h[F];F.match(/^(v|f)s:/)?"#"===F[3]?I[F]=[R]:L[F]=[R]:I[F]=[R]}var N=!0,D=!1,z=void 0;try{for(var B,U=u[Symbol.iterator]();!(N=(B=U.next()).done);N=!0){var V=B.value;switch(V.name){case"inject":M=!0;break;default:if(V.checkDeprecations(E,b),T+=V.getModuleSource(r,j),O[V.name]){var G=O[V.name][r];for(var W in G)W.match(/^(v|f)s:#/)?(I[W]=I[W]||[],I[W].push(G[W])):(L[W]=L[W]||[],L[W].push(G[W]))}}}}catch(e){D=!0,z=e}finally{try{N||null==U.return||U.return()}finally{if(D)throw z}}return T+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,L),T+=E,T=Object(x.b)(T,r,I,M)}function A(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function T(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.a)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;var n=Array.isArray(e)||ArrayBuffer.isView(e),i=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&i&&e.length===t.length){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,P=void 0!==w&&w,O=n.width,k=n.height,S=n.altitude,j=void 0===S?1.5:S;O=O||1,k=k||1,j=Math.max(.75,j);var C=Object(y.e)({width:O,height:k,pitch:d,altitude:j,nearZMultiplier:b,farZMultiplier:x}),E=C.fov,A=C.aspect,T=C.focalDistance,M=C.near,L=C.far,I=Object(y.f)({height:k,pitch:d,bearing:g,altitude:j}),F=Object.assign({},n,{width:O,height:k,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:P,fovyRadians:E,aspect:A,orthographicFocalDistance:T,near:M,far:L});return(e=l()(this,h()(t).call(this,F))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=j,e.orthographic=P,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);P.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(119),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(14),l=n(1),f=n(30),h=n.n(f),d=n(79),v=n(65),g=n(13),p=n(52),m=n(187),y=n(33),b=n(46),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l._ShaderCache({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(19),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(7),l=n.n(c),f=n(5),h=n.n(f),d=n(8),v=n.n(d),g=n(57),p=n(85),m=n(22),y=n(47);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(57),v=n(78),g=n(55),p=n(56),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(19),u=n.n(s),c=n(7),l=n.n(c),f=n(5),h=n.n(f),d=n(17),v=n.n(d),g=n(8),p=n.n(g),m=n(1),y=n(14),b=n(70),_=n(52),x=[],w=[[0,1/0]];var P=n(13),O=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(m.uid)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(m.hasFeature)(t,m.FEATURES.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a);for(var o=this.offset/4,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,k,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getInstanceCount",value:function(){return null!==this.value?this.value.length/this.size:0}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;var n=this.getInstanceCount();if((0===n||n=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(O);function j(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}function C(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.Buffer){var c=new Float32Array(r),l=t.getData({}),f=n.size,h=n.constant,d=h?n.getValue():n.getBuffer().getData({}),v=h?function(e,t){return u(d,t)}:function(e,t){return u(d.subarray(e,e+f),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.getData,a=e.sourceLayout,o=e.targetLayout;if(!Array.isArray(o))return C({source:t,target:n,getData:r}),n;for(var s=0,u=0,c=r&&function(e,t){return r(e+u,t)},l=Math.min(a.length,o.length),f=0;f0),this.needsRedraw=!0;var n=Object.assign({},I,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return D});function R(){}var N={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;P.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;N.savedMessages=[],N.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;N.savedMessages&&N.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-N.timeStart),a="".concat(r,"ms");P.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=N.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;P.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}P.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),N.savedMessages=null}},D=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new F(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(N.onLog=t||R),void 0!==n&&(N.onUpdateStart=n||R),void 0!==i&&(N.onUpdate=i||R),void 0!==r&&(N.onUpdateEnd=r||R)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in N.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h],this.numInstances)||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&N.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&P.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new S(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),P.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&N.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);N.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(70),p=n(79),m=n(1),y=n(153),b=n.n(y),_=n(13),x=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(m.uid)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;_.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.0;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.0;\n }\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","gouraud-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:4,type:5121,transition:!0,accessor:"getFillColor",defaultValue:O},instanceLineColors:{size:4,type:5121,transition:!0,accessor:"getLineColor",defaultValue:O},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=n.fp64!==i.fp64;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new x({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:4,transition:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new m.Model(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new m.Geometry({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,b=f[Symbol.iterator]();!(d=(m=b.next()).done);d=!0){var _=m.value;h.index++;var x=s(_,h);u[c++]=y(x[0]),u[c++]=y(x[1])}}catch(e){v=!0,p=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw p}}}else e.value=new Float32Array(2)}}]),t}(p.a);x.layerName="ScatterplotLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(19),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(7),l=n.n(c),f=n(5),h=n.n(f),d=n(8),v=n.n(d),g=n(22),p=n(57),m=n(85),y=n(96),b=n(38),_=85.05113,x=-85.05113;var w=n(14),P=n(55),O=n(56);n.d(t,"a",function(){return A});var k={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new P.a,transitionInterruption:O.a.BREAK},S={transitionDuration:0},j={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},C={pitch:0,bearing:0,altitude:1.5},E=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?C.bearing:c,d=n.pitch,v=void 0===d?C.pitch:d,g=n.altitude,p=void 0===g?C.altitude:g,m=n.maxZoom,y=void 0===m?j.maxZoom:m,b=n.minZoom,_=void 0===b?j.minZoom:b,x=n.maxPitch,P=void 0===x?j.maxPitch:x,O=n.minPitch,k=void 0===O?j.minPitch:O,S=n.startPanLngLat,E=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,M=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:P,minPitch:k})))._interactiveState={startPanLngLat:S,startZoomLngLat:E,startBearing:A,startPitch:T,startZoom:M},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,E,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return k}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,S,{isDragging:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i,r=n(0),a=n(48),o=n(72);n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u=/void main\s*\([^)]*\)\s*\{\n?/,c=/}\n?[^{}]*$/,l=[];function f(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),l.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(13),u=n(7),c=n.n(u),l=n(5),f=n.n(l),h=n(17),d=n.n(h),v=n(8),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(77).a),m=n(121),y=n(122),b=n(94),_=n(1);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h}),m=this.lastPostProcessEffect?this.screenBuffer:_.Framebuffer.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.Framebuffer(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.Framebuffer(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.Framebuffer.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(23),r=n(113);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(49))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(23);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(49))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(6),a=n(11),o=n(10),s=n(12),u=n(22);var c=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"clone",value:function(){return(new this.constructor).copy(this).check()}},{key:"copy",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(22),u=n(14),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){var i=n(173),r=n(174),a=n(175);e.exports=function(e){return i(e)||r(e)||a()}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(32),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(77),p=n(1),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.withParameters)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(14);function r(e){return Object(i.a)("boolean"==typeof e,"Invalid useDevicePixels"),e&&"undefined"!=typeof window?window.devicePixelRatio:1}},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(6),a=n(11),o=n(10),s=n(12),u=n(82),c=n(35),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(82).a),p=n(18),m=n(35),y=n(40),b=n(39);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.i(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.c(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.c(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.c(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.c(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(79),p=n(13),m=n(52),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){h()(l()(t.prototype),"setState",this).call(this,e),this.setLayerNeedsUpdate()}},{key:"getPickingInfo",value:function(e){return e.info}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,f=t.coordinateOrigin,h=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,g=t._subLayerProps,p={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:v};if(e){var m=g&&g[e.id],y=m&&m.updateTriggers;Object.assign(p,e,m,{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers,y)})}return p}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?p.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,p.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(g.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(103),u=n(14),c=n(86),l=n(37),f=n(33),h=n(13),d=n(52),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return o()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"project",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{topLeft:!0},n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.contains(e,t))return r.project(e,t)}return null}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.containsPixel(e,t))return r.unproject(e)}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(u.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(d.b)(e,{filter:Boolean}).map(function(e){return e instanceof f.a?new l.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(c.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):h.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),g=n(101),p=n(92),m=function(){function e(){r()(this,e),this.effects=[],this._needsRedraw="Initial render",this.defaultLightingEffect=new p.a,this.needApplyDefaultLighting=!1}return o()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(c.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed")),this.checkLightingEffect()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){var e=this.effects;return this.needApplyDefaultLighting&&(e=this.effects.slice()).push(this.defaultLightingEffect),e}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}this.effects.length=0}},{key:"checkLightingEffect",value:function(){var e=!1,t=!0,n=!1,i=void 0;try{for(var r,a=this.effects[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){if(r.value instanceof p.a){e=!0;break}}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}this.needApplyDefaultLighting=!e}}]),e}(),y=n(67),b=n(111),_=n(1),x=n(122),w=n(121),P={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function O(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,d=-1,v=0,g=0;gf)v+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,d=v)}v+=4}}if(d>=0){var x=t[d+3]-1,w=t.slice(d,d+4),O=n[x];if(O){var k=O.decodePickingColor(w);return{pickedColor:w,pickedLayer:O,pickedObjectIndex:k}}h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return P}function k(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=S({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function S(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var j=function(){function e(t){r()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new w.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(x.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new _.Framebuffer(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-r*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=S({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(u.a)(r),Object(u.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(u.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,c=r.y,l=r.width,f=r.height,h=new Uint8Array(l*f*4);return Object(_.readPixelsToArray)(o,{sourceX:s,sourceY:c,sourceWidth:l,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight;if(!(t>=0&&n>=0&&t0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&L&&0===e.which&&(t=I),this.pressed&&(t&I&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var z=D;var B=z?[[z.Rotate,{enable:!1}],[z.Pinch,{enable:!1}],[z.Swipe,{enable:!1}],[z.Pan,{threshold:0,enable:!1}],[z.Press,{enable:!1}],[z.Tap,{event:"doubletap",taps:2,enable:!1}],[z.Tap,{event:"anytap",enable:!1}],[z.Tap,{enable:!1}]]:null,U={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},V={doubletap:["tap"]},G={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},W=["keydown","keyup"],H=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],X=["wheel","mousewheel","DOMMouseScroll"],q={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",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"},Z={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Y=n(74),Q=-1!==Y.b.indexOf("firefox"),K=X,J=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=K.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!Y.a&&{passive:!1})})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;Y.c.WheelEvent&&(Q&&e.deltaMode===Y.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=Y.c.devicePixelRatio),e.deltaMode===Y.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),$=H,ee=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=$.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),te=W,ne=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=te.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),ie=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(T.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),re=1,ae=2,oe=4,se={pointerdown:re,pointermove:ae,pointerup:oe,mousedown:re,mousemove:ae,mouseup:oe},ue=1,ce=2,le=3,fe=0,he=1,de=2,ve=1,ge=2,pe=4;var me=function(){function e(t){Object(A.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(T.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(A.a)(this,e),this.options=Object.assign({},ye,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(T.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||B}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(U).forEach(function(e){var n=t.manager.get(e);n&&U[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new J(e,this._onOtherEvent,{enable:!1}),this.moveInput=new ee(e,this._onOtherEvent,{enable:!1}),this.keyInput=new ne(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new ie(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(E.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=V[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=Z[e]||e,o=r.get(a);o||(o=new me(this),r.set(a,o),o.recognizerName=q[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=Z[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=G[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),_e=n(26);function xe(){}n.d(t,"a",function(){return Pe});var we={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:xe,onResize:xe,onViewStateChange:xe,onBeforeRender:xe,onAfterRender:xe,onLoad:xe,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Pe=function(){function e(t){r()(this,e),t=Object.assign({},we,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerLeave=this._onPointerLeave.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new C.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return o()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&h.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&h.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(u.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new _.AnimationLoop({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(_.createGLContext)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new g.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_requestPick",value:function(e){var t=e.event,n=e.callback,i=e.mode,r=this._pickRequest;if("pointerleave"===t.type)r.x=-1,r.y=-1,r.radius=0;else{var a=t.offsetCenter;if(!a)return;r.x=a.x,r.y=a.y,r.radius=this.props.pickingRadius}r.callback=n,r.event=t,r.mode=i}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(_.trackContextState)(e,{enable:!0,copyState:!0})),Object(_.setParameters)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new be(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerLeave}}),_e.b)this.eventManager.on(t,this._onEvent);this.viewManager=new v({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(u.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new s.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new m,this.deckRenderer=new b.a(e),this.deckPicker=new j(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(_.setParameters)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),h.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=_e.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_onPointerMove",value:function(e){e.leftButton||e.rightButton||this._requestPick({callback:this.props.onHover,event:e,mode:"hover"})}},{key:"_onPointerLeave",value:function(e){this._requestPick({callback:this.props.onHover,event:e,mode:"hover"})}},{key:"_getFrameStats",value:function(){this.stats.get("frameRate").timeEnd(),this.stats.get("frameRate").timeStart();var e=this.animationLoop.stats;this.stats.get("GPU Time").addTime(e.get("GPU Time").lastTiming),this.stats.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){this.metrics.fps=this.stats.get("frameRate").getHz(),this.metrics.setPropsTime=this.stats.get("setProps Time").time,this.metrics.updateAttributesTime=this.stats.get("Update Attributes").time,this.metrics.framesRedrawn=this.stats.get("Redraw Count").count,this.metrics.pickTime=this.stats.get("pickObject Time").time+this.stats.get("pickMultipleObjects Time").time+this.stats.get("pickObjects Time").time,this.metrics.pickCount=this.stats.get("Pick Count").count,this.metrics.gpuTime=this.stats.get("GPU Time").time,this.metrics.cpuTime=this.stats.get("CPU Time").time,this.metrics.gpuTimePerFrame=this.stats.get("GPU Time").getAverageTime(),this.metrics.cpuTimePerFrame=this.stats.get("CPU Time").getAverageTime();var e=_.lumaStats.get("Memory Usage");this.metrics.bufferMemory=e.get("Buffer Memory").count,this.metrics.textureMemory=e.get("Texture Memory").count,this.metrics.renderbufferMemory=e.get("Renderbuffer Memory").count,this.metrics.gpuMemory=e.get("GPU Memory").count}}]),e}();Pe.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(y.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Pe.defaultProps=we},function(e,t,n){"use strict";var i=n(0);t.a={enable:function(e,t){return e(Object(i.a)({},t,!0))},disable:function(e,t){return e(Object(i.a)({},t,!1))},pixelStorei:function(e,t,n){return e(Object(i.a)({},t,n))},hint:function(e,t,n){return e(Object(i.a)({},t,n))},bindFramebuffer:function(e,t,n){var r;switch(t){case 36160:return e((r={},Object(i.a)(r,36006,n),Object(i.a)(r,36010,n),r));case 36009:return e(Object(i.a)({},36006,n));case 36008:return e(Object(i.a)({},36010,n));default:return null}},blendColor:function(e,t,n,r,a){return e(Object(i.a)({},32773,new Float32Array([t,n,r,a])))},blendEquation:function(e,t){var n;return e((n={},Object(i.a)(n,32777,t),Object(i.a)(n,34877,t),n))},blendEquationSeparate:function(e,t,n){var r;return e((r={},Object(i.a)(r,32777,t),Object(i.a)(r,34877,n),r))},blendFunc:function(e,t,n){var r;return e((r={},Object(i.a)(r,32969,t),Object(i.a)(r,32968,n),Object(i.a)(r,32971,t),Object(i.a)(r,32970,n),r))},blendFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,32969,t),Object(i.a)(o,32968,n),Object(i.a)(o,32971,r),Object(i.a)(o,32970,a),o))},clearColor:function(e,t,n,r,a){return e(Object(i.a)({},3106,new Float32Array([t,n,r,a])))},clearDepth:function(e,t){return e(Object(i.a)({},2931,t))},clearStencil:function(e,t){return e(Object(i.a)({},2961,t))},colorMask:function(e,t,n,r,a){return e(Object(i.a)({},3107,[t,n,r,a]))},cullFace:function(e,t){return e(Object(i.a)({},2885,t))},depthFunc:function(e,t){return e(Object(i.a)({},2932,t))},depthRange:function(e,t,n){return e(Object(i.a)({},2928,new Float32Array([t,n])))},depthMask:function(e,t){return e(Object(i.a)({},2930,t))},frontFace:function(e,t){return e(Object(i.a)({},2886,t))},lineWidth:function(e,t){return e(Object(i.a)({},2849,t))},polygonOffset:function(e,t,n){var r;return e((r={},Object(i.a)(r,32824,t),Object(i.a)(r,10752,n),r))},sampleCoverage:function(e,t,n){var r;return e((r={},Object(i.a)(r,32938,t),Object(i.a)(r,32939,n),r))},scissor:function(e,t,n,r,a){return e(Object(i.a)({},3088,new Int32Array([t,n,r,a])))},stencilMask:function(e,t){var n;return e((n={},Object(i.a)(n,2968,t),Object(i.a)(n,36005,t),n))},stencilMaskSeparate:function(e,t,n){return e(Object(i.a)({},1028===t?2968:36005,n))},stencilFunc:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2962,t),Object(i.a)(a,2967,n),Object(i.a)(a,2963,r),Object(i.a)(a,34816,t),Object(i.a)(a,36003,n),Object(i.a)(a,36004,r),a))},stencilFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2962:34816,n),Object(i.a)(o,1028===t?2967:36003,r),Object(i.a)(o,1028===t?2963:36004,a),o))},stencilOp:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2964,t),Object(i.a)(a,2965,n),Object(i.a)(a,2966,r),Object(i.a)(a,34817,t),Object(i.a)(a,34818,n),Object(i.a)(a,34819,r),a))},stencilOpSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2964:34817,n),Object(i.a)(o,1028===t?2965:34818,r),Object(i.a)(o,1028===t?2966:34819,a),o))},viewport:function(e,t,n,r,a){return e(Object(i.a)({},2978,new Int32Array([t,n,r,a])))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(21),r=n(96),a=n(60);function o(e){var t=e.width,n=e.height,o=e.bounds,s=e.padding,u=void 0===s?0:s,c=e.offset,l=void 0===c?[0,0]:c,f=Object(i.a)(o,2),h=Object(i.a)(f[0],2),d=h[0],v=h[1],g=Object(i.a)(f[1],2),p=g[0],m=g[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else Object(a.a)(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var y=new r.a({width:t,height:n,longitude:0,latitude:0,zoom:0}),b=y.project([d,m]),_=y.project([p,v]),x=[Math.abs(_[0]-b[0]),Math.abs(_[1]-b[1])],w=[t-u.left-u.right-2*Math.abs(l[0]),n-u.top-u.bottom-2*Math.abs(l[1])];Object(a.a)(w[0]>0&&w[1]>0);var P=w[0]/x[0],O=w[1]/x[1],k=(u.right-u.left)/2/P,S=(u.bottom-u.top)/2/O,j=[(_[0]+b[0])/2+k,(_[1]+b[1])/2+S],C=y.unproject(j),E=y.zoom+Math.log2(Math.abs(Math.min(P,O)));return{longitude:C[0],latitude:C[1],zoom:E}}},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(21),r=n(4),a=n(6),o=n(22),s=n(47),u=n(40),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.c(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},,,,function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(37),v=n(33),g=n(132),p=n(125),m=n(104);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(3),r=n.n(i),a=n(2),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(37),v=n(33),g=n(125),p=n(78),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,P=e.zoom,O=void 0===P?0:P;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:O}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:O}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(3),r=n.n(i),a=n(5),o=n.n(a),s=n(2),u=n.n(s),c=n(7),l=n.n(c),f=n(8),h=n.n(f),d=n(37),v=n(33),g=n(125),p=n(105),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.CubeGeometry}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(107).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=n(70),g=n(126),p=n(80),m=n(71),y=n(88),b=new d.PhongMaterial,_={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,fp64:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:b},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=e.changeFlags;(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon))&&(this.state.paths=this._getPaths(t))}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.object&&t.object.object||t.object})}},{key:"_getPaths",value:function(e){var t=e.data,n=e.getPolygon,i=[],r="XY"===e.positionFormat?2:3,a=Object(v.a)(t),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++;var g=y.c(n(d,s),r),p=g.positions,m=g.holeIndices;if(m)for(var b=0;b<=m.length;b++){var _=p.subarray(m[b-1]||0,m[b]||p.length);i.push({path:_,object:d})}else i.push({path:p,object:d})}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return i}},{key:"_getAccessor",value:function(e){return"function"==typeof e?function(t){return e(t.object)}:e}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.stroked,i=e.filled,r=e.extruded,a=e.wireframe,o=e.elevationScale,s=e.transitions,u=this.props,c=u.lineWidthUnits,l=u.lineWidthScale,f=u.lineWidthMinPixels,h=u.lineWidthMaxPixels,d=u.lineJointRounded,v=u.lineMiterLimit,g=u.lineDashJustified,y=u.fp64,b=this.props,_=b.getFillColor,x=b.getLineColor,w=b.getLineWidth,P=b.getLineDashArray,O=b.getElevation,k=b.getPolygon,S=b.updateTriggers,j=b.material,C=this.state.paths,E=this.getSubLayerClass("fill",p.a),A=this.getSubLayerClass("stroke",m.a),T=this.shouldRenderSubLayer("fill",C)&&new E({extruded:r,elevationScale:o,fp64:y,filled:i,wireframe:a,getElevation:O,getFillColor:_,getLineColor:x,material:j,transitions:s},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:S.getPolygon,getElevation:S.getElevation,getFillColor:S.getFillColor,getLineColor:S.getLineColor}}),{data:t,getPolygon:k});return[!r&&T,!r&&n&&this.shouldRenderSubLayer("stroke",C)&&new A({fp64:y,widthUnits:c,widthScale:l,widthMinPixels:f,widthMaxPixels:h,rounded:d,miterLimit:v,dashJustified:g,transitions:s&&{getWidth:s.getLineWidth,getColor:s.getLineColor,getPath:s.getPolygon},getColor:this._getAccessor(x),getWidth:this._getAccessor(w),getDashArray:this._getAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:S.getLineWidth,getColor:S.getLineColor,getDashArray:S.getLineDashArray}}),{data:C,getPath:function(e){return e.path}}),r&&T]}}]),t}(g.a);x.layerName="PolygonLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(70),p=n(79),m=n(1),y="#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n";n.d(t,"a",function(){return w});var b=m.fp64.fp64LowPart,_=[0,0,0,255],x={fp64:!1,getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:_},getTargetColor:{type:"accessor",value:_},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return this.use64bitProjection()?{vs:"#define SHADER_NAME arc-layer-vertex-shader-64\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\n\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\n\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\n\nvec2 paraboloid_fp64(vec2 source[2], vec2 target[2], float ratio) {\n\n vec2 x[2];\n vec2_mix_fp64(source, target, ratio, x);\n vec2 center[2];\n vec2_mix_fp64(source, target, 0.5, center);\n\n vec2 dSourceCenter = vec2_distance_fp64(source, center);\n vec2 dXCenter = vec2_distance_fp64(x, center);\n return mul_fp64(sum_fp64(dSourceCenter, dXCenter), sub_fp64(dSourceCenter, dXCenter));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvoid get_pos_fp64(vec2 source[2], vec2 target[2], float segmentRatio, out vec2 position[4]) {\n\n vec2 vertex_height = paraboloid_fp64(source, target, segmentRatio);\n\n vec2 position_temp[2];\n\n vec2_mix_fp64(source, target, segmentRatio, position_temp);\n\n position[0] = position_temp[0];\n position[1] = position_temp[1];\n\n if (vertex_height.x < 0.0 || (vertex_height.x == 0.0 && vertex_height.y <= 0.0)) {\n vertex_height = vec2(0.0, 0.0);\n }\n\n position[2] = sqrt_fp64(vertex_height);\n position[3] = vec2(1.0, 0.0);\n}\n\nvoid main(void) {\n vec2 projected_source_coord[2];\n vec2 projected_target_coord[2];\n\n project_position_fp64(instancePositions.xy, instancePositions64Low.xy, projected_source_coord);\n project_position_fp64(instancePositions.zw, instancePositions64Low.zw, projected_target_coord);\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec2 curr_pos_modelspace[4];\n\n get_pos_fp64(projected_source_coord, projected_target_coord, segmentRatio,\n curr_pos_modelspace);\n\n vec2 next_pos_modelspace[4];\n\n get_pos_fp64(projected_source_coord, projected_target_coord, nextSegmentRatio,\n next_pos_modelspace);\n\n vec4 curr_pos_clipspace = project_common_position_to_clipspace_fp64(curr_pos_modelspace);\n vec4 next_pos_clipspace = project_common_position_to_clipspace_fp64(next_pos_modelspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n\n vec2 offset = getExtrusionOffset(next_pos_clipspace.xy - curr_pos_clipspace.xy, positions.y, widthPixels);\n\n gl_Position = curr_pos_clipspace + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:y,modules:["project64","picking"]}:{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n vec2 source = project_position(vec3(instancePositions.xy, 0.0), instancePositions64Low.xy).xy;\n vec2 target = project_position(vec3(instancePositions.zw, 0.0), instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels);\n gl_Position = curr + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:y,modules:["picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:4,type:5121,transition:!0,accessor:"getSourceColor",defaultValue:_},instanceTargetColors:{size:4,type:5121,transition:!0,accessor:"getTargetColor",defaultValue:_},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new m.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.Geometry({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,p=!1,m=void 0;try{for(var y,_=h[Symbol.iterator]();!(v=(y=_.next()).done);v=!0){var x=y.value;d.index++;var w=s(x,d);c[l++]=b(w[0]),c[l++]=b(w[1]);var P=u(x,d);c[l++]=b(P[0]),c[l++]=b(P[1])}}catch(e){p=!0,m=e}finally{try{v||null==_.return||_.return()}finally{if(p)throw m}}}else e.value=new Float32Array(4)}}]),t}(p.a);w.layerName="ArcLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(70),p=n(79),m=n(1);n.d(t,"a",function(){return _});var y=m.fp64.fp64LowPart,b={fp64:!1,getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},_=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},instanceColors:{size:4,type:5121,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new m.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.Geometry({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,p=!1,m=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),P=u(x,d);c[l++]=y(w[0]),c[l++]=y(w[1]),c[l++]=y(P[0]),c[l++]=y(P[1])}}catch(e){p=!0,m=e}finally{try{v||null==_.return||_.return()}finally{if(p)throw m}}}else e.value=new Float32Array(4)}}]),t}(p.a);_.layerName="LineLayer",_.defaultProps=b},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(126),v=n(108),g=n(71),p=n(1),m=n(80),y=n(13);function b(e,t,n){var i=e.type,r=e.coordinates,a=t.pointFeatures,o=t.lineFeatures,s=t.polygonFeatures,u=t.polygonOutlineFeatures;if(function(e,t){var n=x[e];y.a.assert(n,"Unknown GeoJSON type ".concat(e));for(;t&&--n>0;)t=t[0];return t&&Number.isFinite(t[0])}(i,r))switch(i){case"Point":a.push({geometry:e,sourceFeature:n});break;case"MultiPoint":r.forEach(function(e){a.push({geometry:{type:"Point",coordinates:e},sourceFeature:n})});break;case"LineString":o.push({geometry:e,sourceFeature:n});break;case"MultiLineString":r.forEach(function(e){o.push({geometry:{type:"LineString",coordinates:e},sourceFeature:n})});break;case"Polygon":s.push({geometry:e,sourceFeature:n}),r.forEach(function(e){u.push({geometry:{type:"LineString",coordinates:e},sourceFeature:n})});break;case"MultiPolygon":r.forEach(function(e){s.push({geometry:{type:"Polygon",coordinates:e},sourceFeature:n}),e.forEach(function(e){u.push({geometry:{type:"LineString",coordinates:e},sourceFeature:n})})})}else y.a.warn("".concat(i," coordinates are malformed"))()}function _(e){return e.sourceFeature.feature}var x={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return S});var w=new p.PhongMaterial,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,fp64:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:w};function O(e){return e.geometry.coordinates}function k(e){return"function"!=typeof e?e:function(t){return e(_(t))}}var S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props;if(e.changeFlags.dataChanged){var n=function(e){if(Array.isArray(e))return e;switch(y.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return y.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data);this.state.features=function(e){for(var t={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},n=0;n=t.min)}}};function o(e,t){switch(s(t)){case"object":return function(e){var t=e.type;(a[t]||{}).typeValidator;return e}(t=function(e,t){if(!("type"in t))return"value"in t?Object.assign({name:e,type:s(t.value)},t):{name:e,type:"object",value:t};return Object.assign({name:e},t)}(e,t));case"array":return function(e,t){if(/color/i.test(e)&&(3===t.length||4===t.length))return{name:e,type:"color",value:t};return{name:e,type:"array",value:t}}(e,t);case"boolean":return{name:e,type:"boolean",value:t};case"number":return function(e,t){var n=/radius|scale|width|height|pixel|size|miter/i.test(e)&&/^((?!scale).)*$/.test(e)?100:1;return{name:e,type:"number",max:Math.max(t,n),min:Math.min(t,0),value:t}}(e,t);case"function":return{name:e,type:"function",value:t};default:return{name:e,type:"unknown",value:t}}}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":null===e?"null":Object(i.a)(e)}function u(e){if(!e.normalized){if(e.normalized=!0,e.uniforms){var t=function(e){for(var t={},n={},i=0,a=Object.entries(e);i=0}).call(this,n(49))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(23),r=n(148);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(49))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(23);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(49))},function(e,t,n){var i=n(171);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(29),a=n.n(r),o=n(75);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(49))},function(e,t){},function(e,t){},function(e,t,n){var i=n(9);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===k(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(P(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(P(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),P(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),P(i),P(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new O(e.i,e.x,e.y),i=new O(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new O(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function P(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function O(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function k(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/long.js for details + */r=[],void 0===(a="function"==typeof(i=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},i={};function r(e,t){var r,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=i[e])?a:(r=o(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(a=n[e])?a:(r=o(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:v;if(t){if(e<0)return g;if(e>=f)return _}else{if(e<=-h)return x;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,n,i){return new e(t,n,i)}e.fromInt=r,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(s(n,8)),o=v,c=0;c>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(p)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,v=0;return d+=(v+=a+(65535&e.low))>>>16,h+=(d+=r+l)>>>16,f+=(h+=i+u)>>>16,f+=n+s,o((d&=65535)<<16|(v&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(t(e)||(e=c(e)),e.isZero())return v;if(this.eq(x))return e.isOdd()?x:v;if(e.eq(x))return this.isOdd()?x:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,y=0;return m+=(y+=s*h)>>>16,p+=(m+=r*h)>>>16,m&=65535,p+=(m+=s*f)>>>16,g+=(p+=i*h)>>>16,p&=65535,g+=(p+=r*f)>>>16,p&=65535,g+=(p+=s*l)>>>16,g+=n*h+i*f+r*l+s*u,o((m&=65535)<<16|(y&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:v;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;r=g}else{if(this.eq(x))return e.eq(p)||e.eq(y)?x:e.eq(x)?p:(n=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?p:y:(i=this.sub(e.mul(n)),r=n.add(i.div(e)));if(e.eq(x))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=v}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(n),f=l.mul(e);f.isNegative()||f.gt(i);)f=(l=a(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=p),r=r.add(l),i=i.sub(f)}return r},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;return e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?i.apply(t,r):i)||(e.exports=a)},function(e,t){},function(e,t,n){const i=n(160);Object.assign(i,n(54),n(182),n(183),n(185),n(181),n(186),n(184)),e.exports=i},,function(e,t,n){(function(t){const i=n(1),r=n(20),a=n(177).default,o="undefined"==typeof window?t:window;o.deck=o.deck||{},o.luma=o.luma||{},Object.assign(o.deck,r,{DeckGL:a}),Object.assign(o.luma,i),e.exports=o.deck}).call(this,n(53))},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){var i=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(165),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=_;var f="suspendedStart",h="suspendedYield",d="executing",v="completed",g={},p={};p[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==i&&r.call(y,o)&&(p=y);var b=O.prototype=w.prototype=Object.create(p);P.prototype=b.constructor=O,O.constructor=P,O[u]=P.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===P||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},k(S.prototype),S.prototype[s]=function(){return this},l.AsyncIterator=S,l.async=function(e,t,n,i){var r=new S(_(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},k(b),b[u]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=T,A.prototype={constructor:A,reset:function(e){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(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:T(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function _(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new A(i||[]);return a._invoke=function(e,t,n){var i=f;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return M()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=j(o,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function P(){}function O(){}function k(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function S(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function j(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,j(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; /*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * @@ -9,4 +14,4 @@ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ -!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),f="function",h=Math.round,d=Math.abs,v=Date.now;function p(e,t,n){return setTimeout(w(e,n),t)}function g(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function k(e){return e.trim().split(/\s+/g)}function C(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function L(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==U&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(f=o.pointers,h=i,oe(h[0],h[1],$)/oe(f[0],f[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>B||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,f=re(u,c,l);i=f.x,r=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var f,h;var p=e.element;A(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?Y:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&O(this.element,this.evEl,this.domHandler),this.evTarget&&O(this.target,this.evTarget,this.domHandler),this.evWin&&O(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(I(this.element),this.evWin,this.domHandler)}};var ue={mousedown:U,mousemove:z,mouseup:V},ce="mousedown",le="mousemove mouseup";function fe(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(fe,ee,{handler:function(e){var t=ue[e.type];t&U&&0===e.button&&(this.pressed=!0),t&z&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:U,pointermove:z,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",pe="pointermove pointerup pointercancel";function ge(){this.evEl=ve,this.evWin=pe,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",pe="MSPointerMove MSPointerUp MSPointerCancel"),x(ge,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=he[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=C(t,e.pointerId,"pointerId");r&U&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:U,touchmove:z,touchend:V,touchcancel:G},ye="touchstart",_e="touchstart touchmove touchend touchcancel";function be(){this.evTarget=ye,this.evWin=_e,this.started=!1,ee.apply(this,arguments)}x(be,ee,{handler:function(e){var t=me[e.type];if(t===U&&(this.started=!0),this.started){var n=function(e,t){var n=M(e.touches),i=M(e.changedTouches);t&(V|G)&&(n=j(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:U,touchmove:z,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Ee(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Ee,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=M(e.touches),i=this.targetIds;if(t&(U|z)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=M(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return A(e.target,u)}),t===U)for(r=0;r-1&&i.splice(e,1)},Pe)}}x(Se,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&U?(this.primaryTouch=t.changedPointers[0].identifier,Ae.call(this,t)):e&(V|G)&&Ae.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Ue&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return Ye.prototype.attrTest.call(this,e)&&(this.state&De||!(this.state&De)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(qe,Ye,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&De)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Ke,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ce]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&U)this.reset(),this._timer=p(function(){this.state=ze,this.tryEmit()},t.time,this);else if(e.eventType&V)return ze;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===ze&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Qe,Ye,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&De)}}),x(Je,Ye,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:q|K,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(q|K)?t=e.overallVelocity:n&q?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Me]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(179);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var i=function(e){"use strict";var t,n=Object.prototype,i=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function u(e,t,n,i){var r=t&&t.prototype instanceof p?t:p,a=Object.create(r.prototype),o=new A(i||[]);return a._invoke=function(e,t,n){var i=l;return function(r,a){if(i===h)throw new Error("Generator is already running");if(i===d){if("throw"===r)throw a;return k()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=P(o,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===l)throw i=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=h;var u=c(e,t,n);if("normal"===u.type){if(i=n.done?d:f,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=d,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",f="suspendedYield",h="executing",d="completed",v={};function p(){}function g(){}function m(){}var y={};y[a]=function(){return this};var _=Object.getPrototypeOf,b=_&&_(_(T([])));b&&b!==n&&i.call(b,a)&&(y=b);var x=m.prototype=p.prototype=Object.create(y);function w(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function E(e){var t;this._invoke=function(n,r){function a(){return new Promise(function(t,a){!function t(n,r,a,o){var s=c(e[n],e,r);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(l).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,r,t,a)})}return t=t?t.then(a,a):a()}}function P(e,n){var i=e.iterator[n.method];if(i===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=c(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,v;var a=r.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function T(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function n(){for(;++r=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;S(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:T(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(18),h=n.n(f),d=n(9),v=n.n(d),p=n(71),g=n(80),m=n(7),y=n.n(m),_=n(1),b=n(16),x=n.n(b);function w(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function E(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var a=e.apply(t,n);function o(e){w(a,i,r,o,s,"next",e)}function s(e){w(a,i,r,o,s,"throw",e)}o(void 0)})}}var P=n(90);function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{}),!Z(t)){e.next=4;break}return e.abrupt("return",Promise.resolve(X(t)));case 4:if(!q(t)){e.next=6;break}return e.abrupt("return",new Promise(function(e,i){n=S({},new URL(t),n),(t.startsWith("https:")?I.a.request:L.a.request)(t,function(t){return H(t).then(e,i)})}));case 6:return i=N.a.promisify(M.a.readFile),e.next=9,i(t,n);case 9:return r=e.sent,e.abrupt("return",r instanceof Buffer?V(r):r);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ne(e,t){return ie.apply(this,arguments)}function ie(){return(ie=E(x.a.mark(function e(t,n){return x.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!Z(t)){e.next=2;break}return e.abrupt("return",X(t));case 2:if(q(t)){e.next=4;break}return e.abrupt("return",M.a.createReadStream(t,n));case 4:return e.abrupt("return",new Promise(function(e,i){n=S({},new URL(t),n),(t.startsWith("https:")?I.a.request:L.a.request)(t,function(t){return e(t)})}));case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function re(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e=Object.assign({},Y,e)).responseType=e.responseType||e.dataType,M.a&&(e.encoding=e.encoding||("text"===e.dataType?"utf8":null)),e}function ae(e,t){return oe.apply(this,arguments)}function oe(){return(oe=E(x.a.mark(function e(t,n){return x.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}var se="",ue={};function ce(e){for(var t in ue)if(e.startsWith(t)){var n=ue[t];return e.replace(t,n)}return e+=se}function le(e,t){return fe.apply(this,arguments)}function fe(){return(fe=E(x.a.mark(function e(t,n){var i;return x.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=ce(t),i=P.a?ae:J,e.abrupt("return",i(t,n));case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function he(e){return!!e&&(Array.isArray(e)&&(e=e[0]),e.parseTextSync||e.parseSync||e.parse||e.loadAndParse||e.parseStream||e.parseInBatches||e.worker)}function de(e){var t;return D(he(e)),Array.isArray(e)&&(t=(e=e[0])[1],e=S({},e,{options:S({},e.options,{options:t})})),e.extension&&(e.extensions=e.extensions||[e.extension],delete e.extension),Array.isArray(e.extensions)||(e.extensions=[e.extensions]),D(e.extensions&&e.extensions.length>0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}var ve=/[^\.]+$/;function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=e.match(ve);if(i&&i[0]){var r=function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;de(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,i[0]);if(r)return r}var a=function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s.testText&&s.testText(t))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,t);return a||null}var ge=function(){function e(){A(this,e)}return k(e,[{key:"log",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}}]),e}(),me={};function ye(){return Object.values(me)}var _e=new Map;function be(e,t,n){var i=function(e){var t=_e.get(e);if(!t){var n=new Blob([e],{type:"application/javascript"});t=URL.createObjectURL(n),_e.set(e,t)}return new Worker(t)}(e);n=function(e){null!==(e=Object.assign({},e)).log&&delete e.log;return e}(n);var r=function(e,t){return new Promise(function(n,r){i.onmessage=function(e){switch(e.data.type){case"done":n(e.data.result),i.terminate();break;case"error":r(new Error(e.data.message))}};var a=V(e);i.postMessage({arraybuffer:a,opts:t},[a])})};return t?r(t,n):r}n(124);var xe=function(e){return"undefined"!=typeof window&&e instanceof window.Response||e.arrayBuffer&&e.json&&e.body},we="Cannot convert supplied data type";function Ee(e){return xe(e)?e.url:null}function Pe(e,t){if(t.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){var n=e.buffer||e;return t.text&&!t.binary?new B.TextDecoder("utf8").decode(n):n}throw new Error(we)}function Oe(e,t){return Se.apply(this,arguments)}function Se(){return(Se=E(x.a.mark(function e(t,n){var i;return x.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(t=e.sent,i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=6;break}return e.abrupt("return",Pe(t,n));case 6:if(!xe(t)){e.next=15;break}if(!n.binary){e.next=13;break}return e.next=10,t.arrayBuffer();case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0=t.text();case 14:return e.abrupt("return",e.t0);case 15:throw new Error(we);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ae(e,t){return Te.apply(this,arguments)}function Te(){return(Te=E(x.a.mark(function e(t,n){var i,r,a=arguments;return x.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>2&&void 0!==a[2]?a[2]:{},r=(r=a.length>3?a[3]:void 0)||Ee(t),e.next=5,Oe(t,n);case 5:if(t=e.sent,!n.parseTextSync||"string"!=typeof t){e.next=9;break}return i.dataType="text",e.abrupt("return",n.parseTextSync(t,i,r,n));case 9:if(!n.parseSync){e.next=11;break}return e.abrupt("return",n.parseSync(t,i,r,n));case 11:if(!n.parse){e.next=15;break}return e.next=14,n.parse(t,i,r,n);case 14:return e.abrupt("return",e.sent);case 15:if(!n.worker){e.next=19;break}return e.next=18,be(n.worker,t,i);case 18:return e.abrupt("return",e.sent);case 19:return e.abrupt("return",D(!1));case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ke(e,t,n,i){return Ce.apply(this,arguments)}function Ce(){return(Ce=E(x.a.mark(function e(t,n,i,r){var a;return x.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||he(n)||(r=i,i=n,n=null),n=n||ye(),a=Array.isArray(n)?pe(r,t,n):n){e.next=5;break}return e.abrupt("return",null);case 5:return de(a),i=Me(i,a),e.next=9,Ae(t,a,i,r);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Me(e,t){return null===(e=Object.assign({},t.DEFAULT_OPTIONS,t.options,e,{dataType:"arraybuffer"})).log&&(e.log=new ge),"log"in e||(e.log=console),e}function je(e,t,n){return Le.apply(this,arguments)}function Le(){return(Le=E(x.a.mark(function e(t,n,i){var r,a;return x.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||he(n)||(i=n,n=null),n=n||ye(),!(r=Array.isArray(n)?pe(t,null,n):n)||!r.loadAndParse){e.next=7;break}return e.next=6,r.loadAndParse(t,i);case 6:return e.abrupt("return",e.sent);case 7:return e.next=9,le(t,i);case 9:return a=e.sent,e.abrupt("return",ke(a,n,i,t));case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Re=n(189),Ie=Math.PI/180,Fe=new Float32Array(16),Ne=new Float32Array(12);function De(e,t,n){var i=t[0]*Ie,r=t[1]*Ie,a=t[2]*Ie,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),f=Math.cos(r),h=n[0],d=n[1],v=n[2];e[0]=h*f*l,e[1]=h*u*l,e[2]=h*-s,e[3]=d*(-u*c+f*s*o),e[4]=d*(f*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+f*s*c),e[7]=v*(-f*o+u*s*c),e[8]=v*l*c}function Be(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var Ue={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),f=l&&16===c.length,h=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),g=f||!l&&Boolean(c(a[0]));e.constant=g?f:d&&h&&v;var m=e.value;if(e.constant){var y;if(g)Fe.set(c),y=Be(Fe);else De(y=Ne,o,s),y.set(u,9);e.value=new Float32Array(y)}else{var _=n*e.size,b=Object(p.a)(a,n,i),x=b.iterable,w=b.objectInfo,E=!0,P=!1,O=void 0;try{for(var S,A=x[Symbol.iterator]();!(E=(S=A.next()).done);E=!0){var T=S.value;w.index++;var k=void 0;if(g)Fe.set(f?c:c(T,w)),k=Be(Fe);else De(k=Ne,d?o:o(T,w),h?s:s(T,w)),k.set(v?u:u(T,w),9);m[_++]=k[0],m[_++]=k[1],m[_++]=k[2],m[_++]=k[3],m[_++]=k[4],m[_++]=k[5],m[_++]=k[6],m[_++]=k[7],m[_++]=k[8],m[_++]=k[9],m[_++]=k[10],m[_++]=k[11]}}catch(e){P=!0,O=e}finally{try{E||null==A.return||A.return()}finally{if(P)throw O}}}}},ze=_.fp64.fp64LowPart;function Ve(e,t,n){return t instanceof _.Texture2D?t:new _.Texture2D(e,Object.assign({data:t},n))}function Ge(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function We(e){if(e.attributes)return Ge(e.attributes),e instanceof _.Geometry?e:new _.Geometry(e);if(e.positions||e.POSITION)return Ge(e),new _.Geometry({attributes:e});throw Error("Invalid mesh")}var He=new _.PhongMaterial,Xe={fetch:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){return"mesh"===t.propName?je(e):fetch(e).then(function(e){return e.json()})}),mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:y.a.LEQUAL},fp64:!1,wireframe:!1,material:He,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},Ye=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=this.use64bitProjection()?"project64":"project32",t=Object(_.isWebGL2)(this.context.gl);return{vs:t?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\n\n// Instance attributes\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n",fs:t?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor / 255., color.a);\n\n // use highlight color if this fragment belongs to the selected object.\n fragColor = picking_filterHighlightColor(fragColor);\n\n // use picking color if rendering to picking FBO.\n fragColor = picking_filterPickingColor(fragColor);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor / 255., color.a);\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[e,"phong-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{transition:!0,size:4,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:Ue}),this.setState({emptyTexture:new _.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||n.fp64!==i.fp64){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?y.a.LINE_STRIP:y.a.TRIANGLES)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new _.Model(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:We(e),isInstanced:!0,shaderCache:this.context.shaderCache}));return this.state.texture?t.setUniforms({sampler:this.state.texture,hasTexture:1}):t.setUniforms({sampler:this.state.emptyTexture,hasTexture:0}),t}},{key:"setTexture",value:function(e){var t=this,n=this.context.gl,i=this.state.emptyTexture;this.state.texture&&this.state.texture.delete(),e?function(e,t,n){return"string"==typeof t?Object(Re.a)(t).then(function(t){return Ve(e,t,n)}).catch(function(e){throw new Error("Could not load texture from ".concat(t,": ").concat(e))}):new Promise(function(i){return i(Ve(e,t,n))})}(n,e).then(function(e){t.setState({texture:e}),t.state.model&&t.state.model.setUniforms({sampler:t.state.texture,hasTexture:1})}):(this.setState({texture:null}),this.state.model&&this.state.model.setUniforms({sampler:i,hasTexture:0}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(p.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var _=m.value;h.index++;var b=s(_,h);u[c++]=ze(b[0]),u[c++]=ze(b[1])}}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(g.a);Ye.layerName="SimpleMeshLayer",Ye.defaultProps=Xe;var Ze=_.fp64.fp64LowPart,qe=[255,255,255,255],Ke={scenegraph:{type:"object",value:null,async:!0},fetch:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){var n=t.propName,i=t.layer;return"scenegraph"===n?je(e,i.getLoadOptions()):fetch(e).then(function(e){return e.json()})}),getScene:function(e){return e&&e.scenes?e.scenes[0]:e},getAnimator:function(e){return e&&e.animator},sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:qe},_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:[]}},Qe=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{size:4,accessor:"getColor",defaultValue:qe,transition:!0},instanceModelMatrix:Ue})}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(p.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var _=m.value;h.index++;var b=s(_,h);u[c++]=Ze(b[0]),u[c++]=Ze(b[1])}}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;if(n.scenegraph!==i.scenegraph){var r=n.getScene(n.scenegraph),a=n.getAnimator(n.scenegraph);r instanceof _.ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,a,n._animations),this.setState({scenegraph:r,animator:a})):null!==r&&_.log.warn("invalid scenegraph:",r)()}else n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){this._deleteScenegraph()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&re?t:e}function R(e,t){return t2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(k.isWebGL2)(t)&&Object(k.hasFeatures)(this.gl,k.FEATURES.BLEND_EQUATION_MINMAX,k.FEATURES.COLOR_ATTACHMENT_RGBA32F,k.FEATURES.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.info("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,q){var r=q[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},N,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,F)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||G,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},V,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,f=0;f=0&&P=0&&O0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new k.Model(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n\n // Transform (0,0):windowSize -> (0, 0): gridSize\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n\n // Transform (0,0):gridSize -> (-1, -1):(1,1)\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n\n // Move to pixel center, pixel-size in screen sapce (2/gridSize) * 0.5 => 1/gridSize\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n\n // Transform (0,0):windowSize -> (0, 0): gridSize\n pos = floor(pos / cellSize);\n\n // Transform (0,0):gridSize -> (-1, -1):(1,1)\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n\n // Move to pixel center, pixel-size in screen sapce (2/gridSize) * 0.5 => 1/gridSize\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?["fp64","project64"]:["project32"],shaderCache:n,vertexCount:0,drawMode:T.a.POINTS})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new k.Model(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n // Map each position to single pixel\n vec2 pos = vec2(-1.0, -1.0);\n\n // Move to pixel center, pixel-size in screen sapce (2/gridSize) * 0.5 => 1/gridSize\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n // if combineMinMax is true, use Alpha channel for first weights min value.\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:["fp64"],shaderCache:t,vertexCount:1,drawMode:T.a.POINTS,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new k.Transform(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n // TODO: Use 64-bit division ?? not needed given this is aggregation ??\n bool isCellValid = bool(aggregationValues.w > 0.);\n // aggregationValues: XYZ contain aggregated values, W contains count\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,h=a.weights,d=Y(i),v=[o,s],p={blend:!0,depthTest:!1,blendFunc:[T.a.ONE,T.a.ONE]},g={viewport:n},m={windowSize:u,cellSize:t,gridSize:v,uProjectionMatrix:i,uProjectionMatrixFP64:d,projectPoints:r};for(var y in h){var _=h[y],b=_.needMin,x=_.needMax,w=b&&x&&h[y].combineMaxMin;this.renderToWeightsTexture({id:y,parameters:p,moduleSettings:g,uniforms:m,gridSize:v}),w?this.renderToMaxMinTexture({id:y,parameters:Object.assign({},p,{blendEquation:U}),gridSize:v,minOrMaxFb:c[y],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:w}):(b&&this.renderToMaxMinTexture({id:y,parameters:Object.assign({},p,{blendEquation:D}),gridSize:v,minOrMaxFb:l[y],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:w}),x&&this.renderToMaxMinTexture({id:y,parameters:Object.assign({},p,{blendEquation:B}),gridSize:v,minOrMaxFb:f[y],combineMaxMin:w}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(k.withParameters)(c,s,function(){c.clear(c.COLOR_BUFFER_BIT)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,f=this.gl,h=this.gridAggregationModel,d=l[t].operation;s[t].bind(),f.viewport(0,0,a[0],a[1]);var v=d===M.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(k.withParameters)(f,{clearColor:v},function(){f.clear(f.COLOR_BUFFER_BIT)});var p={weights:c[t]};if(h.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:p}),s[t].unbind(),d===M.MEAN){var g=this.state,m=g.meanTextures,y=g.textures,_={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(_).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(P()({},T.a.COLOR_ATTACHMENT0,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,f=t.equations,h=t.weights,d={width:n,height:i};for(var v in h){var p=h[v],g=p.needMin,m=p.needMax,y=p.combineMaxMin,_=p.operation;r[v]=h[v].aggregationTexture||r[v]||W(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var b=r[v];_===M.MEAN&&(l[v]=l[v]||W(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),b=l[v]),a[v]?a[v].attach(P()({},T.a.COLOR_ATTACHMENT0,b)):a[v]=H(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:b}),a[v].resize(d),f[v]=z[_],(g||m)&&(g&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=W(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=H(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(g&&(s[v]||(c["".concat(v,"-min")]=W(this.gl,{id:"".concat(v,"-minTex")}),s[v]=H(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=W(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=H(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof k.Buffer?n[o].setData(u):(a["".concat(o,"-buffer")]=new k.Buffer(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof k.Buffer),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],e}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:M.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new K(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&this._updateAggregation(n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||J,o=this.props.maxColor||$,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,f=u.cellScale,h=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,p={minColor:a,maxColor:o,cellScale:f,colorRange:d,colorDomain:s,shouldUseMinMax:h};Object(k.isWebGL2)(n)?l.bind({target:T.a.UNIFORM_BUFFER}):p.maxWeight=v,t=Object.assign(p,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(k.isWebGL2)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=K.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new k.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new k.Geometry({drawMode:T.a.TRIANGLE_FAN,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new k.Buffer(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=Q(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(g.a)(t),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,p=c[Symbol.iterator]();!(f=(v=p.next()).done);f=!0){var m=v.value;l.index++;var y=n(m,l),_=i(m,l),b=l.index;a[2*b]=y[0],a[2*b+1]=y[1],Array.isArray(_)?(o[3*b]=_[0],o[3*b+1]=_[1],o[3*b+2]=_[2]):o[3*b]=_}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}s.color.values=o,this.setState({positions:a})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(k.isWebGL2)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager();(e.cellSizeChanged||e.viewportChanged)&&(this._updateGridParams(),t.invalidateAll());var n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=M[this.props.aggregation.toUpperCase()]||M.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var f=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),h=f.color.maxData&&Number.isFinite(f.color.maxData[0])?f.color.maxData[0]:0;this.setState({maxWeight:h}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if(ee.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange,Float32Array,255)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,f=c>l?l:0;r.cellScale=new Float32Array([(c-f)/o*2,-(c-f)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new k.Buffer(r,{byteLength:u,accessor:{size:4,type:T.a.FLOAT,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(_.a);ne.layerName="ScreenGridLayer",ne.defaultProps=te;var ie=n(127),re=n(141),ae=function(e){return e.length},oe=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=S()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,P()({},t.i,t))},{})}}]),e}();function se(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function ue(e,t){return function(n){return se(e,t,n)}}function ce(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var le=6378e3;function fe(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(g.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,f=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}var p=function(e,t){var n=(o=e,o/le*(180/Math.PI)),i=(r=t,a=e,a/le*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(p.xOffset<=0||p.yOffset<=0)return{gridHash:{},gridOffset:p};var m={};u.index=-1;var y=!0,_=!1,b=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var E=x.value;u.index++;var P=i(E,u),O=S()(P,2),A=O[0],T=O[1];if(Number.isFinite(T)&&Number.isFinite(A)){var k=Math.floor((T+90)/p.yOffset),C=Math.floor((A+180)/p.xOffset),M="".concat(k,"-").concat(C);m[M]=m[M]||{count:0,points:[]},m[M].count+=1,m[M].points.push(E)}}}catch(e){_=!0,b=e}finally{try{y||null==w.return||w.return()}finally{if(_)throw b}}return{gridHash:m,gridOffset:p}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function he(){}var de={colorDomain:null,colorRange:b,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:he,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:he,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new k.PhongMaterial},ve=["getColorValue","colorAggregation","getColorWeight"],pe=["getElevationValue","elevationAggregation","getElevationWeight"],ge=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:he,elevationScaleFunc:he,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=fe(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new oe(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new oe(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=ue(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=ce(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.fp64,i=e.extruded,r=e.cellSize,a=e.coverage,o=e.material,s=e.transitions;return new(this.getSubLayerClass("grid-cell",re.a))({fp64:n,cellSize:r,coverage:a,material:o,elevationScale:t,extruded:i,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:s&&{getFillColor:s.getColorValue||s.getColorWeight,getElevation:s.getElevationValue||s.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(ie.a);ge.layerName="CPUGridLayer",ge.defaultProps=de;var me=n(108),ye=Math.PI/3,_e=[0,ye,2*ye,3*ye,4*ye,5*ye];function be(e){return e[0]}function xe(e){return e[1]}var we=function(){var e,t,n,i=0,r=0,a=1,o=1,s=be,u=xe;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var p=l-d,g=d+(ly*y+_*_&&(d=g+(1&h?1:-1)/2,h=m)}var b=d+"-"+h,x=r[b];x?x.push(c):(a.push(x=r[b]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return a}function l(e){var t=0,n=0;return _e.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new oe(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new oe(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=ue(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=ce(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.fp64,o=e.transitions,s=this.state,u=s.angle,c=s.radius;return new(this.getSubLayerClass("hexagon-cell",me.a))({fp64:a,radius:c,diskResolution:6,elevationScale:t,angle:u,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(ie.a);Ae.layerName="HexagonLayer",Ae.defaultProps=Pe;var Te,ke=n(23),Ce=n(144),Me=n(81),je={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Le=[je.W,je.SW,je.S],Re=[je.S,je.SE,je.E],Ie=[je.E,je.NE,je.N],Fe=[je.NW,je.W,je.N],Ne=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],De=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Be=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Ue=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],ze=[je.W,je.SW,je.SE,je.E],Ve=[je.S,je.SE,je.NE,je.N],Ge=[je.NW,je.W,je.E,je.NE],We=[je.NW,je.SW,je.S,je.N],He=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],Xe=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],Ye=[je.NW,je.SW,je.SE,je.NE],Ze=[je.NW,je.SW,je.SE,je.E,je.N],qe=[je.W,je.SW,je.SE,je.NE,je.N],Ke=[je.NW,je.W,je.S,je.SE,je.NE],Qe=[je.NW,je.SW,je.S,je.E,je.NE],Je=[je.NW,je.W,[.5,-1/6],[.5,1/6],je.N],$e=[[-1/6,-.5],[1/6,-.5],je.E,je.NE,je.N],et=[[-.5,1/6],[-.5,-1/6],je.S,je.SE,je.E],tt=[je.W,je.SW,je.S,[1/6,.5],[-1/6,.5]],nt=[je.NW,je.W,[-1/6,-.5],[1/6,-.5],je.N],it=[[-.5,1/6],[-.5,-1/6],je.E,je.NE,je.N],rt=[je.S,je.SE,je.E,[1/6,.5],[-1/6,.5]],at=[je.W,je.SW,je.S,[.5,-1/6],[.5,1/6]],ot=[je.W,je.SW,je.SE,je.E,[1/6,.5],[-1/6,.5]],st=[[-.5,1/6],[-.5,-1/6],je.S,je.SE,je.NE,je.N],ut=[je.NW,je.W,[-1/6,-.5],[1/6,-.5],je.E,je.NE],ct=[je.NW,je.SW,je.S,[.5,-1/6],[.5,1/6],je.N],lt=[je.W,je.SW,je.S,je.E,je.NE,je.N],ft=[je.NW,je.W,je.S,je.SE,je.E,je.N],ht=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],je.E,je.NE,je.N],dt=[je.W,je.SW,je.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],vt=[je.NW,je.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],je.N],pt=[[-.5,1/6],[-.5,-1/6],je.S,je.SE,je.E,[1/6,.5],[-1/6,.5]],gt=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],mt={0:[],1:[[je.W,je.S]],2:[[je.S,je.E]],3:[[je.W,je.E]],4:[[je.N,je.E]],5:{0:[[je.W,je.S],[je.N,je.E]],1:[[je.W,je.N],[je.S,je.E]]},6:[[je.N,je.S]],7:[[je.W,je.N]],8:[[je.W,je.N]],9:[[je.N,je.S]],10:{0:[[je.W,je.N],[je.S,je.E]],1:[[je.W,je.S],[je.N,je.E]]},11:[[je.N,je.E]],12:[[je.W,je.E]],13:[[je.S,je.E]],14:[[je.W,je.S]],15:[]};function yt(e){return parseInt(e,4)}var _t=(Te={},P()(Te,yt("0000"),[]),P()(Te,yt("2222"),[]),P()(Te,yt("2221"),[Le]),P()(Te,yt("2212"),[Re]),P()(Te,yt("2122"),[Ie]),P()(Te,yt("1222"),[Fe]),P()(Te,yt("0001"),[Le]),P()(Te,yt("0010"),[Re]),P()(Te,yt("0100"),[Ie]),P()(Te,yt("1000"),[Fe]),P()(Te,yt("2220"),[Ne]),P()(Te,yt("2202"),[De]),P()(Te,yt("2022"),[Be]),P()(Te,yt("0222"),[Ue]),P()(Te,yt("0002"),[Ne]),P()(Te,yt("0020"),[De]),P()(Te,yt("0200"),[Be]),P()(Te,yt("2000"),[Ue]),P()(Te,yt("0011"),[ze]),P()(Te,yt("0110"),[Ve]),P()(Te,yt("1100"),[Ge]),P()(Te,yt("1001"),[We]),P()(Te,yt("2211"),[ze]),P()(Te,yt("2112"),[Ve]),P()(Te,yt("1122"),[Ge]),P()(Te,yt("1221"),[We]),P()(Te,yt("2200"),[He]),P()(Te,yt("2002"),[Xe]),P()(Te,yt("0022"),[He]),P()(Te,yt("0220"),[Xe]),P()(Te,yt("1111"),[Ye]),P()(Te,yt("1211"),[Ze]),P()(Te,yt("2111"),[qe]),P()(Te,yt("1112"),[Ke]),P()(Te,yt("1121"),[Qe]),P()(Te,yt("1011"),[Ze]),P()(Te,yt("0111"),[qe]),P()(Te,yt("1110"),[Ke]),P()(Te,yt("1101"),[Qe]),P()(Te,yt("1200"),[Je]),P()(Te,yt("0120"),[$e]),P()(Te,yt("0012"),[et]),P()(Te,yt("2001"),[tt]),P()(Te,yt("1022"),[Je]),P()(Te,yt("2102"),[$e]),P()(Te,yt("2210"),[et]),P()(Te,yt("0221"),[tt]),P()(Te,yt("1002"),[nt]),P()(Te,yt("2100"),[it]),P()(Te,yt("0210"),[rt]),P()(Te,yt("0021"),[at]),P()(Te,yt("1220"),[nt]),P()(Te,yt("0122"),[it]),P()(Te,yt("2012"),[rt]),P()(Te,yt("2201"),[at]),P()(Te,yt("0211"),[ot]),P()(Te,yt("2110"),[st]),P()(Te,yt("1102"),[ut]),P()(Te,yt("1021"),[ct]),P()(Te,yt("2011"),[ot]),P()(Te,yt("0112"),[st]),P()(Te,yt("1120"),[ut]),P()(Te,yt("1201"),[ct]),P()(Te,yt("2101"),[lt]),P()(Te,yt("0121"),[lt]),P()(Te,yt("1012"),[ft]),P()(Te,yt("1210"),[ft]),P()(Te,yt("0101"),{0:[Le,Ie],1:[lt],2:[lt]}),P()(Te,yt("1010"),{0:[Fe,Re],1:[ft],2:[ft]}),P()(Te,yt("2121"),{0:[lt],1:[lt],2:[Le,Ie]}),P()(Te,yt("1212"),{0:[ft],1:[ft],2:[Fe,Re]}),P()(Te,yt("2120"),{0:[ht],1:[ht],2:[Ne,Ie]}),P()(Te,yt("2021"),{0:[dt],1:[dt],2:[Le,Be]}),P()(Te,yt("1202"),{0:[vt],1:[vt],2:[Fe,De]}),P()(Te,yt("0212"),{0:[pt],1:[pt],2:[Re,Ue]}),P()(Te,yt("0102"),{0:[Ne,Ie],1:[ht],2:[ht]}),P()(Te,yt("0201"),{0:[Le,Be],1:[dt],2:[dt]}),P()(Te,yt("1020"),{0:[Fe,De],1:[vt],2:[vt]}),P()(Te,yt("2010"),{0:[Re,Ue],1:[pt],2:[pt]}),P()(Te,yt("2020"),{0:[Ue,De],1:[gt],2:[Ne,Be]}),P()(Te,yt("0202"),{0:[Be,Ne],1:[gt],2:[Ue,De]}),Te),bt={ISO_LINES:1,ISO_BANDS:2},xt={zIndex:0,zOffset:.005};function wt(e,t){return Array.isArray(t)?e=t?1:0}function Et(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,f=s||u||c||l,h={},d={};s||l?d.top=0:(h.top=t[(i+1)*r+n],d.top=wt(h.top,o)),u||l?d.topRight=0:(h.topRight=t[(i+1)*r+n+1],d.topRight=wt(h.topRight,o)),u||c?d.right=0:(h.right=t[i*r+n+1],d.right=wt(h.right,o)),s||c?d.current=0:(h.current=t[i*r+n],d.current=wt(h.current,o));var v=d.top,p=d.topRight,g=d.right,y=d.current,_=-1;Number.isFinite(o)&&(_=v<<3|p<<2|g<<1|y),Array.isArray(o)&&(_=v<<6|p<<4|g<<2|y);var b=0;return f||(b=wt((h.top+h.topRight+h.right+h.current)/4,o)),{code:_,meanCode:b}}function Pt(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?bt.ISO_LINES:s,c=Object.assign({},xt,e.thresholdData),l=u===bt.ISO_BANDS?_t[a]:mt[a];Array.isArray(l)||(l=l[o]);var f=c.zIndex*c.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+h,p=t[1]+d;if(u===bt.ISO_BANDS){var g=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=p+e[1]*n[1];t.push([i,r,f])}),g.push(t)}),g}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=p+e[1]*n[1];m.push([t,i,f])})}),m}var Ot=n(126),St=n(27),At=p.experimental.count,Tt=k.fp64.fp64LowPart,kt=6378e3;function Ct(e){return Number.isFinite(e)?e:0}function Mt(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,f=void 0===l?St.a.LNGLAT:l,h=e.viewport,d=void 0===h?null:h,v=e.boundingBox,p=void 0===v?null:v,y={};o.dataChanged&&(p=(y=function(e,t,n){var i,r,a=At(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,f=-1/0,h={};for(var d in n)h[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(g.a)(e),p=v.iterable,m=v.objectInfo,y=!0,_=!1,b=void 0;try{for(var x,w=p[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var E=x.value;m.index++;var P=t(E,m),O=m.index;for(var S in r=P[0],i=P[1],o[2*O]=r,o[2*O+1]=i,s[2*O]=Tt(r),s[2*O+1]=Tt(i),n){var A=n[S].getWeight(E);Array.isArray(A)?(h[S].values[3*O]=A[0],h[S].values[3*O+1]=A[1],h[S].values[3*O+2]=A[2]):h[S].values[3*O]=A}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rf?r:f)}}catch(e){_=!0,b=e}finally{try{y||null==w.return||w.return()}finally{if(_)throw b}}var T={xMin:Ct(l),xMax:Ct(f),yMin:Ct(u),yMax:Ct(c)};return{positions:o,positions64xyLow:s,weights:h,boundingBox:T}}(t,n,s)).boundingBox);var _=[i,i],b=[0,0];switch(m.a.assert(f===St.a.LNGLAT||f===St.a.IDENTITY),f){case St.a.LNGLAT:case St.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/kt*(180/Math.PI)),i=(r=t,a=e,a/kt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(p,i);_=[x.xOffset,x.yOffset],b=[-180,-90];break;case St.a.IDENTITY:b=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=jt(o-i[0],n[0])+i[0],c=jt(r-i[1],n[1])+i[1],l=(new Ot.a).translate([-1*u,-1*c,0]),f=[u,c],h=s-o+n[0],d=a-r+n[1],v=[Math.ceil(h/n[0]),Math.ceil(d/n[1])];return{gridOrigin:f,gridSize:v,width:h,height:d,gridTransformMatrix:l}}({boundingBox:p,cellSize:_,worldOrigin:b});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:_,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:_,boundingBox:p}}function jt(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Lt=[255,255,255,255],Rt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},It=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new K(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ce.a(this._getLineLayerProps()),r&&new Me.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=Mt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:f,gridOrigin:h,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n\n // if aggregated color or elevation is 0 do not render\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n // Light calculations\n // Worldspace is the linear space after Mercator projection\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking","fp64"]}}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new k.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new k.CubeGeometry,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,f=n.gridOffset,h=n.colorRange,d=n.elevationRange,v=[Ft(l[0]),Ft(l[1])],p=[Ft(f[0]),Ft(f[1])],g=i.color.maxMinBuffer,m=i.elevation.maxMinBuffer;g.bind({target:T.a.UNIFORM_BUFFER,index:0}),m.bind({target:T.a.UNIFORM_BUFFER,index:1});var y=this.getDomainUniforms();this.state.model.setUniforms(Object.assign({},t,y,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:v,gridOffset:f,gridOffsetLow:p,colorRange:h,elevationRange:d})).draw(),g.unbind({target:T.a.UNIFORM_BUFFER,index:0}),m.unbind({target:T.a.UNIFORM_BUFFER,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(_.a);Bt.layerName="GPUGridCellLayer",Bt.defaultProps=Dt;var Ut={colorDomain:null,colorRange:b,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new k.PhongMaterial,gpuAggregation:!0},zt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=K.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new K(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=K.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=K.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,f=c.getPosition,h=this.state.gridHash;if(!h)h=fe(l,this.props.cellSize,f).gridHash,this.setState({gridHash:h});var d=h[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,f=Mt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:M[s]||M[Ut.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:M[c]||M[Ut.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),h=f.weights,d=f.gridSize,v=f.gridOrigin,p=f.cellSize,g=f.boundingBox;this.setState({weights:h,gridSize:d,gridOrigin:v,cellSize:p,boundingBox:g})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.fp64,i=e.extruded,r=e.cellSize,a=e.coverage,o=e.material,s=e.elevationRange,u=e.colorDomain,c=e.elevationDomain,l=this.state,f=l.weights,h=l.gridSize,d=l.gridOrigin,v=l.cellSize,p=x(this.props.colorRange,Float32Array,255);return new(this.getSubLayerClass("gpu-grid-cell",Bt))({gridSize:h,gridOrigin:d,gridOffset:v,colorRange:p,elevationRange:s,colorDomain:u,elevationDomain:c,fp64:n,cellSize:r,coverage:a,material:o,elevationScale:t,extruded:i},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:f,numInstances:h[0]*h[1]})}}]),t}(ie.a);zt.layerName="GPUGridLayer",zt.defaultProps=Ut;var Vt=Object.assign({},zt.defaultProps,ge.defaultProps,{gpuAggregation:!1}),Gt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",zt):this.getSubLayerClass("CPU",ge))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!K.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(ie.a);Gt.layerName="GridLayer",Gt.defaultProps=Vt,n.d(t,"experimental",function(){return Wt}),n.d(t,"ScreenGridLayer",function(){return ne}),n.d(t,"CPUGridLayer",function(){return ge}),n.d(t,"HexagonLayer",function(){return Ae}),n.d(t,"ContourLayer",function(){return It}),n.d(t,"GridLayer",function(){return Gt}),n.d(t,"GPUGridLayer",function(){return zt}),n.d(t,"AGGREGATION_OPERATION",function(){return M}),n.d(t,"_GPUGridAggregator",function(){return K});var Wt={BinSorter:oe,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:ce,quantizeScale:se,getQuantizeScale:ue,defaultColorRange:b}},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(8),u=n.n(s),c=n(5),l=n.n(c),f=n(18),h=n.n(f),d=n(9),v=n.n(d),p=n(143),g=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return Object.assign({},h()(l()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME great-circle-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\n// get angular distance in radian\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) *\n sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n if(abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n}\n\nvoid main(void) {\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n \n // if it's the first point, use next - current as direction\n // otherwise use current - prev\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n \n vec2 source = radians(instancePositions.xy);\n vec2 target = radians(instancePositions.zw);\n \n float angularDist = getAngularDist(source, target);\n\n vec3 currPos = vec3(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0);\n vec3 nextPos = vec3(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0);\n\n vec2 currPos64Low = mix(instancePositions64Low.xy, instancePositions64Low.zw, segmentRatio);\n vec2 nextPos64Low = mix(instancePositions64Low.xy, instancePositions64Low.zw, nextSegmentRatio);\n\n vec4 curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0));\n vec4 next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n\n // Multiply out width and clamp to limits\n // mercator pixels are interpreted as screen pixels\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n\n // extrude\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels);\n gl_Position = curr + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.0;\n vColor = vec4(color.rgb, color.a * opacity);\n \n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n",modules:["picking","project32"]})}}]),t}(p.a);g.layerName="GreatCircleLayer";var m=n(127),y=n(142),_=n(20),b=n.n(_),x=n(91);var w=180/Math.PI,E=100;function P(e){var t=function(e){var t=e.padEnd(16,"0");return String(parseInt(t,16))}(e),n=function(e){var t=e.substr(e.length-1);return 2*(e.length-1)-(0==(1&t))}(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],f=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,E*Math.pow(2,-c)),d=0;d<4;d++)for(var v=f[d].slice(0),p=f[d+1],g=(p[0]-v[0])/h,m=(p[1]-v[1])/h,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(C.g)([r[0],r[3]],e.scale).map(j),o=b()(a,2),s=o[0],u=o[1],c=Object(C.g)([r[2],r[1]],e.scale).map(j),l=b()(c,2),f=l[0],h=l[1];s=Math.max(0,Math.floor(s)),f=Math.min(e.scale,Math.ceil(f)),u=Math.max(0,Math.floor(u)),h=Math.min(e.scale,Math.ceil(h));for(var d=[],v=s;vt?d.push(L({x:v,y:p,z:i},t)):d.push({x:v,y:p,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),I={renderSubLayers:{type:"function",value:function(e){return new A.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},F=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new R({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new R({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var f=i.viewport,h=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==f.id&&this.state.tileCache.update(f,function(e){var n=e.filter(function(e){return e.z===h}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","gl_FragColor = vColor;":"gl_FragColor.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){h()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),h()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),f=Object(D.a)(a,n,i),h=f.iterable,d=f.objectInfo,v=0,p=0;p180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function Z(e,t,n){var i=e(t,n),r=Object(U.h3ToGeo)(i),a=b()(r,2),o=a[0];return[a[1],o]}function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(U.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(U.h3ToGeo)(e),r=b()(i,2),a=r[0],o=r[1],s=t.length;Y(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(U.edgeLength)(i,U.UNITS.km):0,hasPentagon:r,vertices:null})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(U.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(U.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=q(a),u=Object(U.h3ToGeo)(a),c=b()(u,2),l=c[0],f=c[1],h=e.projectFlat([f,l]),d=b()(h,2),v=d[0],p=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-p)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.fp64,i=e.material,r=e.coverage,a=e.extruded,o=e.wireframe,s=e.stroked,u=e.filled,c=e.lineWidthUnits,l=e.lineWidthScale,f=e.lineWidthMinPixels,h=e.lineWidthMaxPixels,d=e.getColor,v=e.getFillColor,p=e.getElevation,g=e.getLineColor,m=e.getLineWidth,y=e.updateTriggers;return{elevationScale:t,fp64:n,extruded:a,coverage:r,wireframe:o,stroked:s,filled:u,lineWidthUnits:c,lineWidthScale:l,lineWidthMinPixels:f,lineWidthMaxPixels:h,material:i,getElevation:p,getFillColor:d||v,getLineColor:g,getLineWidth:m,updateTriggers:{getFillColor:y.getColor||y.getFillColor,getElevation:y.getElevation,getLineColor:y.getLineColor,getLineWidth:y.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===W()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return q(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",X.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Z.bind(null,n)})}}]),t}(m.a);Q.defaultProps=K,Q.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return g}),n.d(t,"S2Layer",function(){return S}),n.d(t,"TileLayer",function(){return F}),n.d(t,"TripsLayer",function(){return B}),n.d(t,"H3ClusterLayer",function(){return V}),n.d(t,"H3HexagonLayer",function(){return Q})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(33),u=n.n(s);var c=n(102),l=n(138),f=n(139),h=n(140),d=n(8),v=n.n(d),p=n(5),g=n.n(p),m=n(9),y=n.n(m),_=function(e){function t(){return r()(this,t),v()(this,g()(t).apply(this,arguments))}return y()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layers:[]}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps;if(t.data!==n.data||t.configuration!==n.configuration){var i="string"==typeof t.data?JSON.parse(t.data):t.data;this.state.layers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t){var n={};for(var i in e){var r=e[i];i.startsWith("get")?n[i]=F(r,t):n[i]=r}return n}(e,t);return r.fetch=N,i&&new i(r)})}(i,t.configuration)}}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(127).a);function b(e,t){var n=function(e){if("string"==typeof e){var t=w[e];return t||(t=e.split("."),w[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=x(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function x(e){return null!==e&&"object"===u()(e)}_.layerName="JSONLayer",_.defaultProps={configuration:[]};var w={};var E={},P={},O=34,S=10,A=13;function T(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var k=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return P;if(c)return c=!1,E;var t,i,r=o;if(e.charCodeAt(r)===O){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===S?c=!0:i===A&&(c=!0,e.charCodeAt(o)===S&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u])||0;Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var D=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=I(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return D}),n.d(t,"_JSONLayer",function(){return _})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(128);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},f=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":i=e._onPointerMove;break;case"mouseout":i=e._onPointerLeave;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv(),i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),f=new google.maps.Point(0,0),h=a.fromContainerPixelToLatLng(f),d=a.fromLatLngToDivPixel(h),v=(c.x-l.x)/i,p=Math.log2(v)+e.getZoom()-1,g=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(g),y=m.lat(),_=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:p,pitch:e.getTilt(),latitude:y,longitude:_}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,f=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:f?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return f})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(128),u=n(103);function c(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],blendEquation:n.FUNC_ADD},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:l(t)}),i=new s.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:l(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=h(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[f(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function l(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new u.a(Object.assign({x:0,y:0,width:e.width,height:e.height},l(t),n?{nearZMultiplier:e.height?1/e.height:1,farZMultiplier:1}:{nearZMultiplier:.1,farZMultiplier:10}))}function h(e,t){return e.layerManager.getLayers().filter(t)}function d(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function v(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var p=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=c({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),v(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),v(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&v(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=f(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:h(n,function(e){return d(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return p})},function(e,t,n){"use strict";var i=n(4),r=n(6),a=n(59),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()},,function(e,t,n){"use strict";var i=n(42),r=n.n(i),a=n(63),o=n(152),s=n.n(o),u=n(153),c=n.n(u),l=n(22);function f(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}var h=!1,d=!0,v=new Map([["image/png",function(e){var t=y(e);if(t.byteLength<24||2303741511!==t.getUint32(0,h))return null;return{width:t.getUint32(16,h),height:t.getUint32(20,h)}}],["image/jpeg",function(e){var t=y(e);if(t.byteLength<2||65496!==t.getUint16(0,h))return null;var n=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),i=n.tableMarkers,r=n.sofMarkers,a=2;for(;a1&&void 0!==arguments[1]?arguments[1]:null;if(t){var n=v.get(t);if(!n)throw new Error(p);var i=n(e);if(!i)throw new Error("invalid image data for type: ".concat(t));return i}var r=m(e,t);if(!r)throw new Error(p);return r}function m(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=v.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=Object(l.a)(a.value,2),u=s[0],c=(0,s[1])(e);if(c)return c.mimeType=u,c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function y(e){if(f&&(e=f(e)),e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}function _(e,t){return b.apply(this,arguments)}function b(){return(b=Object(a.a)(r.a.mark(function e(t,n){var i,a,o,u,l;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=c.a.promisify(s.a),a=g(t),o=a.mimeType,u=t instanceof Buffer?t:Buffer.from(t),e.next=5,i(u,o);case 5:return l=e.sent,e.abrupt("return",{width:l.shape[0],height:l.shape[1],data:l.data});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}n.d(t,"a",function(){return w});function x(e,t){return _?_(e,t):function(e){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var t=new Blob([new Uint8Array(e)]);return createImageBitmap(t)}(e)}function w(e,t){return E.apply(this,arguments)}function E(){return(E=Object(a.a)(r.a.mark(function e(t,n){var i,a;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof Image){e.next=8;break}return e.next=3,fetch(t,n);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return a=e.sent,e.abrupt("return",x(a));case 8:return e.next=10,P(t,n);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function P(e,t){return O.apply(this,arguments)}function O(){return(O=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}}])}); +!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),f="function",h=Math.round,d=Math.abs,v=Date.now;function g(e,t,n){return setTimeout(w(e,n),t)}function p(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function L(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==B&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(f=o.pointers,h=i,oe(h[0],h[1],$)/oe(f[0],f[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>z||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,f=re(u,c,l);i=f.x,r=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var f,h;var g=e.element;j(t.srcEvent.target,g)&&(g=t.srcEvent.target);t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?q:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(F(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(F(this.element),this.evWin,this.domHandler)}};var ue={mousedown:B,mousemove:U,mouseup:V},ce="mousedown",le="mousemove mouseup";function fe(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(fe,ee,{handler:function(e){var t=ue[e.type];t&B&&0===e.button&&(this.pressed=!0),t&U&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:B,pointermove:U,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",ge="pointermove pointerup pointercancel";function pe(){this.evEl=ve,this.evWin=ge,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",ge="MSPointerMove MSPointerUp MSPointerCancel"),x(pe,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=he[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=A(t,e.pointerId,"pointerId");r&B&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:B,touchmove:U,touchend:V,touchcancel:G},ye="touchstart",be="touchstart touchmove touchend touchcancel";function _e(){this.evTarget=ye,this.evWin=be,this.started=!1,ee.apply(this,arguments)}x(_e,ee,{handler:function(e){var t=me[e.type];if(t===B&&(this.started=!0),this.started){var n=function(e,t){var n=T(e.touches),i=T(e.changedTouches);t&(V|G)&&(n=M(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:B,touchmove:U,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Pe(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Pe,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=T(e.touches),i=this.targetIds;if(t&(B|U)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=T(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return j(e.target,u)}),t===B)for(r=0;r-1&&i.splice(e,1)},Oe)}}x(Se,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,je.call(this,t)):e&(V|G)&&je.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Be&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return qe.prototype.attrTest.call(this,e)&&(this.state&De||!(this.state&De)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ye,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&De)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Qe,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&B)this.reset(),this._timer=g(function(){this.state=Ue,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ue;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ue&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Ke,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&De)}}),x(Je,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|Q,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|Q)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&Q&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(179);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var i=function(e){"use strict";var t,n=Object.prototype,i=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function u(e,t,n,i){var r=t&&t.prototype instanceof g?t:g,a=Object.create(r.prototype),o=new j(i||[]);return a._invoke=function(e,t,n){var i=l;return function(r,a){if(i===h)throw new Error("Generator is already running");if(i===d){if("throw"===r)throw a;return E()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=O(o,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===l)throw i=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=h;var u=c(e,t,n);if("normal"===u.type){if(i=n.done?d:f,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=d,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",f="suspendedYield",h="executing",d="completed",v={};function g(){}function p(){}function m(){}var y={};y[a]=function(){return this};var b=Object.getPrototypeOf,_=b&&b(b(C([])));_&&_!==n&&i.call(_,a)&&(y=_);var x=m.prototype=g.prototype=Object.create(y);function w(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function P(e){var t;this._invoke=function(n,r){function a(){return new Promise(function(t,a){!function t(n,r,a,o){var s=c(e[n],e,r);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(l).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,r,t,a)})}return t=t?t.then(a,a):a()}}function O(e,n){var i=e.iterator[n.method];if(i===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=c(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,v;var a=r.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function C(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function n(){for(;++r=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;S(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:C(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(70),p=n(79),m=n(1),y=n(15),b=n.n(y);function _(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function x(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var a=e.apply(t,n);function o(e){_(a,i,r,o,s,"next",e)}function s(e){_(a,i,r,o,s,"throw",e)}o(void 0)})}}var w=n(89);function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{}),!X(t)){e.next=4;break}return e.abrupt("return",Promise.resolve(W(t)));case 4:if(!q(t)){e.next=6;break}return e.abrupt("return",new Promise(function(e,i){n=O({},new URL(t),n),(t.startsWith("https:")?L.a.request:T.a.request)(t,function(t){return G(t).then(e,i)})}));case 6:return i=F.a.promisify(E.a.readFile),e.next=9,i(t,n);case 9:return r=e.sent,e.abrupt("return",r instanceof Buffer?B(r):r);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ee(e,t){return te.apply(this,arguments)}function te(){return(te=x(b.a.mark(function e(t,n){return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!X(t)){e.next=2;break}return e.abrupt("return",W(t));case 2:if(q(t)){e.next=4;break}return e.abrupt("return",E.a.createReadStream(t,n));case 4:return e.abrupt("return",new Promise(function(e,i){n=O({},new URL(t),n),(t.startsWith("https:")?L.a.request:T.a.request)(t,function(t){return e(t)})}));case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e=Object.assign({},H,e)).responseType=e.responseType||e.dataType,E.a&&(e.encoding=e.encoding||("text"===e.dataType?"utf8":null)),e}function ie(e,t){return re.apply(this,arguments)}function re(){return(re=x(b.a.mark(function e(t,n){return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}var ae="",oe={};function se(e){for(var t in oe)if(e.startsWith(t)){var n=oe[t];return e.replace(t,n)}return e+=ae}function ue(e,t){return ce.apply(this,arguments)}function ce(){return(ce=x(b.a.mark(function e(t,n){var i;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=se(t),i=w.a?ie:Q,e.abrupt("return",i(t,n));case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function le(e){return!!e&&(Array.isArray(e)&&(e=e[0]),e.parseTextSync||e.parseSync||e.parse||e.loadAndParse||e.parseStream||e.parseInBatches||e.worker)}function fe(e){var t;return R(le(e)),Array.isArray(e)&&(t=(e=e[0])[1],e=O({},e,{options:O({},e.options,{options:t})})),e.extension&&(e.extensions=e.extensions||[e.extension],delete e.extension),Array.isArray(e.extensions)||(e.extensions=[e.extensions]),R(e.extensions&&e.extensions.length>0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}var he=/[^\.]+$/;function de(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=e.match(he);if(i&&i[0]){var r=function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;fe(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,i[0]);if(r)return r}var a=function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s.testText&&s.testText(t))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,t);return a||null}var ve=function(){function e(){k(this,e)}return j(e,[{key:"log",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}}]),e}(),ge={};function pe(){return Object.values(ge)}var me=new Map;function ye(e,t,n){var i=function(e){var t=me.get(e);if(!t){var n=new Blob([e],{type:"application/javascript"});t=URL.createObjectURL(n),me.set(e,t)}return new Worker(t)}(e);n=function(e){null!==(e=Object.assign({},e)).log&&delete e.log;return e}(n);var r=function(e,t){return new Promise(function(n,r){i.onmessage=function(e){switch(e.data.type){case"done":n(e.data.result),i.terminate();break;case"error":r(new Error(e.data.message))}};var a=B(e);i.postMessage({arraybuffer:a,opts:t},[a])})};return t?r(t,n):r}n(123);var be=function(e){return"undefined"!=typeof window&&e instanceof window.Response||e.arrayBuffer&&e.json&&e.body},_e="Cannot convert supplied data type";function xe(e){return be(e)?e.url:null}function we(e,t){if(t.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){var n=e.buffer||e;return t.text&&!t.binary?new N.TextDecoder("utf8").decode(n):n}throw new Error(_e)}function Pe(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=x(b.a.mark(function e(t,n){var i;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(t=e.sent,i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=6;break}return e.abrupt("return",we(t,n));case 6:if(!be(t)){e.next=15;break}if(!n.binary){e.next=13;break}return e.next=10,t.arrayBuffer();case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0=t.text();case 14:return e.abrupt("return",e.t0);case 15:throw new Error(_e);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ke(e,t){return Se.apply(this,arguments)}function Se(){return(Se=x(b.a.mark(function e(t,n){var i,r,a=arguments;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>2&&void 0!==a[2]?a[2]:{},r=(r=a.length>3?a[3]:void 0)||xe(t),e.next=5,Pe(t,n);case 5:if(t=e.sent,!n.parseTextSync||"string"!=typeof t){e.next=9;break}return i.dataType="text",e.abrupt("return",n.parseTextSync(t,i,r,n));case 9:if(!n.parseSync){e.next=11;break}return e.abrupt("return",n.parseSync(t,i,r,n));case 11:if(!n.parse){e.next=15;break}return e.next=14,n.parse(t,i,r,n);case 14:return e.abrupt("return",e.sent);case 15:if(!n.worker){e.next=19;break}return e.next=18,ye(n.worker,t,i);case 18:return e.abrupt("return",e.sent);case 19:return e.abrupt("return",R(!1));case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function je(e,t,n,i){return Ce.apply(this,arguments)}function Ce(){return(Ce=x(b.a.mark(function e(t,n,i,r){var a;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||le(n)||(r=i,i=n,n=null),n=n||pe(),a=Array.isArray(n)?de(r,t,n):n){e.next=5;break}return e.abrupt("return",null);case 5:return fe(a),i=Ee(i,a),e.next=9,ke(t,a,i,r);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ee(e,t){return null===(e=Object.assign({},t.DEFAULT_OPTIONS,t.options,e,{dataType:"arraybuffer"})).log&&(e.log=new ve),"log"in e||(e.log=console),e}function Ae(e,t,n){return Te.apply(this,arguments)}function Te(){return(Te=x(b.a.mark(function e(t,n,i){var r,a;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||le(n)||(i=n,n=null),n=n||pe(),!(r=Array.isArray(n)?de(t,null,n):n)||!r.loadAndParse){e.next=7;break}return e.next=6,r.loadAndParse(t,i);case 6:return e.abrupt("return",e.sent);case 7:return e.next=9,ue(t,i);case 9:return a=e.sent,e.abrupt("return",je(a,n,i,t));case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Me=n(189),Le=Math.PI/180,Ie=new Float32Array(16),Fe=new Float32Array(12);function Re(e,t,n){var i=t[0]*Le,r=t[1]*Le,a=t[2]*Le,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),f=Math.cos(r),h=n[0],d=n[1],v=n[2];e[0]=h*f*l,e[1]=h*u*l,e[2]=h*-s,e[3]=d*(-u*c+f*s*o),e[4]=d*(f*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+f*s*c),e[7]=v*(-f*o+u*s*c),e[8]=v*l*c}function Ne(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var De={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),f=l&&16===c.length,h=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),p=f||!l&&Boolean(c(a[0]));e.constant=p?f:d&&h&&v;var m=e.value;if(e.constant){var y;if(p)Ie.set(c),y=Ne(Ie);else Re(y=Fe,o,s),y.set(u,9);e.value=new Float32Array(y)}else{var b=n*e.size,_=Object(g.a)(a,n,i),x=_.iterable,w=_.objectInfo,P=!0,O=!1,k=void 0;try{for(var S,j=x[Symbol.iterator]();!(P=(S=j.next()).done);P=!0){var C=S.value;w.index++;var E=void 0;if(p)Ie.set(f?c:c(C,w)),E=Ne(Ie);else Re(E=Fe,d?o:o(C,w),h?s:s(C,w)),E.set(v?u:u(C,w),9);m[b++]=E[0],m[b++]=E[1],m[b++]=E[2],m[b++]=E[3],m[b++]=E[4],m[b++]=E[5],m[b++]=E[6],m[b++]=E[7],m[b++]=E[8],m[b++]=E[9],m[b++]=E[10],m[b++]=E[11]}}catch(e){O=!0,k=e}finally{try{P||null==j.return||j.return()}finally{if(O)throw k}}}}},ze=m.fp64.fp64LowPart;function Be(e,t,n){return t instanceof m.Texture2D?t:new m.Texture2D(e,Object.assign({data:t},n))}function Ue(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function Ve(e){if(e.attributes)return Ue(e.attributes),e instanceof m.Geometry?e:new m.Geometry(e);if(e.positions||e.POSITION)return Ue(e),new m.Geometry({attributes:e});throw Error("Invalid mesh")}var Ge=new m.PhongMaterial,We={fetch:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){return"mesh"===t.propName?Ae(e):fetch(e).then(function(e){return e.json()})}),mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},fp64:!1,wireframe:!1,material:Ge,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},He=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=this.use64bitProjection()?"project64":"project32",t=Object(m.isWebGL2)(this.context.gl);return{vs:t?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n",fs:t?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor / 255., color.a);\n fragColor = picking_filterHighlightColor(fragColor);\n fragColor = picking_filterPickingColor(fragColor);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor / 255., color.a);\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[e,"phong-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{transition:!0,size:4,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:De}),this.setState({emptyTexture:new m.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||n.fp64!==i.fp64){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new m.Model(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:Ve(e),isInstanced:!0,shaderCache:this.context.shaderCache}));return this.state.texture?t.setUniforms({sampler:this.state.texture,hasTexture:1}):t.setUniforms({sampler:this.state.emptyTexture,hasTexture:0}),t}},{key:"setTexture",value:function(e){var t=this,n=this.context.gl,i=this.state.emptyTexture;this.state.texture&&this.state.texture.delete(),e?function(e,t,n){return"string"==typeof t?Object(Me.a)(t).then(function(t){return Be(e,t,n)}).catch(function(e){throw new Error("Could not load texture from ".concat(t,": ").concat(e))}):new Promise(function(i){return i(Be(e,t,n))})}(n,e).then(function(e){t.setState({texture:e}),t.state.model&&t.state.model.setUniforms({sampler:t.state.texture,hasTexture:1})}):(this.setState({texture:null}),this.state.model&&this.state.model.setUniforms({sampler:i,hasTexture:0}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=s(b,h);u[c++]=ze(_[0]),u[c++]=ze(_[1])}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}else e.value=new Float32Array(2)}}]),t}(p.a);He.layerName="SimpleMeshLayer",He.defaultProps=We;var Xe=m.fp64.fp64LowPart,qe=[255,255,255,255],Ze={scenegraph:{type:"object",value:null,async:!0},fetch:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){var n=t.propName,i=t.layer;return"scenegraph"===n?Ae(e,i.getLoadOptions()):fetch(e).then(function(e){return e.json()})}),getScene:function(e){return e&&e.scenes?e.scenes[0]:e},getAnimator:function(e){return e&&e.animator},sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:qe},_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:[]}},Ye=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{size:4,accessor:"getColor",defaultValue:qe,transition:!0},instanceModelMatrix:De})}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=s(b,h);u[c++]=Xe(_[0]),u[c++]=Xe(_[1])}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}else e.value=new Float32Array(2)}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;if(n.scenegraph!==i.scenegraph){var r=n.getScene(n.scenegraph),a=n.getAnimator(n.scenegraph);r instanceof m.ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,a,n._animations),this.setState({scenegraph:r,animator:a})):null!==r&&m.log.warn("invalid scenegraph:",r)()}else n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){this._deleteScenegraph()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&re?t:e}function M(e,t){return t2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(j.isWebGL2)(t)&&Object(j.hasFeatures)(this.gl,j.FEATURES.BLEND_EQUATION_MINMAX,j.FEATURES.COLOR_ATTACHMENT_RGBA32F,j.FEATURES.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.info("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,q){var r=q[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},F,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,I)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||U,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},B,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,f=0;f=0&&O=0&&k0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new j.Model(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n pos = floor(pos / cellSize);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?["fp64","project64"]:["project32"],shaderCache:n,vertexCount:0,drawMode:0})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new j.Model(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:["fp64"],shaderCache:t,vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new j.Transform(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,h=a.weights,d=[o,s],v={blend:!0,depthTest:!1,blendFunc:[1,1]},g={viewport:n},p={windowSize:u,cellSize:t,gridSize:d,uProjectionMatrix:i,uProjectionMatrixFP64:H(i),projectPoints:r};for(var m in h){var y=h[m],b=y.needMin,_=y.needMax,x=b&&_&&h[m].combineMaxMin;this.renderToWeightsTexture({id:m,parameters:v,moduleSettings:g,uniforms:p,gridSize:d}),x?this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:D}),gridSize:d,minOrMaxFb:c[m],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:x}):(b&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:R}),gridSize:d,minOrMaxFb:l[m],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:x}),_&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:N}),gridSize:d,minOrMaxFb:f[m],combineMaxMin:x}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(j.withParameters)(c,s,function(){c.clear(16384)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,f=this.gl,h=this.gridAggregationModel,d=l[t].operation;s[t].bind(),f.viewport(0,0,a[0],a[1]);var v=d===E.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(j.withParameters)(f,{clearColor:v},function(){f.clear(16384)});var g={weights:c[t]};if(h.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:g}),s[t].unbind(),d===E.MEAN){var p=this.state,m=p.meanTextures,y=p.textures,b={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(b).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(O()({},36064,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,f=t.equations,h=t.weights,d={width:n,height:i};for(var v in h){var g=h[v],p=g.needMin,m=g.needMax,y=g.combineMaxMin,b=g.operation;r[v]=h[v].aggregationTexture||r[v]||V(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var _=r[v];b===E.MEAN&&(l[v]=l[v]||V(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),_=l[v]),a[v]?a[v].attach(O()({},36064,_)):a[v]=G(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:_}),a[v].resize(d),f[v]=z[b],(p||m)&&(p&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=V(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=G(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(p&&(s[v]||(c["".concat(v,"-min")]=V(this.gl,{id:"".concat(v,"-minTex")}),s[v]=G(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=V(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=G(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof j.Buffer?n[o].setData(u):(a["".concat(o,"-buffer")]=new j.Buffer(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof j.Buffer),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],e}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:E.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new Z(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&this._updateAggregation(n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||Q,o=this.props.maxColor||K,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,f=u.cellScale,h=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,g={minColor:a,maxColor:o,cellScale:f,colorRange:d,colorDomain:s,shouldUseMinMax:h};Object(j.isWebGL2)(n)?l.bind({target:35345}):g.maxWeight=v,t=Object.assign(g,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(j.isWebGL2)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=Z.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new j.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new j.Geometry({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new j.Buffer(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=Y(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(p.a)(t),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var m=v.value;l.index++;var y=n(m,l),b=i(m,l),_=l.index;a[2*_]=y[0],a[2*_+1]=y[1],Array.isArray(b)?(o[3*_]=b[0],o[3*_+1]=b[1],o[3*_+2]=b[2]):o[3*_]=b}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}s.color.values=o,this.setState({positions:a})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(j.isWebGL2)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager();(e.cellSizeChanged||e.viewportChanged)&&(this._updateGridParams(),t.invalidateAll());var n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=E[this.props.aggregation.toUpperCase()]||E.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var f=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),h=f.color.maxData&&Number.isFinite(f.color.maxData[0])?f.color.maxData[0]:0;this.setState({maxWeight:h}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if(J.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange,Float32Array,255)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,f=c>l?l:0;r.cellScale=new Float32Array([(c-f)/o*2,-(c-f)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new j.Buffer(r,{byteLength:u,accessor:{size:4,type:5126,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(b.a);ee.layerName="ScreenGridLayer",ee.defaultProps=$;var te=n(126),ne=n(140),ie=function(e){return e.length},re=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ie;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=S()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,O()({},t.i,t))},{})}}]),e}();function ae(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function oe(e,t){return function(n){return ae(e,t,n)}}function se(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var ue=6378e3;function ce(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(p.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,f=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}var g=function(e,t){var n=(o=e,o/ue*(180/Math.PI)),i=(r=t,a=e,a/ue*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(g.xOffset<=0||g.yOffset<=0)return{gridHash:{},gridOffset:g};var m={};u.index=-1;var y=!0,b=!1,_=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var P=x.value;u.index++;var O=i(P,u),k=S()(O,2),j=k[0],C=k[1];if(Number.isFinite(C)&&Number.isFinite(j)){var E=Math.floor((C+90)/g.yOffset),A=Math.floor((j+180)/g.xOffset),T="".concat(E,"-").concat(A);m[T]=m[T]||{count:0,points:[]},m[T].count+=1,m[T].points.push(P)}}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}return{gridHash:m,gridOffset:g}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function le(){}var fe={colorDomain:null,colorRange:_,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:le,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:le,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new j.PhongMaterial},he=["getColorValue","colorAggregation","getColorWeight"],de=["getElevationValue","elevationAggregation","getElevationWeight"],ve=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:le,elevationScaleFunc:le,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=ce(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new re(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new re(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=oe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=se(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.fp64,i=e.extruded,r=e.cellSize,a=e.coverage,o=e.material,s=e.transitions;return new(this.getSubLayerClass("grid-cell",ne.a))({fp64:n,cellSize:r,coverage:a,material:o,elevationScale:t,extruded:i,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:s&&{getFillColor:s.getColorValue||s.getColorWeight,getElevation:s.getElevationValue||s.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(te.a);ve.layerName="CPUGridLayer",ve.defaultProps=fe;var ge=n(107),pe=Math.PI/3,me=[0,pe,2*pe,3*pe,4*pe,5*pe];function ye(e){return e[0]}function be(e){return e[1]}var _e=function(){var e,t,n,i=0,r=0,a=1,o=1,s=ye,u=be;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var g=l-d,p=d+(ly*y+b*b&&(d=p+(1&h?1:-1)/2,h=m)}var _=d+"-"+h,x=r[_];x?x.push(c):(a.push(x=r[_]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return a}function l(e){var t=0,n=0;return me.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new re(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new re(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=oe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=se(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.fp64,o=e.transitions,s=this.state,u=s.angle,c=s.radius;return new(this.getSubLayerClass("hexagon-cell",ge.a))({fp64:a,radius:c,diskResolution:6,elevationScale:t,angle:u,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(te.a);ke.layerName="HexagonLayer",ke.defaultProps=we;var Se,je=n(22),Ce=n(143),Ee=n(80),Ae={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Te=[Ae.W,Ae.SW,Ae.S],Me=[Ae.S,Ae.SE,Ae.E],Le=[Ae.E,Ae.NE,Ae.N],Ie=[Ae.NW,Ae.W,Ae.N],Fe=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],Re=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Ne=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],De=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],ze=[Ae.W,Ae.SW,Ae.SE,Ae.E],Be=[Ae.S,Ae.SE,Ae.NE,Ae.N],Ue=[Ae.NW,Ae.W,Ae.E,Ae.NE],Ve=[Ae.NW,Ae.SW,Ae.S,Ae.N],Ge=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],We=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],He=[Ae.NW,Ae.SW,Ae.SE,Ae.NE],Xe=[Ae.NW,Ae.SW,Ae.SE,Ae.E,Ae.N],qe=[Ae.W,Ae.SW,Ae.SE,Ae.NE,Ae.N],Ze=[Ae.NW,Ae.W,Ae.S,Ae.SE,Ae.NE],Ye=[Ae.NW,Ae.SW,Ae.S,Ae.E,Ae.NE],Qe=[Ae.NW,Ae.W,[.5,-1/6],[.5,1/6],Ae.N],Ke=[[-1/6,-.5],[1/6,-.5],Ae.E,Ae.NE,Ae.N],Je=[[-.5,1/6],[-.5,-1/6],Ae.S,Ae.SE,Ae.E],$e=[Ae.W,Ae.SW,Ae.S,[1/6,.5],[-1/6,.5]],et=[Ae.NW,Ae.W,[-1/6,-.5],[1/6,-.5],Ae.N],tt=[[-.5,1/6],[-.5,-1/6],Ae.E,Ae.NE,Ae.N],nt=[Ae.S,Ae.SE,Ae.E,[1/6,.5],[-1/6,.5]],it=[Ae.W,Ae.SW,Ae.S,[.5,-1/6],[.5,1/6]],rt=[Ae.W,Ae.SW,Ae.SE,Ae.E,[1/6,.5],[-1/6,.5]],at=[[-.5,1/6],[-.5,-1/6],Ae.S,Ae.SE,Ae.NE,Ae.N],ot=[Ae.NW,Ae.W,[-1/6,-.5],[1/6,-.5],Ae.E,Ae.NE],st=[Ae.NW,Ae.SW,Ae.S,[.5,-1/6],[.5,1/6],Ae.N],ut=[Ae.W,Ae.SW,Ae.S,Ae.E,Ae.NE,Ae.N],ct=[Ae.NW,Ae.W,Ae.S,Ae.SE,Ae.E,Ae.N],lt=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],Ae.E,Ae.NE,Ae.N],ft=[Ae.W,Ae.SW,Ae.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],ht=[Ae.NW,Ae.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],Ae.N],dt=[[-.5,1/6],[-.5,-1/6],Ae.S,Ae.SE,Ae.E,[1/6,.5],[-1/6,.5]],vt=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],gt={0:[],1:[[Ae.W,Ae.S]],2:[[Ae.S,Ae.E]],3:[[Ae.W,Ae.E]],4:[[Ae.N,Ae.E]],5:{0:[[Ae.W,Ae.S],[Ae.N,Ae.E]],1:[[Ae.W,Ae.N],[Ae.S,Ae.E]]},6:[[Ae.N,Ae.S]],7:[[Ae.W,Ae.N]],8:[[Ae.W,Ae.N]],9:[[Ae.N,Ae.S]],10:{0:[[Ae.W,Ae.N],[Ae.S,Ae.E]],1:[[Ae.W,Ae.S],[Ae.N,Ae.E]]},11:[[Ae.N,Ae.E]],12:[[Ae.W,Ae.E]],13:[[Ae.S,Ae.E]],14:[[Ae.W,Ae.S]],15:[]};function pt(e){return parseInt(e,4)}var mt=(Se={},O()(Se,pt("0000"),[]),O()(Se,pt("2222"),[]),O()(Se,pt("2221"),[Te]),O()(Se,pt("2212"),[Me]),O()(Se,pt("2122"),[Le]),O()(Se,pt("1222"),[Ie]),O()(Se,pt("0001"),[Te]),O()(Se,pt("0010"),[Me]),O()(Se,pt("0100"),[Le]),O()(Se,pt("1000"),[Ie]),O()(Se,pt("2220"),[Fe]),O()(Se,pt("2202"),[Re]),O()(Se,pt("2022"),[Ne]),O()(Se,pt("0222"),[De]),O()(Se,pt("0002"),[Fe]),O()(Se,pt("0020"),[Re]),O()(Se,pt("0200"),[Ne]),O()(Se,pt("2000"),[De]),O()(Se,pt("0011"),[ze]),O()(Se,pt("0110"),[Be]),O()(Se,pt("1100"),[Ue]),O()(Se,pt("1001"),[Ve]),O()(Se,pt("2211"),[ze]),O()(Se,pt("2112"),[Be]),O()(Se,pt("1122"),[Ue]),O()(Se,pt("1221"),[Ve]),O()(Se,pt("2200"),[Ge]),O()(Se,pt("2002"),[We]),O()(Se,pt("0022"),[Ge]),O()(Se,pt("0220"),[We]),O()(Se,pt("1111"),[He]),O()(Se,pt("1211"),[Xe]),O()(Se,pt("2111"),[qe]),O()(Se,pt("1112"),[Ze]),O()(Se,pt("1121"),[Ye]),O()(Se,pt("1011"),[Xe]),O()(Se,pt("0111"),[qe]),O()(Se,pt("1110"),[Ze]),O()(Se,pt("1101"),[Ye]),O()(Se,pt("1200"),[Qe]),O()(Se,pt("0120"),[Ke]),O()(Se,pt("0012"),[Je]),O()(Se,pt("2001"),[$e]),O()(Se,pt("1022"),[Qe]),O()(Se,pt("2102"),[Ke]),O()(Se,pt("2210"),[Je]),O()(Se,pt("0221"),[$e]),O()(Se,pt("1002"),[et]),O()(Se,pt("2100"),[tt]),O()(Se,pt("0210"),[nt]),O()(Se,pt("0021"),[it]),O()(Se,pt("1220"),[et]),O()(Se,pt("0122"),[tt]),O()(Se,pt("2012"),[nt]),O()(Se,pt("2201"),[it]),O()(Se,pt("0211"),[rt]),O()(Se,pt("2110"),[at]),O()(Se,pt("1102"),[ot]),O()(Se,pt("1021"),[st]),O()(Se,pt("2011"),[rt]),O()(Se,pt("0112"),[at]),O()(Se,pt("1120"),[ot]),O()(Se,pt("1201"),[st]),O()(Se,pt("2101"),[ut]),O()(Se,pt("0121"),[ut]),O()(Se,pt("1012"),[ct]),O()(Se,pt("1210"),[ct]),O()(Se,pt("0101"),{0:[Te,Le],1:[ut],2:[ut]}),O()(Se,pt("1010"),{0:[Ie,Me],1:[ct],2:[ct]}),O()(Se,pt("2121"),{0:[ut],1:[ut],2:[Te,Le]}),O()(Se,pt("1212"),{0:[ct],1:[ct],2:[Ie,Me]}),O()(Se,pt("2120"),{0:[lt],1:[lt],2:[Fe,Le]}),O()(Se,pt("2021"),{0:[ft],1:[ft],2:[Te,Ne]}),O()(Se,pt("1202"),{0:[ht],1:[ht],2:[Ie,Re]}),O()(Se,pt("0212"),{0:[dt],1:[dt],2:[Me,De]}),O()(Se,pt("0102"),{0:[Fe,Le],1:[lt],2:[lt]}),O()(Se,pt("0201"),{0:[Te,Ne],1:[ft],2:[ft]}),O()(Se,pt("1020"),{0:[Ie,Re],1:[ht],2:[ht]}),O()(Se,pt("2010"),{0:[Me,De],1:[dt],2:[dt]}),O()(Se,pt("2020"),{0:[De,Re],1:[vt],2:[Fe,Ne]}),O()(Se,pt("0202"),{0:[Ne,Fe],1:[vt],2:[De,Re]}),Se),yt={ISO_LINES:1,ISO_BANDS:2},bt={zIndex:0,zOffset:.005};function _t(e,t){return Array.isArray(t)?e=t?1:0}function xt(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,f=s||u||c||l,h={},d={};s||l?d.top=0:(h.top=t[(i+1)*r+n],d.top=_t(h.top,o)),u||l?d.topRight=0:(h.topRight=t[(i+1)*r+n+1],d.topRight=_t(h.topRight,o)),u||c?d.right=0:(h.right=t[i*r+n+1],d.right=_t(h.right,o)),s||c?d.current=0:(h.current=t[i*r+n],d.current=_t(h.current,o));var v=d.top,g=d.topRight,p=d.right,y=d.current,b=-1;Number.isFinite(o)&&(b=v<<3|g<<2|p<<1|y),Array.isArray(o)&&(b=v<<6|g<<4|p<<2|y);var _=0;return f||(_=_t((h.top+h.topRight+h.right+h.current)/4,o)),{code:b,meanCode:_}}function wt(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?yt.ISO_LINES:s,c=Object.assign({},bt,e.thresholdData),l=u===yt.ISO_BANDS?mt[a]:gt[a];Array.isArray(l)||(l=l[o]);var f=c.zIndex*c.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+h,g=t[1]+d;if(u===yt.ISO_BANDS){var p=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=g+e[1]*n[1];t.push([i,r,f])}),p.push(t)}),p}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=g+e[1]*n[1];m.push([t,i,f])})}),m}var Pt=n(125),Ot=n(26),kt=g.experimental.count,St=j.fp64.fp64LowPart,jt=6378e3;function Ct(e){return Number.isFinite(e)?e:0}function Et(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,f=void 0===l?Ot.a.LNGLAT:l,h=e.viewport,d=void 0===h?null:h,v=e.boundingBox,g=void 0===v?null:v,y={};o.dataChanged&&(g=(y=function(e,t,n){var i,r,a=kt(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,f=-1/0,h={};for(var d in n)h[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(p.a)(e),g=v.iterable,m=v.objectInfo,y=!0,b=!1,_=void 0;try{for(var x,w=g[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var P=x.value;m.index++;var O=t(P,m),k=m.index;for(var S in r=O[0],i=O[1],o[2*k]=r,o[2*k+1]=i,s[2*k]=St(r),s[2*k+1]=St(i),n){var j=n[S].getWeight(P);Array.isArray(j)?(h[S].values[3*k]=j[0],h[S].values[3*k+1]=j[1],h[S].values[3*k+2]=j[2]):h[S].values[3*k]=j}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rf?r:f)}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var C={xMin:Ct(l),xMax:Ct(f),yMin:Ct(u),yMax:Ct(c)};return{positions:o,positions64xyLow:s,weights:h,boundingBox:C}}(t,n,s)).boundingBox);var b=[i,i],_=[0,0];switch(m.a.assert(f===Ot.a.LNGLAT||f===Ot.a.IDENTITY),f){case Ot.a.LNGLAT:case Ot.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/jt*(180/Math.PI)),i=(r=t,a=e,a/jt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(g,i);b=[x.xOffset,x.yOffset],_=[-180,-90];break;case Ot.a.IDENTITY:_=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=At(o-i[0],n[0])+i[0],c=At(r-i[1],n[1])+i[1],l=(new Pt.a).translate([-1*u,-1*c,0]),f=[u,c],h=s-o+n[0],d=a-r+n[1],v=[Math.ceil(h/n[0]),Math.ceil(d/n[1])];return{gridOrigin:f,gridSize:v,width:h,height:d,gridTransformMatrix:l}}({boundingBox:g,cellSize:b,worldOrigin:_});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:b,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:b,boundingBox:g}}function At(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Tt=[255,255,255,255],Mt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},Lt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new Z(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ce.a(this._getLineLayerProps()),r&&new Ee.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=Et({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:f,gridOrigin:h,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking","fp64"]}}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new j.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new j.CubeGeometry,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,f=n.gridOffset,h=n.colorRange,d=n.elevationRange,v=[It(l[0]),It(l[1])],g=[It(f[0]),It(f[1])],p=i.color.maxMinBuffer,m=i.elevation.maxMinBuffer;p.bind({target:35345,index:0}),m.bind({target:35345,index:1});var y=this.getDomainUniforms();this.state.model.setUniforms(Object.assign({},t,y,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:v,gridOffset:f,gridOffsetLow:g,colorRange:h,elevationRange:d})).draw(),p.unbind({target:35345,index:0}),m.unbind({target:35345,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(b.a);Nt.layerName="GPUGridCellLayer",Nt.defaultProps=Rt;var Dt={colorDomain:null,colorRange:_,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new j.PhongMaterial,gpuAggregation:!0},zt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=Z.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new Z(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=Z.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=Z.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,f=c.getPosition,h=this.state.gridHash;if(!h)h=ce(l,this.props.cellSize,f).gridHash,this.setState({gridHash:h});var d=h[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,f=Et({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:E[s]||E[Dt.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:E[c]||E[Dt.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),h=f.weights,d=f.gridSize,v=f.gridOrigin,g=f.cellSize,p=f.boundingBox;this.setState({weights:h,gridSize:d,gridOrigin:v,cellSize:g,boundingBox:p})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.fp64,i=e.extruded,r=e.cellSize,a=e.coverage,o=e.material,s=e.elevationRange,u=e.colorDomain,c=e.elevationDomain,l=this.state,f=l.weights,h=l.gridSize,d=l.gridOrigin,v=l.cellSize,g=x(this.props.colorRange,Float32Array,255);return new(this.getSubLayerClass("gpu-grid-cell",Nt))({gridSize:h,gridOrigin:d,gridOffset:v,colorRange:g,elevationRange:s,colorDomain:u,elevationDomain:c,fp64:n,cellSize:r,coverage:a,material:o,elevationScale:t,extruded:i},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:f,numInstances:h[0]*h[1]})}}]),t}(te.a);zt.layerName="GPUGridLayer",zt.defaultProps=Dt;var Bt=Object.assign({},zt.defaultProps,ve.defaultProps,{gpuAggregation:!1}),Ut=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",zt):this.getSubLayerClass("CPU",ve))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!Z.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(te.a);Ut.layerName="GridLayer",Ut.defaultProps=Bt,n.d(t,"experimental",function(){return Vt}),n.d(t,"ScreenGridLayer",function(){return ee}),n.d(t,"CPUGridLayer",function(){return ve}),n.d(t,"HexagonLayer",function(){return ke}),n.d(t,"ContourLayer",function(){return Lt}),n.d(t,"GridLayer",function(){return Ut}),n.d(t,"GPUGridLayer",function(){return zt}),n.d(t,"AGGREGATION_OPERATION",function(){return E}),n.d(t,"_GPUGridAggregator",function(){return Z});var Vt={BinSorter:re,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:se,quantizeScale:ae,getQuantizeScale:oe,defaultColorRange:_}},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(142),p=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return Object.assign({},h()(l()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME great-circle-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) *\n sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\n if(abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n}\n\nvoid main(void) {\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n \n vec2 source = radians(instancePositions.xy);\n vec2 target = radians(instancePositions.zw);\n \n float angularDist = getAngularDist(source, target);\n\n vec3 currPos = vec3(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0);\n vec3 nextPos = vec3(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0);\n\n vec2 currPos64Low = mix(instancePositions64Low.xy, instancePositions64Low.zw, segmentRatio);\n vec2 nextPos64Low = mix(instancePositions64Low.xy, instancePositions64Low.zw, nextSegmentRatio);\n\n vec4 curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0));\n vec4 next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels);\n gl_Position = curr + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.0;\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n}\n",modules:["picking","project32"]})}}]),t}(g.a);p.layerName="GreatCircleLayer";var m=n(126),y=n(141),b=n(19),_=n.n(b),x=n(90),w=n(156),P=n.n(w);var O=180/Math.PI,k=100;function S(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return P.a.fromString(t,16)}(e)}return x.S2.S2Cell.toHilbertQuadkey(e.toString())}function j(e){var t=S(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],f=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,k*Math.pow(2,-c)),d=0;d<4;d++)for(var v=f[d].slice(0),g=f[d+1],p=(g[0]-v[0])/h,m=(g[1]-v[1])/h,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(L.g)([r[0],r[3]],e.scale).map(F),o=_()(a,2),s=o[0],u=o[1],c=Object(L.g)([r[2],r[1]],e.scale).map(F),l=_()(c,2),f=l[0],h=l[1];s=Math.max(0,Math.floor(s)),f=Math.min(e.scale,Math.ceil(f)),u=Math.max(0,Math.floor(u)),h=Math.min(e.scale,Math.ceil(h));for(var d=[],v=s;vt?d.push(R({x:v,y:g,z:i},t)):d.push({x:v,y:g,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),D={renderSubLayers:{type:"function",value:function(e){return new A.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},z=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new N({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new N({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var f=i.viewport,h=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==f.id&&this.state.tileCache.update(f,function(e){var n=e.filter(function(e){return e.z===h}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","gl_FragColor = vColor;":"gl_FragColor.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){h()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),h()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),f=Object(U.a)(a,n,i),h=f.iterable,d=f.objectInfo,v=0,g=0;g180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function K(e,t,n){var i=e(t,n),r=Object(G.h3ToGeo)(i),a=_()(r,2),o=a[0];return[a[1],o]}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(G.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(G.h3ToGeo)(e),r=_()(i,2),a=r[0],o=r[1],s=t.length;Q(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(G.edgeLength)(i,G.UNITS.km):0,hasPentagon:r})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(G.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(G.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=J(a),u=Object(G.h3ToGeo)(a),c=_()(u,2),l=c[0],f=c[1],h=e.projectFlat([f,l]),d=_()(h,2),v=d[0],g=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-g)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.fp64,i=e.material,r=e.coverage,a=e.extruded,o=e.wireframe,s=e.stroked,u=e.filled,c=e.lineWidthUnits,l=e.lineWidthScale,f=e.lineWidthMinPixels,h=e.lineWidthMaxPixels,d=e.getColor,v=e.getFillColor,g=e.getElevation,p=e.getLineColor,m=e.getLineWidth,y=e.updateTriggers;return{elevationScale:t,fp64:n,extruded:a,coverage:r,wireframe:o,stroked:s,filled:u,lineWidthUnits:c,lineWidthScale:l,lineWidthMinPixels:f,lineWidthMaxPixels:h,material:i,getElevation:g,getFillColor:d||v,getLineColor:p,getLineWidth:m,updateTriggers:{getFillColor:y.getColor||y.getFillColor,getElevation:y.getElevation,getLineColor:y.getLineColor,getLineWidth:y.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===q()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return J(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",Y.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:K.bind(null,n)})}}]),t}(m.a);ee.defaultProps=$,ee.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return p}),n.d(t,"S2Layer",function(){return E}),n.d(t,"TileLayer",function(){return z}),n.d(t,"TripsLayer",function(){return V}),n.d(t,"H3ClusterLayer",function(){return H}),n.d(t,"H3HexagonLayer",function(){return ee})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(32),u=n.n(s);var c=n(101),l=n(137),f=n(138),h=n(139),d=n(7),v=n.n(d),g=n(5),p=n.n(g),m=n(8),y=n.n(m),b={fetch:function(e){return JSON.parse(e)},configuration:[]},_=function(e){function t(){return r()(this,t),v()(this,p()(t).apply(this,arguments))}return y()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layers:[]}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps;(e.changeFlags.dataChanged||t.configuration!==n.configuration)&&(this.state.layers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t){var n={};for(var i in e){var r=e[i];i.startsWith("get")?n[i]=N(r,t):n[i]=r}return n}(e,t);return r.fetch=D,i&&new i(r)})}(t.data,t.configuration))}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(126).a);function x(e,t){var n=function(e){if("string"==typeof e){var t=P[e];return t||(t=e.split("."),P[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=w(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function w(e){return null!==e&&"object"===u()(e)}_.layerName="JSONLayer",_.defaultProps=b;var P={};var O={},k={},S=34,j=10,C=13;function E(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var A=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return k;if(c)return c=!1,O;var t,i,r=o;if(e.charCodeAt(r)===S){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===j?c=!0:i===C&&(c=!0,e.charCodeAt(o)===j&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u]);Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var z=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=R(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return z}),n.d(t,"_JSONLayer",function(){return _})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(127);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},f=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":i=e._onPointerMove;break;case"mouseout":i=e._onPointerLeave;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv().firstChild,i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),f=new google.maps.Point(0,0),h=a.fromContainerPixelToLatLng(f),d=a.fromLatLngToDivPixel(h),v=(c.x-l.x)/i,g=Math.log2(v)+e.getZoom()-1,p=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(p),y=m.lat(),b=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:g,pitch:e.getTilt(),latitude:y,longitude:b}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,f=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:f?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return f})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(127),u=n(102);function c(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[770,771,1,771],blendEquation:32774},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:l(t)}),i=new s.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:l(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=h(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[f(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function l(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new u.a(Object.assign({x:0,y:0,width:e.width,height:e.height},l(t),n?{nearZMultiplier:e.height?1/e.height:1,farZMultiplier:1}:{nearZMultiplier:.1,farZMultiplier:10}))}function h(e,t){return e.layerManager.getLayers().filter(t)}function d(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function v(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var g=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=c({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),v(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),v(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&v(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=f(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:h(n,function(e){return d(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return g})},function(e,t,n){"use strict";var i=n(4),r=n(6),a=n(58),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()},,function(e,t,n){"use strict";var i=n(41),r=n.n(i),a=n(62),o=n(151),s=n.n(o),u=n(152),c=n.n(u),l=n(21);function f(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}var h=!1,d=!0,v=new Map([["image/png",function(e){var t=y(e);if(t.byteLength<24||2303741511!==t.getUint32(0,h))return null;return{width:t.getUint32(16,h),height:t.getUint32(20,h)}}],["image/jpeg",function(e){var t=y(e);if(t.byteLength<2||65496!==t.getUint16(0,h))return null;var n=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),i=n.tableMarkers,r=n.sofMarkers,a=2;for(;a1&&void 0!==arguments[1]?arguments[1]:null;if(t){var n=v.get(t);if(!n)throw new Error(g);var i=n(e);if(!i)throw new Error("invalid image data for type: ".concat(t));return i}var r=m(e,t);if(!r)throw new Error(g);return r}function m(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=v.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=Object(l.a)(a.value,2),u=s[0],c=(0,s[1])(e);if(c)return c.mimeType=u,c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function y(e){if(f&&(e=f(e)),e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}function b(e,t){return _.apply(this,arguments)}function _(){return(_=Object(a.a)(r.a.mark(function e(t,n){var i,a,o,u,l;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=c.a.promisify(s.a),a=p(t),o=a.mimeType,u=t instanceof Buffer?t:Buffer.from(t),e.next=5,i(u,o);case 5:return l=e.sent,e.abrupt("return",{width:l.shape[0],height:l.shape[1],data:l.data});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}n.d(t,"a",function(){return w});function x(e,t){return b?b(e,t):function(e){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var t=new Blob([new Uint8Array(e)]);return createImageBitmap(t)}(e)}function w(e,t){return P.apply(this,arguments)}function P(){return(P=Object(a.a)(r.a.mark(function e(t,n){var i,a;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof Image){e.next=8;break}return e.next=3,fetch(t,n);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return a=e.sent,e.abrupt("return",x(a));case 8:return e.next=10,O(t,n);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function O(e,t){return k.apply(this,arguments)}function k(){return(k=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}}])}); From 4ed58eb5482daeca1fec2faebe3f30fd9c6d6d95 Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 27 Jul 2019 20:30:21 +1000 Subject: [PATCH 03/24] v7.2.0-alpha.4 --- R/mapdeck_dependencies.R | 2 +- inst/htmlwidgets/lib/deckgl.min.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/mapdeck_dependencies.R b/R/mapdeck_dependencies.R index 190813fe..f6c224d6 100644 --- a/R/mapdeck_dependencies.R +++ b/R/mapdeck_dependencies.R @@ -157,7 +157,7 @@ deckgl_min_js <- function() { list( createHtmlDependency( name = "deckgl", - version = "7.1.10", + version = "7.2.0", src = system.file("htmlwidgets/lib/", package = "mapdeck"), script = c("deckgl.min.js"), all_files = FALSE diff --git a/inst/htmlwidgets/lib/deckgl.min.js b/inst/htmlwidgets/lib/deckgl.min.js index 9b57aedc..9c7cf510 100644 --- a/inst/htmlwidgets/lib/deckgl.min.js +++ b/inst/htmlwidgets/lib/deckgl.min.js @@ -1,9 +1,9 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("h3"),require("S2"));else if("function"==typeof define&&define.amd)define(["h3","S2"],t);else{var n="object"==typeof exports?t(require("h3"),require("S2")):t(e.h3,e.S2);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=158)}([function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.r(t);var i=n(4),r=n(6),a=n(66),o=n(31),s=n(23),u=n(24),c=n(0),l=n(112),f="7.1.10",h=Object(l.a)();var d=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(i.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(r),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(r.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function v(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var g={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function p(e){return"string"==typeof e?g[e.toUpperCase()]||g.WHITE:e}function m(e,t){if(!e)throw new Error(t||"Assertion failed")}var y=n(44);function b(){var e;if(h&&y.b.performance)e=y.b.performance.now();else if(y.a.hrtime){var t=y.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}var _={debug:h&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},x={enabled:!1,priority:0};function w(){}var P={};var O=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(i.a)(this,e),this.id=t,this.VERSION=f,this._startTs=b(),this._deltaTs=b(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new d("__probe-".concat(this.id,"__"),x),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(r.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((b()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((b()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){m(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?w:h?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(c.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(161)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:w}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,r=e.scale,a=void 0===r?1:r;if("string"==typeof t){var o=new Image;return o.onload=function(){var e,t=v(o,i,a);(e=console).log.apply(e,Object(u.a)(t))},o.src=t,w}var s,c=t.nodeName||"";if("img"===c.toLowerCase())return(s=console).log.apply(s,Object(u.a)(v(t,i,a))),w;if("canvas"===c.toLowerCase()){var l=new Image;return l.onload=function(){var e;return(e=console).log.apply(e,Object(u.a)(v(l,i,a)))},l.src=t.toDataURL(),w}return w}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||w})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||w})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=b(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),m(t);var n=e.message,i=e.tag||e.message;if(e.once){if(P[i])return w;P[i]=b()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(u.a)(e.args)))}return w}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(s.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return m(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,i=e.args,r=void 0===i?[]:i,a=e.opts,o={priority:this._normalizePriority(t),message:n,args:r};switch(Object(s.a)(t)){case"string":case"function":void 0!==n&&r.unshift(n),Object.assign(o,{message:t});break;case"object":Object.assign(o,t)}return"function"==typeof o.message&&(o.message=this._shouldLog(o.priority)?o.message():""),m("string"==typeof o.message||"object"===Object(s.a)(o.message)),Object.assign(o,a)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,h||"string"!=typeof r||(a&&(a=p(a),r="[".concat(a,"m").concat(r,"")),o&&(a=p(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();O.VERSION=f;var k=new O({id:"luma"}).enable(),S=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=b(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(b()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}(),j=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new S(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}(),C=(n(98),new(function(){function e(){Object(i.a)(this,e),this.stats=new Map}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new j({id:e})),this.stats.get(e)}}]),e}()));if(o.b.luma&&"7.1.0-beta.1"!==o.b.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(o.b.luma.VERSION," vs ").concat("7.1.0-beta.1"));o.b.luma||(a.a&&k.log(1,"luma.gl ".concat("7.1.0-beta.1"," - ").concat("set luma.log.priority=1 (or higher) to trace rendering"))(),o.b.luma=o.b.luma||{VERSION:"7.1.0-beta.1",version:"7.1.0-beta.1",log:k,stats:C,globals:{modules:{},nodeIO:{}}});o.b.luma;var E=n(50),A=n(21);function T(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var M={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(u.a)(t))},blendEquation:function(e,t){t=T(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(u.a)(t))},blendFunc:function(e,t){t=T(t)&&2===t.length?[].concat(Object(u.a)(t),Object(u.a)(t)):t,e.blendFuncSeparate.apply(e,Object(u.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(u.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(u.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(u.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(u.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(u.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(u.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=T(t)?t:[t,t],i=Object(A.a)(n,2),r=i[0],a=i[1];e.stencilMaskSeparate(1028,r),e.stencilMaskSeparate(1029,a)},stencilFunc:function(e,t){var n=t=T(t)&&3===t.length?[].concat(Object(u.a)(t),Object(u.a)(t)):t,i=Object(A.a)(n,6),r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5];e.stencilFuncSeparate(1028,r,a,o),e.stencilFuncSeparate(1029,s,c,l)},stencilOp:function(e,t){var n=t=T(t)&&3===t.length?[].concat(Object(u.a)(t),Object(u.a)(t)):t,i=Object(A.a)(n,6),r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5];e.stencilOpSeparate(1028,r,a,o),e.stencilOpSeparate(1029,s,c,l)},viewport:function(e,t){return e.viewport.apply(e,Object(u.a)(t))}};function L(e,t){for(var n in Object(E.f)(e,t),t){var i=M[n];i&&i(e,t[n],n)}}var I=n(61),F=n(45);function R(e,t,n){if(Object(F.b)(t))return n(e);var i,r=t.nocatch,a=void 0===r||r;if(Object(F.a)(!t.frameBuffer),Object(I.c)(e),L(e,t),a)i=n(e),Object(I.b)(e);else try{i=n(e)}finally{Object(I.b)(e)}return i}var N="luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",D=null;function z(){var e=n(162);if(!e)throw new Error(N);return e.apply(void 0,arguments)}if(!a.a)try{D=n(163)}catch(e){}var B=function e(){Object(i.a)(this,e)},U=D||o.b,V=(U.WebGLRenderingContext,U.WebGLProgram,U.WebGLShader,U.WebGLBuffer),G=void 0===V?B:V;U.WebGLFramebuffer,U.WebGLRenderbuffer,U.WebGLTexture,U.WebGLUniformLocation,U.WebGLActiveInfo,U.WebGLShaderPrecisionFormat;var W=o.b.WebGL2RenderingContext||function e(){Object(i.a)(this,e)};o.b.Image;function H(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"id";Y[e]=Y[e]||1;var t=Y[e]++;return"".concat(e,"-").concat(t)}function K(e){return Z("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function J(e){var t=!0;for(var n in e){t=!1;break}return t}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,i=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,i=void 0===n?16:n,r=t.size,a=void 0===r?1:r,o="[",s=0;s0&&(o+=",".concat(s%a==0?" ":"")),o+=$(e[s],t);var u=e.length>i?"...":"]";return"".concat(o).concat(u)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return i?"0":"0.";if(i)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var r=e.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function ee(e,t,n,i){var r="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),a=Object.getPrototypeOf(e);i.forEach(function(e){a.methodName||(a[e]=function(){throw k.removed("Calling removed method ".concat(t,".").concat(e,": "),r)(),new Error(e)})})}function te(e,t,n){var i=n.removedProps,r=void 0===i?{}:i,a=n.deprecatedProps,o=void 0===a?{}:a,s=n.replacedProps,u=void 0===s?{}:s;for(var c in r)if(c in t){var l=r[c]?"".concat(e,".").concat(r[c]):"N/A";k.removed("".concat(e,".").concat(c),l)()}for(var f in o)if(f in t){var h=o[f];k.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(h))()}var d=null;for(var v in u)if(v in t){var g=u[v];k.deprecated("".concat(e,".").concat(v),"".concat(e,".").concat(g))(),(d=d||Object.assign({},t))[g]=t[v],delete d[v]}return d||t}var ne,ie=a.a&&"undefined"!=typeof document,re=ie&&"complete"===document.readyState;function ae(){return ne||(ne=ie?new Promise(function(e,t){if(ie&&"complete"===document.readyState)return re=!0,void e(document);window.onload=function(){re=!0,e(document)}}):Promise.resolve({})),ne}function oe(e){var t,n=e.canvas,i=e.width,r=e.height,a=e.onError,o=void 0===a?function(){}:a;return"string"==typeof n?(re||o("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:o}),t}function se(e){var t=e.getParameter(7936),n=e.getParameter(7937),i=e.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&e.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||t,renderer:i&&e.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}var ue="Invalid WebGLRenderingContext",ce="Requires WebGL2";function le(e){return Boolean(e&&Number.isFinite(e._version))}function fe(e){return Boolean(e&&2===e._version)}function he(e){Z(le(e),ue)}function de(e){Z(fe(e),ce)}function ve(e){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function ge(e){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var pe="Failed to deduce GL constant from typed array";function me(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(pe)}}function ye(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function be(e){for(var t=e.data,n=e.width,i=e.height,r=Math.round(n/2),a=Math.round(i/2),o=new Uint8Array(r*a*4),s=0;s1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),he(t);var r=n.id,a=n.userData,o=void 0===a?{}:a;this.gl=t,this.id=r||Q(this.constructor.name),this.userData=o,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z(e=_e(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=fe(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=fe(this.gl),o={},s=n||Object.keys(r),u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value,v=r[d];if(v&&(!("webgl2"in v)||a)&&(!("extension"in v)||this.gl.getExtension(v.extension))){var g=i?xe(this.gl,d):d;o[g]=this.getParameter(d,e),i&&"GLenum"===v.type&&(o[g]=xe(this.gl,o[g]))}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return o}},{key:"setParameter",value:function(e,t){Z(e=_e(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=fe(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=_e(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return ee(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(Se)}},{key:"_deleteHandle",value:function(){throw new Error(Se)}},{key:"_bindHandle",value:function(){throw new Error(Se)}},{key:"_getOptsFromHandle",value:function(){throw new Error(Se)}},{key:"_getParameter",value:function(e,t){throw new Error(Se)}},{key:"_setParameter",value:function(e,t){throw new Error(Se)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=C.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;C.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=C.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=C.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}(),Ce=n(114);function Ee(e,t,n){return(Ee=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&Object(Ce.a)(r,n.prototype),r}).apply(null,arguments)}var Ae,Te,Me,Le={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Ie={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Fe=function(){function e(){var t=this;Object(i.a)(this,e);for(var n=arguments.length,r=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=te("Accessor",e,Ie)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}(),Re={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"},Ne={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Re},De={removedProps:Re},ze=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Fe.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/Fe.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=te("Buffer",e,Ne),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=te("Buffer",e,De))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new Fe(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Z(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(de(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return de(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;de(this.gl);var c,l,f=ye(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(r),d=o;n?c=(l=n.length)-d:l=d+(c=Math.min(h,u||h));var v=Math.min(h,c);return Z((u=u||v)<=v),n=n||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Z(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Z(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=me(e);return Z(i),this.setAccessor(new Fe(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Z(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/ye(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new Fe(this.accessor,{type:me(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return k.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return k.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new Fe(this.accessor,e),this}},{key:"type",get:function(){return k.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return k.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(je),Be=(Ae={},Object(c.a)(Ae,6407,{dataFormat:6407,types:[5121,33635]}),Object(c.a)(Ae,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(c.a)(Ae,6406,{dataFormat:6406,types:[5121]}),Object(c.a)(Ae,6409,{dataFormat:6409,types:[5121]}),Object(c.a)(Ae,6410,{dataFormat:6410,types:[5121]}),Object(c.a)(Ae,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(c.a)(Ae,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(c.a)(Ae,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(c.a)(Ae,34836,{dataFormat:6408,types:[5126],gl2:!0}),Ae),Ue=(Te={},Object(c.a)(Te,6403,1),Object(c.a)(Te,36244,1),Object(c.a)(Te,33319,2),Object(c.a)(Te,33320,2),Object(c.a)(Te,6407,3),Object(c.a)(Te,36248,3),Object(c.a)(Te,6408,4),Object(c.a)(Te,36249,4),Object(c.a)(Te,6402,1),Object(c.a)(Te,34041,1),Object(c.a)(Te,6406,1),Object(c.a)(Te,6409,1),Object(c.a)(Te,6410,2),Te),Ve=(Me={},Object(c.a)(Me,5126,4),Object(c.a)(Me,5125,4),Object(c.a)(Me,5124,4),Object(c.a)(Me,5123,2),Object(c.a)(Me,5122,2),Object(c.a)(Me,5131,2),Object(c.a)(Me,5120,1),Object(c.a)(Me,5121,1),Me);var Ge=[9729,9728],We=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=n.id,o=void 0===a?Q("texture"):a,s=n.handle,u=n.target;return(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,{id:o,handle:s}))).target=u,r.hasFloatTexture=e.getExtension("OES_texture_float"),r.textureUnit=void 0,r.loaded=!1,r.width=void 0,r.height=void 0,r.depth=void 0,r.format=void 0,r.type=void 0,r.dataFormat=void 0,r.border=void 0,r.textureUnit=void 0,r.mipmaps=void 0,r}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&function(e,t){var n=Be[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=fe(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}(e,n))&&(!i||function(e,t){var n=Be[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}(e,n))),r}}]),Object(r.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var i=t.pixels,r=void 0===i?null:i,a=t.format,o=void 0===a?6408:a,s=t.type,u=void 0===s?5121:s,l=t.border,f=void 0===l?0:l,h=t.recreate,d=void 0!==h&&h,v=t.parameters,g=void 0===v?{}:v,p=t.pixelStore,m=void 0===p?{}:p,y=t.textureUnit,b=void 0===y?void 0:y,_=t.unpackFlipY,x=void 0===_||_,w=t.mipmaps,P=void 0===w||w;n||(n=r);var O=t.width,S=t.height,j=t.dataFormat,C=t.depth,E=void 0===C?0:C,A=this._deduceParameters({format:o,type:u,dataFormat:j,compressed:!1,data:n,width:O,height:S});O=A.width,S=A.height,j=A.dataFormat,this.width=O,this.height=S,this.depth=E,this.format=o,this.type=u,this.dataFormat=j,this.border=f,this.textureUnit=b,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var T=Object(c.a)({},37440,x),M=Object.assign({},T,m);return P&&this._isNPOT()&&(k.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),P=!1,this._updateForNPOT(g)),this.mipmaps=P,this.setImageData({data:n,width:O,height:S,depth:E,format:o,type:u,dataFormat:j,border:f,mipmaps:P,parameters:M}),P&&this.generateMipmap(),this.setParameters(g),d&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:!1}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindTexture(this.target,this.handle),R(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,v=void 0===d?{}:d,g=e.data,p=void 0===g?null:g,m=e.type,y=void 0===m?this.type:m,b=e.width,_=void 0===b?this.width:b,x=e.height,w=void 0===x?this.height:x,P=e.dataFormat,O=void 0===P?this.dataFormat:P,k=e.compressed,S=void 0!==k&&k;p||(p=r);var j=this._deduceParameters({format:u,type:y,dataFormat:O,compressed:S,data:p,width:_,height:w});y=j.type,O=j.dataFormat,S=j.compressed,_=j.width,w=j.height;var C=this.gl;C.bindTexture(this.target,this.handle);var E,A=this._getDataType({data:p,compressed:S});if(p=A.data,E=A.dataType,R(this.gl,v,function(){switch(E){case"null":C.texImage2D(n,o,u,_,w,l,O,y,p);break;case"typed-array":C.texImage2D(n,o,u,_,w,l,O,y,p,h);break;case"buffer":de(C),C.bindBuffer(35052,p.handle||p),C.texImage2D(n,o,u,_,w,l,O,y,h),C.bindBuffer(35052,null);break;case"browser-object":fe(C)?C.texImage2D(n,o,u,_,w,l,O,y,p):C.texImage2D(n,o,u,O,y,p);break;case"compressed":C.compressedTexImage2D(n,o,u,_,w,l,p);break;default:Z(!1,"Unknown image data type")}}),p&&p.byteLength)this._trackAllocatedMemory(p.byteLength,"Texture");else{var T=Ue[this.dataFormat]||4,M=Ve[this.type]||1;this._trackAllocatedMemory(this.width*this.height*T*M,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,v=e.height,g=void 0===v?this.height:v,p=e.level,m=void 0===p?0:p,y=e.format,b=void 0===y?this.format:y,_=e.type,x=void 0===_?this.type:_,w=e.dataFormat,P=void 0===w?this.dataFormat:w,O=e.compressed,k=void 0!==O&&O,S=e.offset,j=void 0===S?0:S,C=e.border,E=(void 0===C&&this.border,e.parameters),A=void 0===E?{}:E,T=this._deduceParameters({format:b,type:x,dataFormat:P,compressed:k,data:s,width:d,height:g});if(x=T.type,P=T.dataFormat,k=T.compressed,d=T.width,g=T.height,Z(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var M=s;s=M.data,d=M.shape[0],g=M.shape[1]}s instanceof ze&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),R(this.gl,A,function(){k?t.gl.compressedTexSubImage2D(i,m,c,f,d,g,b,s):null===s?t.gl.texSubImage2D(i,m,c,f,d,g,P,x,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,m,c,f,d,g,P,x,s,j):s instanceof G?(de(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,m,c,f,d,g,P,x,j),t.gl.bindBuffer(35052,null)):fe(t.gl)?t.gl.texSubImage2D(i,m,c,f,d,g,P,x,s):t.gl.texSubImage2D(i,m,c,f,P,x,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof ze?{data:t.handle,dataType:"buffer"}:t instanceof G?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=Be[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return Z(i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},"Could not deduced texture size"),Z(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Z(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Z(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!fe(this.gl)&&(!(!this.width||!this.height)&&(!K(this.width)||!K(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===Ge.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(je),He="";function Xe(e){He=e}function qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z("string"==typeof e),e=He+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function Ze(e,t){return Z("string"==typeof e),e=He+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}var Ye=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),he(e),(r instanceof Promise||"string"==typeof r)&&(r={data:r}),"string"==typeof r.data&&(r=Object.assign({},r,{data:Ze(r.data)})),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},r,{target:3553})))).initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e,t){return We.isSupported(e,t)}}]),t}(We),Qe=n(41),Ke=n.n(Qe),Je=n(62),$e=[34069,34070,34071,34072,34073,34074],et=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),he(e),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},r,{target:34067})))).initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(Je.a)(Ke.a.mark(function e(t){var n,i,r,a,o,s,u,c,l,f,h,d,v,g=this;return Ke.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,r=t.pixels,a=t.data,o=t.border,s=void 0===o?0:o,u=t.format,c=void 0===u?6408:u,l=t.type,f=void 0===l?5121:l,h=this.gl,d=r||a,e.next=5,Promise.all($e.map(function(e){var t=d[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:v=e.sent,this.bind(),$e.forEach(function(e,t){v[t].length>1&&!1!==g.opts.mipmaps&&k.warn("".concat(g.id," has mipmap and multiple LODs."))(),v[t].forEach(function(t,r){n&&i?h.texImage2D(e,r,c,n,i,s,c,f,t):h.texImage2D(e,r,c,c,f,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(We);et.FACES=$e;var tt,nt=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),de(e),r=Object.assign({depth:1},r,{target:32879,unpackFlipY:!1}),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return fe(e)}}]),Object(r.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,c=void 0===u?1:u,l=e.border,f=void 0===l?0:l,h=e.format,d=e.type,v=void 0===d?5121:d,g=e.offset,p=void 0===g?0:g,m=e.data,y=e.parameters,b=void 0===y?{}:y;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),R(this.gl,b,function(){ArrayBuffer.isView(m)&&t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,m),m instanceof ze&&(t.gl.bindBuffer(35052,m.handle),t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,p))}),m&&m.byteLength)this._trackAllocatedMemory(m.byteLength,"Texture");else{var _=Ue[this.dataFormat]||4,x=Ve[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*_*x,"Texture")}return this.loaded=!0,this}}]),t}(We),it="EXT_color_buffer_float",rt=(tt={},Object(c.a)(tt,33189,{bpp:2}),Object(c.a)(tt,33190,{gl2:!0,bpp:3}),Object(c.a)(tt,36012,{gl2:!0,bpp:4}),Object(c.a)(tt,36168,{bpp:1}),Object(c.a)(tt,34041,{bpp:4}),Object(c.a)(tt,35056,{gl2:!0,bpp:4}),Object(c.a)(tt,36013,{gl2:!0,bpp:5}),Object(c.a)(tt,32854,{bpp:2}),Object(c.a)(tt,36194,{bpp:2}),Object(c.a)(tt,32855,{bpp:2}),Object(c.a)(tt,33321,{gl2:!0,bpp:1}),Object(c.a)(tt,33330,{gl2:!0,bpp:1}),Object(c.a)(tt,33329,{gl2:!0,bpp:1}),Object(c.a)(tt,33332,{gl2:!0,bpp:2}),Object(c.a)(tt,33331,{gl2:!0,bpp:2}),Object(c.a)(tt,33334,{gl2:!0,bpp:4}),Object(c.a)(tt,33333,{gl2:!0,bpp:4}),Object(c.a)(tt,33323,{gl2:!0,bpp:2}),Object(c.a)(tt,33336,{gl2:!0,bpp:2}),Object(c.a)(tt,33335,{gl2:!0,bpp:2}),Object(c.a)(tt,33338,{gl2:!0,bpp:4}),Object(c.a)(tt,33337,{gl2:!0,bpp:4}),Object(c.a)(tt,33340,{gl2:!0,bpp:8}),Object(c.a)(tt,33339,{gl2:!0,bpp:8}),Object(c.a)(tt,32849,{gl2:!0,bpp:3}),Object(c.a)(tt,32856,{gl2:!0,bpp:4}),Object(c.a)(tt,32857,{gl2:!0,bpp:4}),Object(c.a)(tt,36220,{gl2:!0,bpp:4}),Object(c.a)(tt,36238,{gl2:!0,bpp:4}),Object(c.a)(tt,36975,{gl2:!0,bpp:4}),Object(c.a)(tt,36214,{gl2:!0,bpp:8}),Object(c.a)(tt,36232,{gl2:!0,bpp:8}),Object(c.a)(tt,36226,{gl2:!0,bpp:16}),Object(c.a)(tt,36208,{gl2:!0,bpp:16}),Object(c.a)(tt,33325,{gl2:it,bpp:2}),Object(c.a)(tt,33327,{gl2:it,bpp:4}),Object(c.a)(tt,34842,{gl2:it,bpp:8}),Object(c.a)(tt,33326,{gl2:it,bpp:4}),Object(c.a)(tt,33328,{gl2:it,bpp:8}),Object(c.a)(tt,34836,{gl2:it,bpp:16}),Object(c.a)(tt,35898,{gl2:it,bpp:4}),tt);var at,ot=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=fe(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,rt)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Z(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&fe(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*rt[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(je),st=256,ut=1024,ct=16384,lt=6144,ft=6145,ht=6146,dt=34041,vt="clear: bad arguments";function gt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.color,a=void 0===r?null:r,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};i&&(l.framebuffer=i);var f=0;a&&(f|=ct,!0!==a&&(l.clearColor=a)),s&&(f|=st,!0!==s&&(l.clearDepth=s)),c&&(f|=ut,!0!==s&&(l.clearStencil=s)),Z(0!==f,vt),R(e,l,function(){e.clear(f)})}function pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.buffer,a=void 0===r?lt:r,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;de(e),R(e,{framebuffer:i},function(){switch(a){case lt:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case ft:e.clearBufferfv(ft,0,[c]);break;case ht:e.clearBufferiv(ht,0,[c]);break;case dt:var t=Object(A.a)(c,2),n=t[0],i=t[1];e.clearBufferfi(dt,0,n,i);break;default:Z(!1,vt)}})}function mt(e){switch(e){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 Z(!1),0}}function yt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,g=Ot(e),p=g.framebuffer,m=g.deleteFramebuffer;Z(p);var y=p.gl,b=p.handle,_=p.attachments;h=h||p.width,d=d||p.height,36064===c&&null===b&&(c=1028),Z(_[c]),f=function(e,t,n,i,r){if(e)return e;var a=ye(t=t||5121,{clamped:!1}),o=mt(n);return new a(i*r*o)}(f,v=v||_[c].type,s,h,d),v=v||me(f);var x=y.bindFramebuffer(36160,b);return y.readPixels(i,a,h,d,s,v,f),y.bindFramebuffer(36160,x||null),m&&p.delete(),f}function bt(e,t){var n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.target,c=void 0===u?null:u,l=t.targetByteOffset,f=void 0===l?0:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,g=Ot(e),p=g.framebuffer,m=g.deleteFramebuffer;Z(p);var y=p.gl;if(h=h||p.width,d=d||p.height,de(y),v=v||(c?c.type:5121),!c){var b=mt(s),_=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Z(!1),0}}(v);c=new ze(y,{byteLength:f+h*d*b*_,accessor:{type:v,size:b}})}return c.bind({target:35051}),R(y,{framebuffer:p},function(){y.readPixels(i,a,h,d,s,v,f)}),c.unbind({target:35051}),m&&p.delete(),c}function _t(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=yt(e,{sourceAttachment:i}),s=e.width,u=e.height;u>a;){var c=be({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}!function(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=_t(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function wt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,a=n.sourceY,o=void 0===a?0:a,s=n.targetX,u=n.targetY,c=n.targetZ,l=n.targetMipmaplevel,f=void 0===l?0:l,h=n.targetInternalFormat,d=void 0===h?6408:h,v=n.width,g=n.height,p=Ot(e),m=p.framebuffer,y=p.deleteFramebuffer;Z(m);var b=m.gl,_=m.handle,x=void 0!==s||void 0!==u||void 0!==c;s=s||0,u=u||0,c=c||0;var w=b.bindFramebuffer(36160,_);Z(t);var P=null;if(t instanceof We&&(P=t,v=Number.isFinite(v)?v:P.width,g=Number.isFinite(g)?g:P.height,P.bind(0),t=P.target),x)switch(t){case 3553:case 34067:b.copyTexSubImage2D(t,f,s,u,r,o,v,g);break;case 35866:case 32879:b.copyTexSubImage3D(t,f,s,u,c,r,o,v,g)}else b.copyTexImage2D(t,f,d,r,o,v,g,0);return P&&P.unbind(),b.bindFramebuffer(36160,w||null),y&&m.delete(),P}function Pt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,s=n.sourceY0,u=void 0===s?0:s,c=n.sourceX1,l=n.sourceY1,f=n.targetX0,h=void 0===f?0:f,d=n.targetY0,v=void 0===d?0:d,g=n.targetX1,p=n.targetY1,m=n.color,y=void 0===m||m,b=n.depth,_=void 0!==b&&b,x=n.stencil,w=void 0!==x&&x,P=n.mask,O=void 0===P?0:P,S=n.filter,j=void 0===S?9728:S,C=Ot(e),E=C.framebuffer,A=C.deleteFramebuffer,T=Ot(t),M=T.framebuffer,L=T.deleteFramebuffer;Z(E),Z(M);var I=M.gl,F=M.handle,R=M.width,N=M.height,D=M.readBuffer;de(I),E.handle||36064!==r||(r=1028),y&&(O|=16384),_&&(O|=256),w&&(O|=1024),(A||L)&&1280&O&&(O=16384,k.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Z(O),c=void 0===c?E.width:c,l=void 0===l?E.height:l,g=void 0===g?R:g,p=void 0===p?N:p;var z=I.bindFramebuffer(36009,F),B=I.bindFramebuffer(36008,E.handle);return I.readBuffer(r),I.blitFramebuffer(o,u,c,l,h,v,g,p,O,j),I.readBuffer(D),I.bindFramebuffer(36008,B||null),I.bindFramebuffer(36009,z||null),A&&E.delete(),L&&M.delete(),M}function Ot(e){return e instanceof Dt?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,i=t.gl,r=t.width,a=t.height,o=t.id,s=new Dt(i,Object.assign({},n,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(c.a)({},36064,t)})),s),deleteFramebuffer:!0};var t,n,i,r,a,o,s}var kt,St=(at={},Object(c.a)(at,33902,{gl1:new Float32Array([1,1])}),Object(c.a)(at,33901,{gl1:new Float32Array([1,1])}),Object(c.a)(at,3379,{gl1:64,gl2:2048}),Object(c.a)(at,34076,{gl1:16}),Object(c.a)(at,34930,{gl1:8}),Object(c.a)(at,35661,{gl1:8}),Object(c.a)(at,35660,{gl1:0}),Object(c.a)(at,34024,{gl1:1}),Object(c.a)(at,36348,{gl1:8}),Object(c.a)(at,34921,{gl1:8}),Object(c.a)(at,36347,{gl1:128}),Object(c.a)(at,36349,{gl1:16}),Object(c.a)(at,3386,{gl1:new Int32Array([0,0])}),Object(c.a)(at,32883,{gl1:0,gl2:256}),Object(c.a)(at,35071,{gl1:0,gl2:256}),Object(c.a)(at,37447,{gl1:0,gl2:0}),Object(c.a)(at,36063,{gl1:0,gl2:4}),Object(c.a)(at,35379,{gl1:0,gl2:0}),Object(c.a)(at,35374,{gl1:0,gl2:0}),Object(c.a)(at,35377,{gl1:0,gl2:0}),Object(c.a)(at,34852,{gl1:0,gl2:4}),Object(c.a)(at,36203,{gl1:0,gl2:0}),Object(c.a)(at,33001,{gl1:0,gl2:0}),Object(c.a)(at,33e3,{gl1:0,gl2:0}),Object(c.a)(at,37157,{gl1:0,gl2:0}),Object(c.a)(at,35373,{gl1:0,gl2:0}),Object(c.a)(at,35657,{gl1:0,gl2:0}),Object(c.a)(at,36183,{gl1:0,gl2:0}),Object(c.a)(at,37137,{gl1:0,gl2:0}),Object(c.a)(at,34045,{gl1:0,gl2:0}),Object(c.a)(at,35978,{gl1:0,gl2:0}),Object(c.a)(at,35979,{gl1:0,gl2:0}),Object(c.a)(at,35968,{gl1:0,gl2:0}),Object(c.a)(at,35376,{gl1:0,gl2:0}),Object(c.a)(at,35375,{gl1:0,gl2:0}),Object(c.a)(at,35659,{gl1:0,gl2:0}),Object(c.a)(at,37154,{gl1:0,gl2:0}),Object(c.a)(at,35371,{gl1:0,gl2:0}),Object(c.a)(at,35658,{gl1:0,gl2:0}),Object(c.a)(at,35076,{gl1:0,gl2:-8,negative:!0}),Object(c.a)(at,35077,{gl1:0,gl2:7}),Object(c.a)(at,35380,{gl1:0,gl2:0}),at);function jt(e){if(e.luma=e.luma||{},!e.luma.limits){e.luma.limits={},e.luma.webgl1MinLimits={},e.luma.webgl2MinLimits={};var t=fe(e);for(var n in St){var i=St[n],r=i.gl1,a="gl2"in i?i.gl2:i.gl1,o=t?a:r,s="gl2"in i&&!t||"extension"in i&&!e.getExtension(i.extension)?o:e.getParameter(n);e.luma.limits[n]=s,e.luma.webgl1MinLimits[n]=r,e.luma.webgl2MinLimits[n]=a}}return e.luma.limits}function Ct(e){e.luma=e.luma||{};var t,n=se(e);e.luma.info||(e.luma.info=(t={},Object(c.a)(t,37445,n.vendor),Object(c.a)(t,37446,n.renderer),Object(c.a)(t,7936,n.vendorMasked),Object(c.a)(t,7937,n.rendererMasked),Object(c.a)(t,7938,n.version),Object(c.a)(t,35724,n.shadingLanguageVersion),t));return e.luma.info}function Et(e){return Object.assign(se(e),{limits:jt(e),info:Ct(e),webgl1MinLimits:e.luma.webgl1MinLimits,webgl2MinLimits:e.luma.webgl2MinLimits})}var At={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",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"},Tt=(kt={},Object(c.a)(kt,At.WEBGL2,[function(e){return fe(e)}]),Object(c.a)(kt,At.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(c.a)(kt,At.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(c.a)(kt,At.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(c.a)(kt,At.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(c.a)(kt,At.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(c.a)(kt,At.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(c.a)(kt,At.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(c.a)(kt,At.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(c.a)(kt,At.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(c.a)(kt,At.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(c.a)(kt,At.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(c.a)(kt,At.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(c.a)(kt,At.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(c.a)(kt,At.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(c.a)(kt,At.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(c.a)(kt,At.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(c.a)(kt,At.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(c.a)(kt,At.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(c.a)(kt,At.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(c.a)(kt,At.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),kt);function Mt(e,t){return Lt(e,t)}function Lt(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return Ft(e,t)})}function It(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=fe(e),Tt)e.luma.caps[t]=Ft(e,t);return e.luma.caps}function Ft(e,t){var n=Tt[t];Z(n,t);var i,r=fe(e)&&n[1]||n[0];if("function"==typeof r)i=r(e);else if(Array.isArray(r)){i=!0;var a=!0,o=!1,s=void 0;try{for(var u,c=r[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i=i&&Boolean(e.getExtension(l))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}else"string"==typeof r?i=Boolean(e.getExtension(r)):"boolean"==typeof r?i=r:Z(!1);return i}var Rt={};function Nt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Tt[t];if(Z(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in Rt)return Rt[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),Rt[t]=s,s}var Dt=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(fe(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(fe(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(Z(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Z(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&k.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,r=void 0!==i&&i,a=n.resizeAttachments,o=void 0===a||a,s={};r&&Object.keys(this.attachments).forEach(function(e){s[e]=null}),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){Z(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],h=f;if(h)if(h instanceof ot)this._attachRenderbuffer({attachment:l,renderbuffer:h});else if(Array.isArray(f)){var d=Object(A.a)(f,3),v=d[0],g=d[1],p=void 0===g?0:g,m=d[2],y=void 0===m?0:m;h=v,this._attachTexture({attachment:l,texture:v,layer:p,level:y})}else this._attachTexture({attachment:l,texture:h,layer:0,level:0});else this._unattach(l);o&&h&&h.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(function(e){return(Dt.STATUS||{})[e]||"Framebuffer error ".concat(e)}(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&>(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){pt({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return k.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;de(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=xe(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?xe(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>k.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=_t(this,{maxHeight:100});return k.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,i,r){var a,o=null;e&&((o=o||{})[36064]=new Ye(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:(a={},Object(c.a)(a,10241,9728),Object(c.a)(a,10240,9728),Object(c.a)(a,10242,33071),Object(c.a)(a,10243,33071),a)}));return t&&n?(o=o||{})[33306]=new ot(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}):t?(o=o||{})[36096]=new ot(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}):n&&Z(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof ot?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Z(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;fe(t)?t.readBuffer(e):Z(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(fe(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Z(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=It(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(je);function zt(e,t){Z(e instanceof Ye||e instanceof et||e instanceof nt);var n=e.constructor,i=e.gl,r=e.width,a=e.height,o=e.format,s=e.type,u=e.dataFormat,c=e.border,l=e.mipmaps;return new n(i,Object.assign({width:r,height:a,format:o,type:s,dataFormat:u,border:c,mipmaps:l},t))}Dt.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];function Bt(e){return Boolean(e&&2===e._version)}var Ut={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Vt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(Ut,{width:1,height:1},e)}function Gt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},Ut,t),i=n.width,r=n.height;function o(e){if(t.throwOnError)throw new Error(e);return null}a.a?e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(oe({canvas:t.canvas,width:i,height:r,onError:o}),t):e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,a=e.onError;if(r&&!i)return a("headless-gl does not support WebGL2");if(!z)return a(X);var o=z(t,n,e);return o||a(q)}(H({},t,{width:i,height:r,onError:o}));return e?(function(e){var t=Bt(e)?"WebGL2":"WebGL1",n=se(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";k.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=Wt(e,t)),e):null}function Wt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==W&&e instanceof W)return 2;return 1}(e);var n=t=Object.assign({},Ut,t),i=n.manageState,r=n.debug;return i&&Object(I.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}function qt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}var Zt=35632,Yt=35633;function Qt(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||qt(t)||"(unnamed)",u="".concat(function(e){switch(e){case Zt:return"fragment";case Yt:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=Jt(a,r-o);return s+n+e})}(t);return{shaderName:u,errors:Kt(a,v),warnings:Kt(o,v)}}function Kt(e,t){for(var n="",i=0;i=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}var en,tn="Shader: GLSL source code must be a JavaScript string",nn=function(e){function t(e,n){var r;Object(i.a)(this,t),he(e),Z("string"==typeof n.source,tn);var a=qt(n.source,null)||n.id||Q("unnamed ".concat(t.getTypeName(n.shaderType)));return(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,{id:a}))).shaderType=n.shaderType,r.source=n.source,r.initialize(n),r}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"getTypeName",value:function(e){switch(e){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Z(!1),"unknown"}}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.source,n=qt(t,null);n&&(this.id=Q(n)),this._compile(t)}},{key:"getParameter",value:function(e){return this.gl.getShaderParameter(this.handle,e)}},{key:"toString",value:function(){return"".concat(t.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return qt(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var e=this.gl.getExtension("WEBGL.debug_shaders");return e?e.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL.debug_shaders not implemented"}},{key:"_compile",value:function(){if(this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){var e=Qt(this.gl.getShaderInfoLog(this.handle),this.source,this.shaderType,this.id),t=e.shaderName,n=e.errors,i=e.warnings;throw k.error("GLSL compilation errors in ".concat(t,"\n").concat(n))(),k.warn("GLSL compilation warnings in ".concat(t,"\n").concat(i))(),new Error("GLSL compilation errors in ".concat(t))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}]),t}(je),rn=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},n,{shaderType:35633})))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),t}(nn),an=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},n,{shaderType:35632})))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),t}(nn);function on(e,t,n){return(on="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(Pe.a)(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}var sn,un=(en={},Object(c.a)(en,5126,function(e,t,n){return e.uniform1fv(t,vn(n,1))}),Object(c.a)(en,35664,function(e,t,n){return e.uniform2fv(t,vn(n,2))}),Object(c.a)(en,35665,function(e,t,n){return e.uniform3fv(t,vn(n,3))}),Object(c.a)(en,35666,function(e,t,n){return e.uniform4fv(t,vn(n,4))}),Object(c.a)(en,5124,function(e,t,n){return e.uniform1iv(t,gn(n,1))}),Object(c.a)(en,35667,function(e,t,n){return e.uniform2iv(t,gn(n,2))}),Object(c.a)(en,35668,function(e,t,n){return e.uniform3iv(t,gn(n,3))}),Object(c.a)(en,35669,function(e,t,n){return e.uniform4iv(t,gn(n,4))}),Object(c.a)(en,35670,function(e,t,n){return e.uniform1iv(t,gn(n,1))}),Object(c.a)(en,35671,function(e,t,n){return e.uniform2iv(t,gn(n,2))}),Object(c.a)(en,35672,function(e,t,n){return e.uniform3iv(t,gn(n,3))}),Object(c.a)(en,35673,function(e,t,n){return e.uniform4iv(t,gn(n,4))}),Object(c.a)(en,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,vn(n,4))}),Object(c.a)(en,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,vn(n,9))}),Object(c.a)(en,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,vn(n,16))}),Object(c.a)(en,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,5125,function(e,t,n){return e.uniform1uiv(t,pn(n,1))}),Object(c.a)(en,36294,function(e,t,n){return e.uniform2uiv(t,pn(n,2))}),Object(c.a)(en,36295,function(e,t,n){return e.uniform3uiv(t,pn(n,3))}),Object(c.a)(en,36296,function(e,t,n){return e.uniform4uiv(t,pn(n,4))}),Object(c.a)(en,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,vn(n,6))}),Object(c.a)(en,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,vn(n,8))}),Object(c.a)(en,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,vn(n,6))}),Object(c.a)(en,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,vn(n,12))}),Object(c.a)(en,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,vn(n,8))}),Object(c.a)(en,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,vn(n,12))}),Object(c.a)(en,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(c.a)(en,36311,function(e,t,n){return e.uniform1i(t,n)}),en),cn={},ln={},fn={},hn=[0];function dn(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(hn[0]=e,e=hn);var r=e.length;if(r%t&&k.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(fe(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",Dn),n._isCached=!1,n.initialize(r),Object.seal(Object(Oe.a)(n)),n._setId(r.id),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new rn(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new an(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,Z(this.vs instanceof rn),Z(this.fs instanceof an),this.uniforms={},i&&(de(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Nn(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:on(Object(Pe.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,f=void 0!==l&&l,h=e.indexType,d=void 0===h?5123:h,v=e.isInstanced,g=void 0!==v&&v,p=e.instanceCount,m=void 0===p?0:p,y=e.vertexArray,b=void 0===y?null:y,_=e.transformFeedback,x=e.framebuffer,w=e.parameters,P=void 0===w?{}:w,O=e.uniforms,S=e.samplers;if((O||S)&&(k.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(O||{})),void 0!==n){var j=x?x.id:"default",C="mode=".concat(xe(this.gl,r)," verts=").concat(a," ")+"instances=".concat(m," indexType=").concat(xe(this.gl,d)," ")+"isInstanced=".concat(g," isIndexed=").concat(f," ")+"Framebuffer=".concat(j);k.log(n,C)()}return Z(b),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(b.bindForDraw(a,m,function(){if(void 0!==x&&(P=Object.assign({},P,{framebuffer:x})),_){var e=In(r);_.begin(e)}t._bindTextures(),R(t.gl,P,function(){f&&g?t.gl.drawElementsInstanced(r,a,d,s,m):f&&fe(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):f?t.gl.drawElements(r,a,d,s):g?t.gl.drawArraysInstanced(r,s,a,m):t.gl.drawArrays(r,s,a)}),_&&_.end()}),!0)}},{key:"setUniforms",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=!1,r={};for(var a in t)_n(this.uniforms[a],t[a])||(i=!0,r[a]=t[a],this.uniforms[a]=(e=t[a],Array.isArray(e)||ArrayBuffer.isView(e)?e.slice():e));return i&&(n(),function(e,t,n){for(var i in e){var r=e[i];if((!n||Boolean(n[i]))&&!bn(r))throw t=t?"".concat(t," "):"",console.error("".concat(t," Bad uniform ").concat(i),r),new Error("".concat(t," Bad uniform ").concat(i))}}(r,this.id,this._uniformSetters),this._setUniforms(r)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof Dt)i=i.texture;if(i instanceof We)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof Dt&&(n=n.texture),n instanceof We)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof Dt&&(n=n.texture),n instanceof We){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new rn({handle:u});break;case 35632:n.fs=new an({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Q(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),k.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),k.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||k.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=fe(e),i=Lt(e,At.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Z(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(r.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(je),Un=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),de(e),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,r))).initialize(r),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return fe(e)}}]),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,J(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,k.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof ze==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(je),Vn=null;function Gn(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!Vn||Vn.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var a=r.id||r.program&&r.program.id;return(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},r,{id:a})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(r),Object.seal(Object(Oe.a)(n)),n}return Object(ke.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?fe(e)||"Chrome"===function(e){if(!e&&!Object(l.a)())return"Node";if(Object(Wn.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":y.b.chrome?"Chrome":y.b.safari?"Safari":y.b.mozInnerScreenX?"Firefox":"Unknown"}():fe(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Z(!1)}}}]),Object(r.a)(t,[{key:"delete",value:function(){on(Object(Pe.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Z(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Z(fe(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new ze(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=Gn(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=Hn.isSupported(t)?new Hn(t):Hn.getDefaultArray(t),ee(this,"VertexArray","v6.0",qn),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new ze(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof ze){var a=n;if(r){var o=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,o)}else{var s=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,s)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}(),Yn=5126,Qn=5124,Kn=5125,Jn=function(){function e(t){var n;for(var r in Object(i.a)(this,e),this.layout={},this.size=0,t)this._addUniform(r,t[r]);this.size+=(4-this.size%4)%4;var a=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,Yn,a),Object(c.a)(n,Qn,new Int32Array(a.buffer)),Object(c.a)(n,Kn,new Uint32Array(a.buffer)),n)}return Object(r.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[Yn]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Z(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Fn(t);Z(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}();function $n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,i=e.program,r=e.uniforms,a=e.undefinedOnly,o=void 0!==a&&a;Z(i);var s=i._uniformSetters,u={},l=Object.keys(s).sort(),f=0,h=!0,d=!1,v=void 0;try{for(var g,p=l[Symbol.iterator]();!(h=(g=p.next()).done);h=!0){var m=g.value;m.match(".*_.*")||m.match(".*Matrix")||ei({table:u,header:n,uniforms:r,uniformName:m,undefinedOnly:o})&&f++}}catch(e){d=!0,v=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw v}}var y=!0,b=!1,_=void 0;try{for(var x,w=l[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var P=x.value;P.match(".*Matrix")&&ei({table:u,header:n,uniforms:r,uniformName:P,undefinedOnly:o})&&f++}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var O=!0,k=!1,S=void 0;try{for(var j,C=l[Symbol.iterator]();!(O=(j=C.next()).done);O=!0){var E=j.value;u[E]||ei({table:u,header:n,uniforms:r,uniformName:E,undefinedOnly:o})&&f++}}catch(e){k=!0,S=e}finally{try{O||null==C.return||C.return()}finally{if(k)throw S}}var A=0,T={};if(!o)for(var M in r){var L=r[M];u[M]||(A++,T[M]=Object(c.a)({Type:"NOT USED: ".concat(L)},n,$(L)))}return{table:u,count:f,unusedTable:T,unusedCount:A}}function ei(e){var t,n=e.table,i=e.header,r=e.uniforms,a=e.uniformName,o=e.undefinedOnly,s=r[a],u=function(e){return null!=e}(s);return(!o||!u)&&(n[a]=(t={},Object(c.a)(t,i,u?$(s):"N/A"),Object(c.a)(t,"Uniform Type",u?s:"NOT PROVIDED"),t),!0)}function ti(e,t,n,i){var r,a,o,s,u=e.gl,l="NOT PROVIDED",f="N/A",h="N/A",d="N/A";if(n&&(l=n.type,f=n.size,a=-1!==(l=String(l).replace("Array","")).indexOf("nt")),t instanceof ze){var v,g,p=t,m=p.getDebugData(),y=m.data;if(o=m.modified?"*":"",s=y,h=(d=p.byteLength)/y.BYTES_PER_ELEMENT/f,n){var b=n.divisor>0;g="".concat(b?"I ":"P "," ").concat(h," (x").concat(f,"=").concat(d," bytes ").concat(xe(u,l),")")}else a=!0,g="".concat(d," bytes");return v={},Object(c.a)(v,i,"".concat(o).concat($(s,{size:f,isInteger:a}))),Object(c.a)(v,"Format ",g),v}return s=t,f=t.length,a=-1!==(l=String(t.constructor.name).replace("Array","")).indexOf("nt"),r={},Object(c.a)(r,i,"".concat($(s,{size:f,isInteger:a})," (constant)")),Object(c.a)(r,"Format ","".concat(f,"x").concat(l," (constant)")),r}function ni(e,t){var n=Rn(t.type,t.size);return n?"".concat(e," (").concat(n.name,")"):e}function ii(e){var t=e.accessor,n=Rn(t.type,t.size);return n?"".concat(n.name," ").concat(e.name):e.name}var ri={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ai=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id,r=void 0===n?Q("geometry"):n,a=t.drawMode,o=void 0===a?ri.TRIANGLES:a,s=t.mode,u=t.attributes,c=void 0===u?{}:u,l=t.indices,f=void 0===l?null:l,h=t.vertexCount,d=void 0===h?null:h;this.id=r,this.drawMode=0|o||0|s,this.attributes={},this.userData={},this._setAttributes(c,f),this.vertexCount=d||this._calculateVertexCount(this.attributes,this.indices)}return Object(r.a)(e,null,[{key:"DRAW_MODE",get:function(){return ri}}]),Object(r.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?H({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Z(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"indices"===n?(Z(!this.indices),this.indices=i,void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed)):this.attributes[n]=i}return this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}if(!Number.isFinite(n)){var s=e.POSITION||e.positions;s&&(n=s.value&&s.value.length/(s.size||3))}return Z(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}(),oi=function e(){Object(i.a)(this,e)},si=n(47),ui=[255,255,255],ci=[0,0,1],li=[0,0,-1],fi=[0,0,1],hi=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e),this.id=t.id||Q("light");var n=t.color,r=void 0===n?ui:n;this.color=r;var a=t.intensity,o=void 0===a?1:a;this.intensity=o},di=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).type="ambient",e}return Object(ke.a)(t,e),t}(hi),vi=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).type="directional";var r=n.direction,a=void 0===r?li:r;return e.direction=new si.a(a).normalize().toArray(),e}return Object(ke.a)(t,e),t}(hi),gi=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).type="point";var r=n.position,a=void 0===r?fi:r;return e.position=a,e.attenuation=e._getAttenuation(n),e}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:ci}}]),t}(hi),pi=0,mi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.onCreateContext,r=void 0===n?function(e){return Gt(e)}:n,a=t.onAddHTML,o=void 0===a?null:a,s=t.onInitialize,u=void 0===s?function(){}:s,c=t.onRender,l=void 0===c?function(){}:c,f=t.onFinalize,h=void 0===f?function(){}:f,d=t.gl,v=void 0===d?null:d,g=t.glOptions,p=void 0===g?{}:g,m=t.debug,y=void 0!==m&&m,b=t.createFramebuffer,_=void 0!==b&&b,x=t.autoResizeViewport,w=void 0===x||x,P=t.autoResizeDrawingBuffer,O=void 0===P||P,S=t.stats,j=void 0===S?C.get("animation-loop-".concat(pi++)):S,E=t.useDevicePixels,A=void 0===E||E;"useDevicePixelRatio"in t&&(k.deprecated("useDevicePixelRatio","useDevicePixels")(),A=t.useDevicePixelRatio),this.props={onCreateContext:r,onAddHTML:o,onInitialize:u,onRender:l,onFinalize:h,gl:v,glOptions:p,debug:y,createFramebuffer:_},this.gl=v,this.needsRedraw=null,this.timeline=null,this.stats=j,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:w,autoResizeDrawingBuffer:O,useDevicePixels:A}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Z("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,ae().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=Bn.isSupported(e.gl,["timers"])?new Bn(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),ge(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(Je.a)(Ke.a.mark(function e(){return Ke.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return k.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;ge(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||ve(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(s.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Wt(this.props.gl,e):this.onCreateContext(e),!le(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(E.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas,r=i.clientWidth,a=i.clientHeight;return r>0&&a>0?n=r/a:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Xt(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new Dt(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()&&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(){this.gl.canvas.addEventListener("mousemove",this._onMousemove),this.gl.canvas.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}}]),e}(),yi=new Uint8Array([0,0,0]);function bi(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function _i(e){var t=Object(A.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function xi(){return yi}var wi={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Pi(e,t){var n=(t||{}).attributeMap,i=void 0===n?wi:n;return i&&i[e]||e}function Oi(e,t){var n;switch(e){case"indices":n=n||"indices";break;case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2;break;case"indices":t.size=t.size||1,t.isIndexed=void 0===t.isIndexed||t.isIndexed,Z(t.value instanceof Uint16Array||t.value instanceof Uint32Array,'attribute array for "indices" must be of integer type')}Z(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var ki=n(25),Si=n(99),ji=n(30),Ci=n.n(ji),Ei={},Ai=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},Ti=new Map;Ci.a.listenFor("luma.gl",function(e){var t=Ei[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){o.d.__SEER_INITIALIZED__&&(Ti.has(e)||Ti.set(e,new Map),Ti.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();Ai(i,n,e.value),t.setUniforms(i)}});var Mi,Li=["renderPickingBuffer","pickingEnabled"],Ii=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Z(le(t));var r=n.id,a=void 0===r?Q("base-model"):r;this.id=a,this.gl=t,this.id=n.id||Q("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(r.a)(e,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props={},this.program=this._createProgram(e),this.vertexArray=new Zn(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete Ei[t],Ci.a.deleteItem("luma.gl",t)}},{key:"destroy",value:function(){this.delete()}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.getUniforms()}},{key:"setUniforms",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),function(e,t){if(o.d.__SEER_INITIALIZED__&&e){var n=Ti.get(e);n&&n.forEach(function(e,n){Ai(t,n,e)})}}(this.id,t),t=this._extractAnimatedUniforms(t),this.program.setUniforms(t,function(){e._checkForDeprecatedUniforms(t)}),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return gt(this.program.gl,e),this}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,s=t.attributes,u=void 0===s?{}:s,c=t.transformFeedback,l=void 0===c?this.transformFeedback:c,f=t.parameters,h=void 0===f?{}:f,d=t.vertexArray,v=void 0===d?this.vertexArray:d,g=t.animationProps;Ei[(e=this).id]||(Ei[e.id]=e,Ci.a.listItem("luma.gl",e.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(g);var p=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&k.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,b=m.indexType,_=m.indexOffset,x=this.isInstanced,w=this.instanceCount,P=function(){},O=this.props,S=O.onBeforeRender,j=void 0===S?P:S,C=O.onAfterRender,E=void 0===C?P:C;j(),this._timerQueryStart();var A=this.program.draw(Object.assign({},t,{logPriority:p,uniforms:null,framebuffer:r,parameters:h,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:b,isInstanced:x,instanceCount:w,offset:y?_:0}));return this._timerQueryEnd(),E(),this._logDrawCallEnd(p,v,r),A}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(c.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&Bn.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&k.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,s=e.defines,u=void 0===s?{}:s,c=e.inject,l=void 0===c?{}:c,f=e.shaderCache,h=void 0===f?null:f,d=e.varyings,v=void 0===d?null:d,g=e.bufferMode,p=void 0===g?35981:g,m=e.program,y=void 0===m?null:m;this.getModuleUniforms=function(e){};var b=this.id;if(!y){n=n||ki.a.vs,r=r||ki.a.fs;var _=Object(Si.a)(this.gl,{vs:n,fs:r,modules:o,inject:l,defines:u,log:k});n=_.vs,r=_.fs,y=h?h.getProgram(this.gl,{id:b,vs:n,fs:r}):new zn(this.gl,{id:b,vs:n,fs:r,varyings:v,bufferMode:p}),this.getModuleUniforms=_.getUniforms||function(e){}}return Z(y instanceof zn,"Model needs a program"),y}},{key:"_checkForDeprecatedUniforms",value:function(e){Li.forEach(function(t){t in e&&k.deprecated(t,"use picking shader module and Model class updateModuleSettings()")()})}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!J(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new Bn(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,k.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(k.priority>> DRAWING MODEL ".concat(this.id),{collapsed:k.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=ti(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),c=t.accessors[s.location];c&&(u="".concat(o,": ").concat(ni(s.name,c))),r[u]=ti(t,a[o],c,i)}}return r}({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=$n({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,l=$n({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),f=l.table;l.count>0&&k.log("MISSING UNIFORMS",Object.keys(f))(),u>0&&k.log("UNUSED UNIFORMS",Object.keys(s))();var h=function(e){var t={},n="Accessors for ".concat(e.id),i=!0,r=!1,a=void 0;try{for(var o,s=e.attributeInfos[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(u){var l=ii(u);t["in ".concat(l)]=Object(c.a)({},n,JSON.stringify(u.accessor))}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}var f=!0,h=!1,d=void 0;try{for(var v,g=e.varyingInfos[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;if(p){var m=ii(p);t["out ".concat(m)]=Object(c.a)({},n,JSON.stringify(p.accessor))}}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}return t}(this.vertexArray.configuration);k.table(e,r)(),k.table(e,o)(),k.table(e+1,h)(),function(e,t){if(Ci.a.isReady()&&!Ci.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);Ci.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),k.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}(),Fi=function(e){function t(e,n){Object(i.a)(this,t);var r=n.id,a=void 0===r?Q("model"):r;return Object(we.a)(this,Object(Pe.a)(t).call(this,e,H({},n,{id:a})))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};on(Object(Pe.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Z(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){on(Object(Pe.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){on(Object(Pe.a)(t.prototype),"delete",this).call(this),this._deleteGeometryBuffers()}},{key:"destroy",value:function(){this.delete()}},{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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Z(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Z(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=function(e,t,n){var i={};for(var r in t.attributes){var a=t.attributes[r],o=Pi(r,n);if(a.constant)i[o]=a.value;else{var s=a.value,u=H({},a);delete u.value,i[o]=[new ze(e,s),u],Oi(r,u)}}return t.indices&&(i.indices=new ze(e,{data:t.indices.value||t.indices,target:34963})),i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(J(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(c.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return k.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof ze&&t.delete()}}},{key:"_setAnimationProps",value:function(e){var t=this;if(this.animated){Z(e,"Model.draw(): animated uniforms but no animationProps");var n=this._evaluateAnimateUniforms(e);this.program.setUniforms(n,function(){t._checkForDeprecatedUniforms(n)})}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(J(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new Un(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new Bn(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,k.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}}]),t}(Ii),Ri=n(110),Ni=n(76),Di=n(136),zi="transform_uSampler_",Bi="transform_uSize_",Ui="transform_position";function Vi(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,s={},u=t,c={};if(a>0||i){var l=u.split("\n"),f=l.slice();if(l.forEach(function(e,t,r){if(a>0){var u=function(e,t){var n={},i=function(e){return Object(Ni.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(zi).concat(e),n="".concat(Bi).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),u=s.samplerName,c=s.sizeName,l=s.uniformDeclerations,f=Object(Ni.e)(r),h=" ".concat(r," ").concat(a," = transform_getInput(").concat(u,", ").concat(c,").").concat(f,";\n");n[u]=a;var d={"vs:#decl":l,"vs:#main-start":h};return{updatedLine:o,inject:d,samplerTextureMap:n}}return null}(e,n);if(u){var l=u.updatedLine,h=u.inject;f[t]=l,c=Object(Ri.a)([c,h]),Object.assign(s,u.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(Ni.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Z(r);var h="".concat(Bi).concat(i),d={"vs:#decl":"uniform vec2 ".concat(h,";\n"),"vs:#main-start":" vec2 ".concat(Ui," = transform_getPos(").concat(h,");\n gl_Position = vec4(").concat(Ui,", 0, 1.);\n")};c=Object(Ri.a)([c,d])}u=f.join("\n")}return{vs:u,targetTextureType:o,inject:c,samplerTextureMap:s}}var Gi=(Mi={},Object(c.a)(Mi,10241,9728),Object(c.a)(Mi,10240,9728),Object(c.a)(Mi,10242,33071),Object(c.a)(Mi,10243,33071),Mi),Wi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Z(fe(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this._createdBuffers={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(r.a)(e,null,[{key:"isSupported",value:function(e){return fe(e)}}]),Object(r.a)(e,[{key:"delete",value:function(){for(var e in this._createdBuffers)this._createdBuffers[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof ze?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Z(!n||n===this.targetTextureVarying);var o=yt(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,u=Object(Ni.d)(this.targetTextureType),c=new s(o.length*u/4),l=0,f=0;f0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,Z(s=this.framebuffers[this.currentIndex]),r.viewport=[0,0,s.width,s.height],o&&this.gl.clear(this.gl.COLOR_BUFFER_BIT)),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){k.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Z(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Z(r[o]instanceof ze||r[o].buffer instanceof ze);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(Gi)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Z(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(k.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(k.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,f=e._swapTexture;for(var h in Z(a&&(s||n||c)&&o),t||{})Z(t[h]instanceof ze||t[h].buffer instanceof ze);for(var d in u||{})Z(u[d]instanceof Ye);return Z(!c||l),Z(!f||u[f]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n);Z(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e){var t;if(e instanceof Ye)return e;var n=this.sourceTextures[0][e];return n?(this._targetRefTexName=e,zt(n,{parameters:(t={},Object(c.a)(t,10241,9728),Object(c.a)(t,10240,9728),Object(c.a)(t,10242,33071),Object(c.a)(t,10243,33071),t),pixelStore:Object(c.a)({},37440,!1)})):null}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=new ze(this.gl,{byteLength:o,usage:s,accessor:u});this._createdBuffers[r]&&this._createdBuffers[r].delete(),this._createdBuffers[r]=c,this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new ze(this.gl,t);return this._createdBuffers[e]&&(this._createdBuffers[e].delete(),this._createdBuffers[e]=n),n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Z(this.feedbackBuffers[t][i]instanceof ze))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new Fi(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){J(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new Un(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new Un(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new Dt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(c.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new Dt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(c.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new ze(this.gl,{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,s=Object(Ri.a)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:Object(Ni.b)({version:$t(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Di.a].concat(e.modules||[]):e.modules,uniforms:i,inject:s,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return Vi({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}(),Hi="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",Xi=[-1,-1,1,-1,-1,1,1,1],qi=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=Xi.map(function(e){return-1===e?0:e});return(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({},n,{vs:Hi,geometry:new ai({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(Xi)},aTexCoord:{size:2,value:new Float32Array(a)},aCoordinate:{size:2,value:new Float32Array(a)}}})})))).setVertexCount(4),r}return Object(ke.a)(t,e),t}(Fi),Zi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Z(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Z("string"==typeof t),Z(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new rn(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Z("string"==typeof t),Z(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new an(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Z(this._compareContexts(e,this.gl)),Z("string"==typeof t.vs),Z("string"==typeof t.fs),Z("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new zn(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}(),Yi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.onInitialize,a=void 0===r?function(){}:r,o=n.onFinalize,s=void 0===o?function(){}:o,u=n.useDevicePixels,c=void 0===u||u,l=n.autoResizeDrawingBuffer,f=void 0===l||l;this.props={onInitialize:a,onFinalize:s},this.setProps({autoResizeDrawingBuffer:f,useDevicePixels:c}),Z(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._resolveNextFrame=null,this._nextFramePromise=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(r.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.addEventListener("message",function(n){switch(n.data.command){case"start":i=n.data.opts.canvas,r=new Map,i.addEventListener=function(e,n){t.postMessage({command:"addEventListener",type:e}),r.has(e)||r.set(e,[]),r.get(e).push(n)},i.removeEventListener=function(e,n){t.postMessage({command:"removeEventListener",type:e});var i=r.get(e);i&&i.splice(i.indexOf(n),1)},i.dispatchEvent=function(e,t){var n=r.get(e);n&&n.forEach(function(e){return e(t)})},t.canvas=i,e.start(n.data.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=n.data.width,t.canvas.height=n.data.height;break;case"event":t.canvas.dispatchEvent(n.data.type,n.data.event)}var i,r})}}}]),Object(r.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,ae().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=ve(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(ge(this._animationFrameId),this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"waitForRender",value:function(){var e=this;return this._nextFramePromise||(this._nextFramePromise=new Promise(function(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(s.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._animationFrameId=ve(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=oe(e);t.transferControlToOffscreen||k.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),Qi=function(){function e(t,n){Object(i.a)(this,e);var r=n.id,a=void 0===r?"pass":r;this.id=a,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(r.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=Dt.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),R(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),Ki=function(e){function t(e,n){return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(Qi),Ji=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(i.a)(this,e),this.gl=t,this.framebuffer1=new Dt(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new Dt(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(r.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),$i=function(e){function t(e,n){var r;return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"multi-pass"},n)))).renderState=new Ji(e,n),r}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(Ki),er=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.gl,n=this.props.clearBits,i=void 0===n?16640:n;t.clear(i)}}]),t}(Qi),tr=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(Qi),nr="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",ir=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},r)))).clipspace=new qi(e,{id:"copy-pass",fs:nr}),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Qi),rr="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",ar=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t),n=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:"texture-pass"},r)));var a=r.texture,o=r.opacity,s=void 0===o?1:o;return n.clipspace=new qi(e,{id:"texture-pass",fs:rr,uniforms:{uDiffuseSampler:a,uOpacity:s}}),n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Qi),or=n(145),sr=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Qi),ur=function(e){function t(e,n){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t);var o="".concat(n.name,"-pass");Object(or.a)(n);var s=function(e,t,n,i){if(t.filter||t.sampler){var r=hr(t),a=new sr(e,{id:n,model:cr(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=hr(t,r),s="".concat(n,"-").concat(o.length+1);return new sr(e,Object.assign({id:s,model:cr(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,o,a);return(r=Object(we.a)(this,Object(Pe.a)(t).call(this,e,Object.assign({id:o,passes:s},a)))).module=n,r}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.module.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1,c.uniforms&&c.model.setUniforms(c.uniforms),c.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(Ki);function cr(e,t,n,i,r){var a=new qi(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var lr=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},fr=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function hr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return lr(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return fr(i)}return null}var dr={x:[2,0,1],y:[0,1,2],z:[1,2,0]},vr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("truncated-code-geometry"):n,a=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,P=x(b),O=_(b),k=v?-2:0,S=l+(p?2:0),j=u+1,C=new Uint16Array(u*(l+m)*6),E=dr[h],A=new Float32Array(3*y),T=new Float32Array(3*y),M=new Float32Array(2*y),L=0,I=0,F=k;F<=S;F++){var R=F/l,N=o*R,D=void 0;F<0?(N=0,R=1,D=n):F>l?(N=o,R=1,D=r):D=n+F/l*(r-n),-2!==F&&F!==l+2||(D=0,R=0),N-=o/2;for(var z=0;zl?0:B*P,T[L+E[1]]=F<0?-1:F>l?1:O,T[L+E[2]]=F<0||F>l?0:U*P,M[I+0]=z/u,M[I+1]=R,I+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("cone-geometry"):n,a=e.radius,o=void 0===a?1:a,s=e.cap,u=void 0===s||s;return Object(we.a)(this,Object(Pe.a)(t).call(this,H({},e,{id:r,topRadius:0,topCap:Boolean(u),bottomCap:Boolean(u),bottomRadius:o})))}return Object(ke.a)(t,e),t}(vr),pr=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]),mr=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]),yr=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]),br=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]),_r={POSITION:{size:3,value:new Float32Array(mr)},NORMAL:{size:3,value:new Float32Array(yr)},TEXCOORD_0:{size:2,value:new Float32Array(br)}},xr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("cube-geometry"):n;return Object(we.a)(this,Object(Pe.a)(t).call(this,H({},e,{id:r,indices:{size:1,value:new Uint16Array(pr)},attributes:H({},_r,e.attributes)})))}return Object(ke.a)(t,e),t}(ai),wr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("cylinder-geometry"):n,a=e.radius,o=void 0===a?1:a;return Object(we.a)(this,Object(Pe.a)(t).call(this,H({},e,{id:r,bottomRadius:o,topRadius:o})))}return Object(ke.a)(t,e),t}(vr),Pr=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],Or=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],kr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("ico-sphere-geometry"):n,a=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).iterations,t=void 0===e?0:e,n=Math.PI,i=2*n,r=[].concat(Pr),a=[].concat(Or);r.push(),a.push();for(var o=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,a=t>n?t:n,o="".concat(i,"|").concat(a);if(o in e)return e[o];var s=r[t],u=r[t+1],c=r[t+2],l=r[n],f=r[n+1],h=r[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,r.push(d,v,g),e[o]=r.length/3-1}}(),s=0;s=0;g-=3){var p=a[g+0],m=a[g+1],y=a[g+2],b=3*p,_=3*m,x=3*y,w=2*p,P=2*m,O=2*y,k=r[b+0],S=r[b+1],j=r[b+2],C=Math.acos(j/Math.sqrt(k*k+S*S+j*j)),E=Math.atan2(S,k)+n,A=C/n,T=1-E/i,M=r[_+0],L=r[_+1],I=r[_+2],F=Math.acos(I/Math.sqrt(M*M+L*L+I*I)),R=Math.atan2(L,M)+n,N=F/n,D=1-R/i,z=r[x+0],B=r[x+1],U=r[x+2],V=Math.acos(U/Math.sqrt(z*z+B*B+U*U)),G=Math.atan2(B,z)+n,W=V/n,H=1-G/i,X=[z-M,B-L,U-I],q=[k-M,S-L,j-I],Z=new si.a(X).cross(q).normalize(),Y=void 0;(0===T||0===D||0===H)&&(0===T||T>.5)&&(0===D||D>.5)&&(0===H||H>.5)&&(r.push(r[b+0],r[b+1],r[b+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=A,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z,r.push(r[_+0],r[_+1],r[_+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=N,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z,r.push(r[x+0],r[x+1],r[x+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=W,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z),d[b+0]=d[_+0]=d[x+0]=Z.x,d[b+1]=d[_+1]=d[x+1]=Z.y,d[b+2]=d[_+2]=d[x+2]=Z.z,v[w+0]=T,v[w+1]=A,v[P+0]=D,v[P+1]=N,v[O+0]=H,v[O+1]=W}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(r)},NORMAL:{size:3,value:new Float32Array(d)},TEXCOORD_0:{size:2,value:new Float32Array(v)}}}}(e),o=a.indices,s=a.attributes;return Object(we.a)(this,Object(Pe.a)(t).call(this,H({},e,{id:r,indices:o,attributes:H({},s,e.attributes)})))}return Object(ke.a)(t,e),t}(ai);var Sr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("plane-geometry"):n,a=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")],f=e["".concat(c[1],"len")],h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,P=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=P,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*P-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*P-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*P-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0}y+=2,b+=3}for(var O=h+1,k=new Uint16Array(h*d*6),S=0;S0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?Q("sphere-geometry"):n,a=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,P=s*y,O=Math.sin(w),k=Math.cos(w),S=Math.sin(P),j=Math.cos(P),C=k*S,E=j,A=O*S,T=o(C,E,A,m,y);f[x+0]=T*C,f[x+1]=T*E,f[x+2]=T*A,h[x+0]=C,h[x+1]=E,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var M=n+1,L=0;L1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Z(e),t=t||this.matrix;var n=new Tr.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{key:"transform",value:function(){if(this.parent){var e=this.parent;this.endPosition.set(this.position.add(e.endPosition)),this.endRotation.set(this.rotation.add(e.endRotation)),this.endScale.set(this.scale.add(e.endScale))}else this.endPosition.set(this.position),this.endRotation.set(this.rotation),this.endScale.set(this.scale);for(var t=this.children,n=0;n0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var r=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===r?[]:r;return a.every(function(e){return Z(e instanceof Mr)}),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).children=a,e}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),on(Object(Pe.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new Tr.a:n,r=new Tr.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l instanceof t?l.traverse(e,{worldMatrix:r}):e(l,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return k.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(Mr),Ir=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(we.a)(this,Object(Pe.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof Fi?(n.model=e,n._setModelNodeProps(r)):n.model=new Fi(e,r),n.managedResources=r.managedResources||[],n}return Object(ke.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return on(Object(Pe.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(Mr),Fr=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object(we.a)(this,Object(Pe.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(ke.a)(t,e),t}(Mr);n.d(t,"isWebGL",function(){return le}),n.d(t,"isWebGL2",function(){return fe}),n.d(t,"lumaStats",function(){return C}),n.d(t,"createGLContext",function(){return Gt}),n.d(t,"destroyGLContext",function(){return Ht}),n.d(t,"resizeGLContext",function(){return Xt}),n.d(t,"setGLContextDefaults",function(){return Vt}),n.d(t,"getContextInfo",function(){return Et}),n.d(t,"getGLContextInfo",function(){return Ct}),n.d(t,"getContextLimits",function(){return jt}),n.d(t,"FEATURES",function(){return At}),n.d(t,"hasFeature",function(){return Mt}),n.d(t,"hasFeatures",function(){return Lt}),n.d(t,"getFeatures",function(){return It}),n.d(t,"canCompileGLGSExtension",function(){return Nt}),n.d(t,"cloneTextureFrom",function(){return zt}),n.d(t,"getKeyValue",function(){return _e}),n.d(t,"getKey",function(){return xe}),n.d(t,"setContextDefaults",function(){return Vt}),n.d(t,"glGetDebugInfo",function(){return se}),n.d(t,"trackContextState",function(){return I.a}),n.d(t,"resetParameters",function(){return E.d}),n.d(t,"getParameter",function(){return E.b}),n.d(t,"getParameters",function(){return E.c}),n.d(t,"setParameter",function(){return E.e}),n.d(t,"setParameters",function(){return L}),n.d(t,"withParameters",function(){return R}),n.d(t,"getModifiedParameters",function(){return E.a}),n.d(t,"Buffer",function(){return ze}),n.d(t,"Shader",function(){return nn}),n.d(t,"VertexShader",function(){return rn}),n.d(t,"FragmentShader",function(){return an}),n.d(t,"Program",function(){return zn}),n.d(t,"Framebuffer",function(){return Dt}),n.d(t,"Renderbuffer",function(){return ot}),n.d(t,"Texture2D",function(){return Ye}),n.d(t,"TextureCube",function(){return et}),n.d(t,"clear",function(){return gt}),n.d(t,"clearBuffer",function(){return pt}),n.d(t,"readPixelsToArray",function(){return yt}),n.d(t,"readPixelsToBuffer",function(){return bt}),n.d(t,"copyToDataUrl",function(){return _t}),n.d(t,"copyToImage",function(){return xt}),n.d(t,"copyToTexture",function(){return wt}),n.d(t,"blit",function(){return Pt}),n.d(t,"Query",function(){return Bn}),n.d(t,"Texture3D",function(){return nt}),n.d(t,"TransformFeedback",function(){return Un}),n.d(t,"VertexArrayObject",function(){return Hn}),n.d(t,"VertexArray",function(){return Zn}),n.d(t,"UniformBufferLayout",function(){return Jn}),n.d(t,"setPathPrefix",function(){return Xe}),n.d(t,"loadFile",function(){return qe}),n.d(t,"loadImage",function(){return Ze}),n.d(t,"_Accessor",function(){return Fe}),n.d(t,"_clearBuffer",function(){return pt}),n.d(t,"Geometry",function(){return ai}),n.d(t,"Material",function(){return oi}),n.d(t,"AmbientLight",function(){return di}),n.d(t,"DirectionalLight",function(){return vi}),n.d(t,"PointLight",function(){return gi}),n.d(t,"AnimationLoop",function(){return mi}),n.d(t,"encodePickingColor",function(){return bi}),n.d(t,"decodePickingColor",function(){return _i}),n.d(t,"getNullPickingColor",function(){return xi}),n.d(t,"Model",function(){return Fi}),n.d(t,"Transform",function(){return Wi}),n.d(t,"ClipSpace",function(){return qi}),n.d(t,"_ShaderCache",function(){return Zi}),n.d(t,"_AnimationLoopProxy",function(){return Yi}),n.d(t,"_MultiPassRenderer",function(){return $i}),n.d(t,"_RenderState",function(){return Ji}),n.d(t,"_Pass",function(){return Qi}),n.d(t,"_CompositePass",function(){return Ki}),n.d(t,"_ClearPass",function(){return er}),n.d(t,"_RenderPass",function(){return tr}),n.d(t,"_CopyPass",function(){return ir}),n.d(t,"_TexturePass",function(){return ar}),n.d(t,"_ShaderModulePass",function(){return ur}),n.d(t,"ConeGeometry",function(){return gr}),n.d(t,"CubeGeometry",function(){return xr}),n.d(t,"CylinderGeometry",function(){return wr}),n.d(t,"IcoSphereGeometry",function(){return kr}),n.d(t,"PlaneGeometry",function(){return Sr}),n.d(t,"SphereGeometry",function(){return jr}),n.d(t,"TruncatedConeGeometry",function(){return vr}),n.d(t,"PhongMaterial",function(){return Er}),n.d(t,"PBRMaterial",function(){return Ar}),n.d(t,"ScenegraphNode",function(){return Mr}),n.d(t,"GroupNode",function(){return Lr}),n.d(t,"ModelNode",function(){return Ir}),n.d(t,"CameraNode",function(){return Fr}),n.d(t,"registerShaderModules",function(){return ki.u}),n.d(t,"setDefaultShaderModules",function(){return ki.v}),n.d(t,"assembleShaders",function(){return ki.c}),n.d(t,"createShaderHook",function(){return ki.g}),n.d(t,"createModuleInjection",function(){return ki.f}),n.d(t,"combineInjects",function(){return ki.d}),n.d(t,"normalizeShaderModule",function(){return ki.p}),n.d(t,"fp32",function(){return ki.j}),n.d(t,"fp64",function(){return ki.k}),n.d(t,"project",function(){return ki.t}),n.d(t,"lights",function(){return ki.o}),n.d(t,"dirlight",function(){return ki.i}),n.d(t,"picking",function(){return ki.s}),n.d(t,"diffuse",function(){return ki.h}),n.d(t,"gouraudlighting",function(){return ki.n}),n.d(t,"phonglighting",function(){return ki.r}),n.d(t,"pbr",function(){return ki.q}),n.d(t,"_transform",function(){return ki.b}),n.d(t,"MODULAR_SHADERS",function(){return ki.a}),n.d(t,"getQualifierDetails",function(){return ki.m}),n.d(t,"getPassthroughFS",function(){return ki.l}),n.d(t,"typeToChannelSuffix",function(){return ki.x}),n.d(t,"typeToChannelCount",function(){return ki.w}),n.d(t,"convertToVec4",function(){return ki.e}),n.d(t,"log",function(){return k}),n.d(t,"assert",function(){return Z}),n.d(t,"uid",function(){return Q}),n.d(t,"self",function(){return o.c}),n.d(t,"window",function(){return o.d}),n.d(t,"global",function(){return o.b}),n.d(t,"document",function(){return o.a})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var f={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(e){return"string"==typeof e?f[e.toUpperCase()]||f.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(58),g={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!1,priority:0};function m(){}var y={};var b=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(166)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var f=new Image;return f.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(f,i,o)))},f.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=h(a),r="[".concat(a,"m").concat(r,"")),o&&(a=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();b.VERSION=u.a;t.a=new b({id:"deck"}).enable()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){e.exports=n(180)},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"c",function(){return a});var i=1e-6,r="undefined"!=typeof Float32Array?Float32Array:Array,a=Math.random;Math.PI},function(e,t,n){n(5);var i=n(176);function r(t,n,a){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=r=Reflect.get:e.exports=r=function(e,t,n){var r=i(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}},r(t,n,a||t)}e.exports=r},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return g}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return b});var i=n(16);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],g=t[13],p=t[14],m=t[15],y=n*s-i*o,b=n*u-r*o,_=n*c-a*o,x=i*u-r*s,w=i*c-a*s,P=r*c-a*u,O=l*g-f*v,k=l*p-h*v,S=l*m-d*v,j=f*p-h*g,C=f*m-d*g,E=h*m-d*p,A=y*E-b*C+_*j+x*S-w*k+P*O;return A?(A=1/A,e[0]=(s*E-u*C+c*j)*A,e[1]=(r*C-i*E-a*j)*A,e[2]=(g*P-p*w+m*x)*A,e[3]=(h*w-f*P-d*x)*A,e[4]=(u*S-o*E-c*k)*A,e[5]=(n*E-r*S+a*k)*A,e[6]=(p*_-v*P-m*b)*A,e[7]=(l*P-h*_+d*b)*A,e[8]=(o*C-s*S+c*O)*A,e[9]=(i*S-n*C-a*O)*A,e[10]=(v*w-g*_+m*y)*A,e[11]=(f*_-l*w-d*y)*A,e[12]=(s*k-o*j-u*O)*A,e[13]=(n*j-i*k+r*O)*A,e[14]=(g*b-v*x-p*y)*A,e[15]=(l*x-f*b+h*y)*A,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],v=e[13],g=e[14],p=e[15];return(t*o-n*a)*(f*p-h*g)-(t*s-i*a)*(l*p-h*v)+(t*u-r*a)*(l*g-f*v)+(n*s-i*o)*(c*p-h*d)-(n*u-r*o)*(c*g-f*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],g=t[12],p=t[13],m=t[14],y=t[15],b=n[0],_=n[1],x=n[2],w=n[3];return e[0]=b*i+_*s+x*f+w*g,e[1]=b*r+_*u+x*h+w*p,e[2]=b*a+_*c+x*d+w*m,e[3]=b*o+_*l+x*v+w*y,b=n[4],_=n[5],x=n[6],w=n[7],e[4]=b*i+_*s+x*f+w*g,e[5]=b*r+_*u+x*h+w*p,e[6]=b*a+_*c+x*d+w*m,e[7]=b*o+_*l+x*v+w*y,b=n[8],_=n[9],x=n[10],w=n[11],e[8]=b*i+_*s+x*f+w*g,e[9]=b*r+_*u+x*h+w*p,e[10]=b*a+_*c+x*d+w*m,e[11]=b*o+_*l+x*v+w*y,b=n[12],_=n[13],x=n[14],w=n[15],e[12]=b*i+_*s+x*f+w*g,e[13]=b*r+_*u+x*h+w*p,e[14]=b*a+_*c+x*d+w*m,e[15]=b*o+_*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,f,h,d,v,g=n[0],p=n[1],m=n[2];return t===e?(e[12]=t[0]*g+t[4]*p+t[8]*m+t[12],e[13]=t[1]*g+t[5]*p+t[9]*m+t[13],e[14]=t[2]*g+t[6]*p+t[10]*m+t[14],e[15]=t[3]*g+t[7]*p+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=v,e[12]=i*g+s*p+f*m+t[12],e[13]=r*g+u*p+h*m+t[13],e[14]=a*g+c*p+d*m+t[14],e[15]=o*g+l*p+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,f,h,d,v,g,p,m,y,b,_,x,w,P,O,k,S,j,C,E=r[0],A=r[1],T=r[2],M=Math.sqrt(E*E+A*A+T*T);return M0&&void 0!==arguments[0]?arguments[0]:l;return e.viewport?Object(c.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]},h={name:"project32",dependencies:[f],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"},d=n(84),v=a.fp64.fp64ify,g=a.fp64.fp64ifyMatrix4,p={name:"project64",dependencies:[f,a.fp64],vs:"\nconst vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);\n\nuniform vec2 project64_uScale;\nuniform vec2 project_uViewProjectionMatrixFP64[16];\nvoid mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) {\n\n#if defined(NVIDIA_FP64_WORKAROUND)\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64 * ONE);\n#else\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64);\n#endif\n out_val[1] = sub_fp64(PI_FP64,\n log_fp64(tan_fp64(sum_fp64(PI_4_FP64, radians_fp64(lnglat_fp64.zw) / 2.0))));\n return;\n}\n\nvoid project_position_fp64(vec4 position_fp64, out vec2 out_val[2]) {\n vec2 pos_fp64[2];\n mercatorProject_fp64(position_fp64, pos_fp64);\n vec2 x_fp64 = mul_fp64(pos_fp64[0], project64_uScale);\n vec2 y_fp64 = mul_fp64(pos_fp64[1], project64_uScale);\n out_val[0] = mul_fp64(x_fp64, WORLD_SCALE_FP64);\n out_val[1] = mul_fp64(y_fp64, WORLD_SCALE_FP64);\n\n return;\n}\n\nvoid project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val[2]) {\n vec4 position64xy = vec4(\n position.x, position64xyLow.x,\n position.y, position64xyLow.y);\n\n project_position_fp64(position64xy, out_val);\n}\n\nvec4 project_common_position_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n vec2 vertex_pos_clipspace[4];\n mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace,\n vertex_pos_clipspace);\n return vec4(\n vertex_pos_clipspace[0].x,\n vertex_pos_clipspace[1].x,\n vertex_pos_clipspace[2].x,\n vertex_pos_clipspace[3].x\n );\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec2 offset64[4];\n vec4_fp64(vec4(offset, 0.0), offset64);\n\n float z = project_size(position.z);\n vec2 projectedPosition64xy[2];\n project_position_fp64(position.xy, position64xyLow, projectedPosition64xy);\n\n vec2 commonPosition64[4];\n commonPosition64[0] = sum_fp64(offset64[0], projectedPosition64xy[0]);\n commonPosition64[1] = sum_fp64(offset64[1], projectedPosition64xy[1]);\n commonPosition64[2] = sum_fp64(offset64[2], vec2(z, 0.0));\n commonPosition64[3] = vec2(1.0, 0.0);\n\n commonPosition = vec4(projectedPosition64xy[0].x, projectedPosition64xy[1].x, z, 1.0);\n\n return project_common_position_to_clipspace_fp64(commonPosition64);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(\n position, position64xyLow, offset, commonPosition\n );\n}\nvec4 project_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n return project_common_position_to_clipspace_fp64(vertex_pos_modelspace);\n}\n",getUniforms:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return m({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},m=Object(d.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=g(t),r=v(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}});if(i.a.deck&&"7.1.10"!==i.a.deck.VERSION)throw new Error("deck.gl - multiple versions detected: ".concat(i.a.deck.VERSION," vs ").concat("7.1.10"));i.a.deck||(r.a.log(0,"deck.gl ".concat("7.1.10"," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),i.a.deck=i.a.deck||{VERSION:"7.1.10",version:"7.1.10",log:r.a},Object(a.registerShaderModules)([a.fp32,a.fp64,f,h,p,a.gouraudlighting,a.phonglighting,a.picking]),Object(a.setDefaultShaderModules)([f]));var y=n(26),b=n(92),_=n(2),x=n.n(_),w=n(3),P=n.n(w),O=n(7),k=n.n(O),S=n(5),j=n.n(S),C=n(8),E=n.n(C),A=n(95),T=function(e){function t(e){var n;return x()(this,t),(n=k()(this,j()(t).call(this,e))).projectedLight=new a.PointLight(e),n}return E()(t,e),P()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=Object(A.b)(this.position,{viewport:n,coordinateSystem:r,coordinateOrigin:a,fromCoordinateSystem:n.isGeospatial?y.a.LNGLAT:y.a.IDENTITY,fromCoordinateOrigin:[0,0,0]});return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=o,this.projectedLight}}]),t}(a.PointLight),M=n(93),L=function(e){function t(){return x()(this,t),k()(this,j()(t).apply(this,arguments))}return E()(t,e),P()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=i.modelMatrix,s=Object(c.b)({viewport:n,modelMatrix:o,coordinateSystem:r,coordinateOrigin:a}).project_uCameraPosition;return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=s,this.projectedLight}}]),t}(T),I=n(149),F=n.n(I),R=Math.PI/180,N=864e5,D=2440588,z=2451545,B=23.4397*R,U=357.5291,V=.98560028,G=280.147,W=360.9856235;function H(e,t,n){var i,r,a,o,s,u,c=R*-n,l=R*t,f=function(e){return function(e){return e/N-.5+D}(e)-z}(e),h=(i=R*(U+V*f),r=R*(1.9148*Math.sin(i)+.02*Math.sin(2*i)+3e-4*Math.sin(3*i)),a=i+r+102.9372*R+Math.PI,{declination:(o=a,s=0,u=o,Math.asin(Math.sin(s)*Math.cos(B)+Math.cos(s)*Math.sin(B)*Math.sin(u))),rightAscension:X(a,0)}),d=function(e,t){return R*(G+W*e)-t}(f,c)-h.rightAscension;return{azimuth:q(d,l,h.declination),altitude:Z(d,l,h.declination)}}function X(e,t){var n=e;return Math.atan2(Math.sin(n)*Math.cos(B)-Math.tan(t)*Math.sin(B),Math.cos(n))}function q(e,t,n){var i=e,r=t,a=n;return Math.atan2(Math.sin(i),Math.cos(i)*Math.sin(r)-Math.tan(a)*Math.cos(r))}function Z(e,t,n){var i=e,r=t,a=n;return Math.asin(Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos(i))}var Y=function(e){function t(e){var n,i=e.timestamp,r=F()(e,["timestamp"]);return x()(this,t),(n=k()(this,j()(t).call(this,r))).timestamp=i,n}return E()(t,e),P()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer.context.viewport,n=t.latitude,i=t.longitude;return this.direction=function(e,t,n){var i=H(e,t,n),r=i.azimuth,a=i.altitude,o=r+Math.PI;return[-Math.sin(o),-Math.cos(o),-Math.sin(a)]}(this.timestamp,n,i),this}}]),t}(a.DirectionalLight),Q=n(94),K=n(77),J=n(127),$=n(103),ee=n(106),te=n(79),ne=n(126),ie=n(111),re=n(33),ae=n(102),oe=n(37),se=n(101),ue=n(137),ce=n(132),le=n(47),fe=n(125);var he=function(e){function t(){return x()(this,t),k()(this,j()(t).apply(this,arguments))}return E()(t,e),P()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.bearing,i=t.pitch,r=t.position,a=t.up,o=50*t.zoom,s=function(e){var t=e.bearing,n=e.pitch;return new ce.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:n,pitch:i}).scale(-o).multiply(new le.a(1,1,-1)),u=(new fe.a).multiplyRight((new fe.a).lookAt({eye:s,center:r,up:a}));return new re.a(Object.assign({},e,{id:this.id,zoom:null,viewMatrix:u}))}}]),t}(oe.a);he.displayName="ThirdPersonView";var de=n(138),ve=n(18),ge=Math.PI/180,pe=function(e){function t(){return x()(this,t),k()(this,j()(t).apply(this,arguments))}return E()(t,e),P()(t,[{key:"_getViewport",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.viewState,o=a.eye,s=a.lookAt,u=void 0===s?[0,0,0]:s,c=a.up,l=void 0===c?[0,1,0]:c,f=e.fovy||a.fovy||75,h=e.near||a.near||1,d=e.far||a.far||100,v=Number.isFinite(a.aspect)?a.aspect:i/r,g=f*ge;return new re.a({id:this.id,x:t,y:n,width:i,height:r,viewMatrix:ve.f([],o,u,l),projectionMatrix:ve.i([],g,v,h,d)})}}]),t}(oe.a);pe.displayName="PerspectiveView";var me=n(139),ye=n(57),be=n(109),_e=n(104),xe=n(78),we=n(105),Pe=n(67),Oe=n(56),ke=n(55),Se=n(117),je=n(22),Ce=n(38),Ee=n(28),Ae=n(35),Te=.01,Me=["longitude","latitude","zoom"];var Le=["bearing","pitch"],Ie=function(e){function t(){return x()(this,t),k()(this,j()(t).call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]}))}return E()(t,e),P()(t,[{key:"interpolateProps",value:function(e,t,n){for(var i=function(e,t,n){var i={},r=e.zoom,a=[e.longitude,e.latitude],o=Object(Ee.l)(r),s=t.zoom,u=[t.longitude,t.latitude],c=Object(Ee.l)(s-r),l=Object(Ee.g)(a,o),f=Object(Ee.g)(u,o),h=Ae.g([],f,l),d=Math.max(e.width,e.height),v=d/c,g=Ae.c(h);if(Math.abs(g)0&&void 0!==arguments[0]?arguments[0]:{}).overAlloc,n=void 0===t?1:t;x()(this,e),this.overAlloc=n}return P()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=n.type,a=n.copy,o=void 0!==a&&a,s=t*i;if(e&&s<=e.length)return e;var u=Math.max(Math.ceil(s*this.overAlloc),1),c=this._allocate(r,u);return e&&o&&c.set(e),this._release(e),c}},{key:"_allocate",value:function(){return new(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Float32Array)(arguments.length>1?arguments[1]:void 0)}},{key:"_release",value:function(e){}}]),e}(),De=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};x()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=new Ne,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return P()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64;this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(Re.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null};function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var l="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",f="".concat(l,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),h={ONE:1};var d={name:"fp64",vs:f,fs:null,fp64ify:c,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var i=0;i<4;++i){var r=4*n+i;c(e[4*i+n],t,2*r)}return t},getUniforms:function(){return Object.assign({},h)}},v=("".concat(l),n(125)),g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p={modelMatrix:g,viewMatrix:g,projectionMatrix:g,cameraPositionWorld:[0,0,0]};var m="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",y={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new v.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(m,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(m)},b="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",_={name:"lights",vs:b,fs:b,getUniforms:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,r=n.pointLights,a=n.directionalLights,o=i||r&&r.length>0||a&&a.length>0;return o?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,a=void 0===r?[]:r,o={};o["lighting_uAmbientLight.color"]=t?w(t):[0,0,0];return i.forEach(function(e,t){o["lighting_uPointLight[".concat(t,"].color")]=w(e),o["lighting_uPointLight[".concat(t,"].position")]=e.position,o["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),o.lighting_uPointLightCount=i.length,a.forEach(function(e,t){o["lighting_uDirectionalLight[".concat(t,"].color")]=w(e),o["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),o.lighting_uDirectionalLightCount=a.length,o}({ambientLight:i,pointLights:r,directionalLights:a}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var s={pointLights:[],directionalLights:[]},u=!0,c=!1,l=void 0;try{for(var f,h=(t.lights||[])[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;switch(d.type){case"ambient":s.ambientLight=d;break;case"directional":s.directionalLights.push(d);break;case"point":s.pointLights.push(d)}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return e({lightSources:s})}return{}},defines:{MAX_LIGHTS:3}},x={};function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}var P={lightDirection:new Float32Array([1,1,2])};var O={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[y]},k={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};var S={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}},j={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var C={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},E="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",A={name:"gouraud-lighting",dependencies:[_],vs:E,defines:{LIGHTING_VERTEX:1},getUniforms:L},T={name:"phong-lighting",dependencies:[_],fs:E,defines:{LIGHTING_FRAGMENT:1},getUniforms:L},M={};function L(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor,t}(t):{lighting_uEnabled:!1}}var I="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",F={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[{name:"project2",vs:I,fs:I},_]},R=n(136);n.d(t,"a",function(){return N}),n.d(t,"u",function(){return i.b}),n.d(t,"v",function(){return i.d}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.a}),n.d(t,"p",function(){return o.a}),n.d(t,"m",function(){return s.c}),n.d(t,"l",function(){return s.b}),n.d(t,"x",function(){return s.e}),n.d(t,"w",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u}),n.d(t,"k",function(){return d}),n.d(t,"t",function(){return y}),n.d(t,"o",function(){return _}),n.d(t,"i",function(){return O}),n.d(t,"s",function(){return S}),n.d(t,"h",function(){return C}),n.d(t,"n",function(){return A}),n.d(t,"r",function(){return T}),n.d(t,"q",function(){return F}),n.d(t,"b",function(){return R.a});var N={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",defaultUniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r});var i={LNGLAT:1,LNGLAT_DEPRECATED:5,METER_OFFSETS:2,METERS:2,LNGLAT_OFFSETS:3,IDENTITY:0},r={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},function(e,t,n){"use strict";function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"l",function(){return p}),n.d(t,"i",function(){return m}),n.d(t,"g",function(){return y}),n.d(t,"j",function(){return b}),n.d(t,"c",function(){return _}),n.d(t,"b",function(){return x}),n.d(t,"a",function(){return w}),n.d(t,"f",function(){return P}),n.d(t,"e",function(){return O}),n.d(t,"d",function(){return k}),n.d(t,"k",function(){return S}),n.d(t,"h",function(){return j});var i=n(21),r=n(38),a=n(18),o=n(35),s=n(40),u=n(60),c=Math.PI,l=c/4,f=c/180,h=180/c,d=512,v=4003e4,g=1.5;function p(e){return Math.pow(2,e)}function m(e){return Math.log2(e)}function y(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1];Object(u.a)(Number.isFinite(r)&&Number.isFinite(t)),Object(u.a)(Number.isFinite(a)&&a>=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function P(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.d([],c)),d}function O(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function k(e){var t=e.width,n=e.height,i=e.pitch,r=O({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function S(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){e.exports=n(178)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";(function(e){n.d(t,"c",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},r=i.self||i.window||i.global,a=i.window||i.self||i.global,o=i.global||i.self||i.window,s=i.document||{}}).call(this,n(53))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=i=function(e){return n(e)}:e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},i(t)}e.exports=i},function(e,t,n){"use strict";var i=n(19),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(13),l=(n(39),n(14));var f=n(22),h=n(125),d=n(47),v=n(18),g=n(28);n.d(t,"a",function(){return b});var p=Math.PI/180,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=[0,0,0],b=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(86),v=n(14);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,P=t.modelMatrix,O=void 0===P?null:P,k=t.viewportInstance,S=void 0===k?null:k,j=t.type,C=void 0===j?c.a:j;Object(v.a)(!S||S instanceof c.a),this.viewportInstance=S,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:O}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(39);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.c([],t,e);return i.b(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return o});var i=n(16);function r(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}function a(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function o(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}var s,u;s=new i.a(4),i.a!=Float32Array&&(s[0]=0,s[1]=0,s[2]=0,s[3]=0),u=s},function(e,t,n){"use strict";n.d(t,"c",function(){return r}),n.d(t,"d",function(){return o}),n.d(t,"b",function(){return u}),n.d(t,"i",function(){return c}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"a",function(){return d}),n.d(t,"h",function(){return p});var i=n(16);function r(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function a(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function o(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function s(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function u(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function c(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function l(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function f(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t){var n=a(e[0],e[1],e[2]),i=a(t[0],t[1],t[2]);s(n,n),s(i,i);var r=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var v,g,p=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e};v=new i.a(3),i.a!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0),g=v},function(e,t,n){e.exports=n(164)},function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return v}),n.d(t,"c",function(){return p});var i,r,a,o=n(24),s=n(0),u=n(45),c=(i={},Object(s.a)(i,3042,!1),Object(s.a)(i,32773,new Float32Array([0,0,0,0])),Object(s.a)(i,32777,32774),Object(s.a)(i,34877,32774),Object(s.a)(i,32969,1),Object(s.a)(i,32968,0),Object(s.a)(i,32971,1),Object(s.a)(i,32970,0),Object(s.a)(i,3106,new Float32Array([0,0,0,0])),Object(s.a)(i,3107,[!0,!0,!0,!0]),Object(s.a)(i,2884,!1),Object(s.a)(i,2885,1029),Object(s.a)(i,2929,!1),Object(s.a)(i,2931,1),Object(s.a)(i,2932,513),Object(s.a)(i,2928,new Float32Array([0,1])),Object(s.a)(i,2930,!0),Object(s.a)(i,3024,!0),Object(s.a)(i,36006,null),Object(s.a)(i,2886,2305),Object(s.a)(i,33170,4352),Object(s.a)(i,2849,1),Object(s.a)(i,32823,!1),Object(s.a)(i,32824,0),Object(s.a)(i,10752,0),Object(s.a)(i,32938,1),Object(s.a)(i,32939,!1),Object(s.a)(i,3089,!1),Object(s.a)(i,3088,new Int32Array([0,0,1024,1024])),Object(s.a)(i,2960,!1),Object(s.a)(i,2961,0),Object(s.a)(i,2968,4294967295),Object(s.a)(i,36005,4294967295),Object(s.a)(i,2962,519),Object(s.a)(i,2967,0),Object(s.a)(i,2963,4294967295),Object(s.a)(i,34816,519),Object(s.a)(i,36003,0),Object(s.a)(i,36004,4294967295),Object(s.a)(i,2964,7680),Object(s.a)(i,2965,7680),Object(s.a)(i,2966,7680),Object(s.a)(i,34817,7680),Object(s.a)(i,34818,7680),Object(s.a)(i,34819,7680),Object(s.a)(i,2978,new Int32Array([0,0,1024,1024])),Object(s.a)(i,3333,4),Object(s.a)(i,3317,4),Object(s.a)(i,37440,!1),Object(s.a)(i,37441,!1),Object(s.a)(i,37443,37444),Object(s.a)(i,35723,4352),Object(s.a)(i,36010,null),Object(s.a)(i,35977,!1),Object(s.a)(i,3330,0),Object(s.a)(i,3332,0),Object(s.a)(i,3331,0),Object(s.a)(i,3314,0),Object(s.a)(i,32878,0),Object(s.a)(i,3316,0),Object(s.a)(i,3315,0),Object(s.a)(i,32877,0),i),l=function(e,t,n){return t?e.enable(n):e.disable(n)},f=function(e,t,n){return e.hint(n,t)},h=function(e,t,n){return e.pixelStorei(n,t)},d=(r={},Object(s.a)(r,3042,l),Object(s.a)(r,32773,function(e,t){return e.blendColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,32777,"blendEquation"),Object(s.a)(r,34877,"blendEquation"),Object(s.a)(r,32969,"blendFunc"),Object(s.a)(r,32968,"blendFunc"),Object(s.a)(r,32971,"blendFunc"),Object(s.a)(r,32970,"blendFunc"),Object(s.a)(r,3106,function(e,t){return e.clearColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,3107,function(e,t){return e.colorMask.apply(e,Object(o.a)(t))}),Object(s.a)(r,2884,l),Object(s.a)(r,2885,function(e,t){return e.cullFace(t)}),Object(s.a)(r,2929,l),Object(s.a)(r,2931,function(e,t){return e.clearDepth(t)}),Object(s.a)(r,2932,function(e,t){return e.depthFunc(t)}),Object(s.a)(r,2928,function(e,t){return e.depthRange.apply(e,Object(o.a)(t))}),Object(s.a)(r,2930,function(e,t){return e.depthMask(t)}),Object(s.a)(r,3024,l),Object(s.a)(r,35723,f),Object(s.a)(r,36006,function(e,t){var n=Object(u.c)(e)?36009:36160;return e.bindFramebuffer(n,t)}),Object(s.a)(r,2886,function(e,t){return e.frontFace(t)}),Object(s.a)(r,33170,f),Object(s.a)(r,2849,function(e,t){return e.lineWidth(t)}),Object(s.a)(r,32823,l),Object(s.a)(r,32824,"polygonOffset"),Object(s.a)(r,10752,"polygonOffset"),Object(s.a)(r,35977,l),Object(s.a)(r,32938,"sampleCoverage"),Object(s.a)(r,32939,"sampleCoverage"),Object(s.a)(r,3089,l),Object(s.a)(r,3088,function(e,t){return e.scissor.apply(e,Object(o.a)(t))}),Object(s.a)(r,2960,l),Object(s.a)(r,2961,function(e,t){return e.clearStencil(t)}),Object(s.a)(r,2968,function(e,t){return e.stencilMaskSeparate(1028,t)}),Object(s.a)(r,36005,function(e,t){return e.stencilMaskSeparate(1029,t)}),Object(s.a)(r,2962,"stencilFuncFront"),Object(s.a)(r,2967,"stencilFuncFront"),Object(s.a)(r,2963,"stencilFuncFront"),Object(s.a)(r,34816,"stencilFuncBack"),Object(s.a)(r,36003,"stencilFuncBack"),Object(s.a)(r,36004,"stencilFuncBack"),Object(s.a)(r,2964,"stencilOpFront"),Object(s.a)(r,2965,"stencilOpFront"),Object(s.a)(r,2966,"stencilOpFront"),Object(s.a)(r,34817,"stencilOpBack"),Object(s.a)(r,34818,"stencilOpBack"),Object(s.a)(r,34819,"stencilOpBack"),Object(s.a)(r,2978,function(e,t){return e.viewport.apply(e,Object(o.a)(t))}),Object(s.a)(r,3333,h),Object(s.a)(r,3317,h),Object(s.a)(r,37440,h),Object(s.a)(r,37441,h),Object(s.a)(r,37443,h),Object(s.a)(r,3330,h),Object(s.a)(r,3332,h),Object(s.a)(r,3331,h),Object(s.a)(r,36010,function(e,t){return e.bindFramebuffer(36008,t)}),Object(s.a)(r,3314,h),Object(s.a)(r,32878,h),Object(s.a)(r,3316,h),Object(s.a)(r,3315,h),Object(s.a)(r,32877,h),r),v={blendEquation:function(e,t){return e.blendEquationSeparate(t[32777],t[34877])},blendFunc:function(e,t){return e.blendFuncSeparate(t[32969],t[32968],t[32971],t[32970])},polygonOffset:function(e,t){return e.polygonOffset(t[32824],t[10752])},sampleCoverage:function(e,t){return e.sampleCoverage(t[32938],t[32939])},stencilFuncFront:function(e,t){return e.stencilFuncSeparate(1028,t[2962],t[2967],t[2963])},stencilFuncBack:function(e,t){return e.stencilFuncSeparate(1029,t[34816],t[36003],t[36004])},stencilOpFront:function(e,t){return e.stencilOpSeparate(1028,t[2964],t[2965],t[2966])},stencilOpBack:function(e,t){return e.stencilOpSeparate(1029,t[34817],t[34818],t[34819])}},g=function(e,t){return e.isEnabled(t)},p=(a={},Object(s.a)(a,3042,g),Object(s.a)(a,2884,g),Object(s.a)(a,2929,g),Object(s.a)(a,3024,g),Object(s.a)(a,32823,g),Object(s.a)(a,32926,g),Object(s.a)(a,32928,g),Object(s.a)(a,3089,g),Object(s.a)(a,2960,g),Object(s.a)(a,35977,g),a)},function(t,n){t.exports=e},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(23),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(53),n(49))},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n(100);function r(e){for(var t in e)return!1;return!0}function a(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"c",function(){return a}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(119),r=n.n(i),a=n(30),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(6),a=n(11),o=n(10),s=n(12),u=n(82),c=n(22),l=n(40),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.b(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.e(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.f(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.g(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&u0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&(M(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&M(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new _.Texture2D(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:A})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(_.readPixelsToBuffer)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:A}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(x.a)(e.url).then(function(r){var a=T(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},A,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),I=_.fp64.fp64LowPart,F=[0,0,0,255],R={iconAtlas:null,iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},fp64:!1,billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:F},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},N=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0)); \n gl_Position.xy += project_pixel_size_to_clipspace(pixelOffset);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common); \n }\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors / 255.;\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","picking"]}}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new L(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:4,type:5121,transition:!0,accessor:"getColor",defaultValue:F},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),i.fp64!==n.fp64){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new _.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new _.Geometry({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(S.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=I(p[0]),a[o++]=I(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(S.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(S.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(S.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(b.a);N.layerName="IconLayer",N.defaultProps=R;var D=n(143),z=_.fp64.fp64LowPart,B=[0,0,0,255],U=[0,0,1],V=new _.PhongMaterial,G={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},fp64:!1,getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:U},getColor:{type:"accessor",value:B},material:V,radiusPixels:{deprecatedFor:"pointSize"}},W=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n unitPosition = positions.xy;\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), position_commonspace);\n gl_Position.xy += project_pixel_size_to_clipspace(positions.xy * radiusPixels);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, position_commonspace.xyz, project_normal(instanceNormals));\n vColor = vec4(lightColor, instanceColors.a * opacity) / 255.0;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","gouraud-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:U},instanceColors:{size:4,type:5121,transition:!0,accessor:"getColor",defaultValue:B}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new _.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new _.Geometry({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(S.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var b=s(y,h);u[c++]=z(b[0]),u[c++]=z(b[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(b.a);W.layerName="PointCloudLayer",W.defaultProps=G;var H=n(108),X=n(107),q=n(140),Z=n(71),Y=n(141),Q=n(144),K=n(13),J=n(126),$=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0)); \n gl_Position.xy += project_pixel_size_to_clipspace(pixelOffset);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common); \n }\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getLengthOfQueue,f=r.getShiftInQueue,h=e.value,d=n*e.size,v=Object(S.a)(a,n,i).iterable,g=!0,p=!1,m=void 0;try{for(var y,b=v[Symbol.iterator]();!(g=(y=b.next()).done);g=!0){var _=y.value,x=o[s(_)]||{},w=l(_),P=f(_);h[d++]=(u(_)-1)*w/2+x.width/2+P||0,h[d++]=x.height/2*c(_)||0}}catch(e){p=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(p)throw m}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(S.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(N);$.layerName="MultiIconLayer",$.defaultProps={getShiftInQueue:{type:"accessor",value:function(e){return e.shift||0}},getLengthOfQueue:{type:"accessor",value:function(e){return e.len||1}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ee=n(155),te=n.n(ee);var ne=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ie=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),re="Monaco, monospace",ae="normal",oe=64,se=2,ue=.25,ce=3,le=new ne(3),fe=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function he(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};fe.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=le.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=le.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),le.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");de(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(de(h,r,o,a),u){var b=new te.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,P=void 0;try{for(var O,k=t[Symbol.iterator]();!(x=(O=k.next()).done);x=!0){var S=O.value;he(b.draw(S),_),h.putImageData(_,v[S].x-s,v[S].y-s)}}catch(e){w=!0,P=e}finally{try{x||null==k.return||k.return()}finally{if(w)throw P}}}else{var j=!0,C=!1,E=void 0;try{for(var A,T=t[Symbol.iterator]();!(j=(A=T.next()).done);j=!0){var M=A.value;h.fillText(M,v[M].x,v[M].y+.9*o)}}catch(e){C=!0,E=e}finally{try{j||null==T.return||T.return()}finally{if(C)throw E}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=le.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),ge={fontSize:oe,buffer:se,sdf:!1,radius:ce,cutoff:ue},pe={start:1,middle:0,end:-1},me={top:1,center:0,bottom:-1},ye=["fontSize","buffer","sdf","radius","cutoff"],be={fp64:!1,billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ie,fontFamily:re,fontWeight:ae,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},_e=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new ve(this.context.gl)}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps,i=e.changeFlags,r=this.fontChanged(n,t);r&&this.updateFontAtlas({oldProps:n,props:t}),(i.dataChanged||r||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getText))&&this.transformStringToLetters()}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},ge,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return ye.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this.props,t=e.data,n=e.getText,i=this.state.iconMapping,r=[],a=Object(S.a)(t),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=function(){var e=f.value;s.index++;var t=n(e,s);if(t){var a=Array.from(t),o=[0],u=0;a.forEach(function(n,a){var c={text:n,index:a,offsets:o,len:t.length,object:e,objectIndex:s.index},l=i[n];l?u+=l.width:(K.a.warn("Missing character: ".concat(n))(),u+=32),o.push(u),r.push(c)})}},d=o[Symbol.iterator]();!(u=(f=d.next()).done);u=!0)h()}catch(e){c=!0,l=e}finally{try{u||null==d.return||d.return()}finally{if(c)throw l}}this.setState({data:r})}},{key:"getLetterOffset",value:function(e){return e.offsets[e.index]}},{key:"getTextLength",value:function(e){return e.offsets[e.offsets.length-1]}},{key:"_getAccessor",value:function(e){return"function"==typeof e?function(t){return e(t.object)}:e}},{key:"getAnchorXFromTextAnchor",value:function(e){return function(t){var n="function"==typeof e?e(t.object):e;if(!pe.hasOwnProperty(n))throw new Error("Invalid text anchor parameter: ".concat(n));return pe[n]}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return function(t){var n="function"==typeof e?e(t.object):e;if(!me.hasOwnProperty(n))throw new Error("Invalid alignment baseline parameter: ".concat(n));return me[n]}}},{key:"renderLayers",value:function(){var e=this,t=this.state,n=t.data,i=t.scale,r=t.iconAtlas,a=t.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.fp64,g=o.billboard,p=o.sdf,m=o.sizeScale,y=o.sizeUnits,b=o.sizeMinPixels,_=o.sizeMaxPixels,x=o.transitions,w=o.updateTriggers;return new(this.getSubLayerClass("characters",$))({sdf:p,iconAtlas:r,iconMapping:a,getPosition:function(e){return s(e.object)},getColor:this._getAccessor(u),getSize:this._getAccessor(c),getAngle:this._getAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this._getAccessor(d),fp64:v,billboard:g,sizeScale:m*i,sizeUnits:y,sizeMinPixels:b*i,sizeMaxPixels:_*i,transitions:x&&{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:w.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:w.getPosition,getAngle:w.getAngle,getColor:w.getColor,getSize:w.getSize,getPixelOffset:w.getPixelOffset,getAnchorX:w.getTextAnchor,getAnchorY:w.getAlignmentBaseline}}),{data:n,getIcon:function(e){return e.text},getShiftInQueue:function(t){return e.getLetterOffset(t)},getLengthOfQueue:function(t){return e.getTextLength(t)}})}}]),t}(J.a);_e.layerName="TextLayer",_e.defaultProps=be;var xe=n(80);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return O}),n.d(t,"IconLayer",function(){return N}),n.d(t,"LineLayer",function(){return D.a}),n.d(t,"PointCloudLayer",function(){return W}),n.d(t,"ScatterplotLayer",function(){return H.a}),n.d(t,"ColumnLayer",function(){return X.a}),n.d(t,"GridCellLayer",function(){return q.a}),n.d(t,"PathLayer",function(){return Z.a}),n.d(t,"PolygonLayer",function(){return Y.a}),n.d(t,"GeoJsonLayer",function(){return Q.a}),n.d(t,"TextLayer",function(){return _e}),n.d(t,"SolidPolygonLayer",function(){return xe.a}),n.d(t,"_MultiIconLayer",function(){return $})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(117),v=n(22),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(55),u=n(118),c=n(14),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0}})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(56),u=n(13),c=n(14),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,Object.assign({},e.getInteractiveState(),n)),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0})}},{key:"_onPan",value:function(e){var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1})}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e);if(!this.isDragging())return!1;var n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0})}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0})}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l)}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0})}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0})}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1})}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps())}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState;switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut();break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn();break;case 37:t=n?i.rotateLeft():i.moveLeft();break;case 39:t=n?i.rotateRight():i.moveRight();break;case 38:t=n?i.rotateUp():i.moveUp();break;case 40:t=n?i.rotateDown():i.moveDown();break;default:return!1}return this.updateViewport(t,this._getTransitionProps())}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(63),r=n(51);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"b",function(){return g});var i=n(4),r=n(6),a=n(128),o=n(42),s=n(50),u=n(45),c=function(e,t){var n=Array.isArray(e)||ArrayBuffer.isView(e),i=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&i&&e.length===t.length){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),c(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(53))},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(147),r="7.1.10",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},function(e,t,n){"use strict";(function(e){var i=n(23),r=n(146),a=!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||r.a;t.a=a}).call(this,n(49))},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(79),p=n(1),m=n(20).experimental.Tesselator,y=p.fp64.fp64LowPart,b=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3},endPositions:{size:3},leftPositions:{size:3},rightPositions:{size:3},startEndPositions64XyLow:{size:4,fp64Only:!0},neighborPositions64XyLow:{size:4,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){return Math.max(0,this.getPathLength(e)-1)}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.leftPositions,o=n.rightPositions,s=n.startEndPositions64XyLow,u=n.neighborPositions64XyLow,c=this.fp64,l=t.geometrySize+1;if(!(l<2))for(var f,h=this.isClosed(e),d=this.getPointOnPath(e,0),v=this.getPointOnPath(e,1),g=h?this.getPointOnPath(e,l-2):d,p=t.vertexStart,m=1;m 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n";n.d(t,"a",function(){return O});var x=[0,0,0,255],w={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},fp64:!1,dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:x},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},P={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},O=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return this.use64bitProjection()?{vs:"\n#define SHADER_NAME path-layer-vertex-shader-64\n\nattribute vec3 positions;\n\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec4 instanceStartEndPositions64xyLow;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceNeighborPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\n\nvec3 lineJoin(vec2 prevPoint64[2], vec2 currPoint64[2], vec2 nextPoint64[2]) {\n\n float widthPixels = clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0;\n float width = project_pixel_size(widthPixels);\n\n vec2 deltaA64[2];\n vec2 deltaB64[2];\n\n vec2_sub_fp64(currPoint64, prevPoint64, deltaA64);\n vec2_sub_fp64(nextPoint64, currPoint64, deltaB64);\n\n vec2 lengthA64 = vec2_length_fp64(deltaA64);\n vec2 lengthB64 = vec2_length_fp64(deltaB64);\n\n vec2 deltaA = vec2(deltaA64[0].x, deltaA64[1].x);\n vec2 deltaB = vec2(deltaB64[0].x, deltaB64[1].x);\n\n float lenA = lengthA64.x;\n float lenB = lengthB64.x;\n\n vec2 offsetVec;\n float offsetScale;\n float offsetDirection;\n lenA = lenA / width > EPSILON ? lenA : 0.0;\n lenB = lenB / width > EPSILON ? lenB : 0.0;\n vec2 dirA = lenA > 0. ? deltaA / lenA : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? deltaB / lenB : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = mix(perpB, perpA, positions.x);\n float L = mix(lenB, lenA, positions.x);\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n float cornerPosition = mix(\n flipIfTrue(turnsRight == (positions.y > 0.0)),\n 0.0,\n positions.z\n );\n\n offsetScale = 1.0 / max(sinHalfA, EPSILON);\n cornerPosition *= float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) / width * cosHalfA);\n offsetScale = mix(\n offsetScale,\n min(offsetScale, L / width / max(cosHalfA, EPSILON)),\n float(cornerPosition < 0.0)\n );\n\n vMiterLength = mix(\n offsetScale * cornerPosition,\n mix(offsetScale, 0.0, cornerPosition),\n step(0.0, cornerPosition)\n ) - sinHalfA * jointType;\n offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n float isStartCap = step(lenA, 1.0e-5);\n float isEndCap = step(lenB, 1.0e-5);\n float isCap = max(isStartCap, isEndCap);\n cornerPosition = isCap * (1.0 - positions.z);\n offsetVec = mix(offsetVec, mix(dirB, perpB, cornerPosition), isStartCap);\n offsetVec = mix(offsetVec, mix(dirA, perpA, cornerPosition), isEndCap);\n offsetScale = mix(\n offsetScale,\n mix(4.0 * jointType, 1.0, cornerPosition),\n isCap\n );\n vMiterLength = mix(vMiterLength, 1.0 - cornerPosition, isCap);\n\n offsetDirection = mix(\n offsetDirection,\n mix(flipIfTrue(isStartCap > 0.), positions.y, cornerPosition),\n isCap\n );\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L / width;\n float isEnd = positions.x;\n vec2 offsetFromStartOfPath = mix(vCornerOffset, vCornerOffset + deltaA / width, isEnd);\n vec2 dir = mix(dirB, dirA, isEnd);\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n\n return vec3(vCornerOffset * width, 0.0);\n}\n\nvoid main() {\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceStartEndPositions64xyLow.xy, instanceStartEndPositions64xyLow.zw, isEnd);\n vec2 projected_curr_position[2];\n project_position_fp64(currPosition.xy, currPosition64xyLow, projected_curr_position);\n float projected_curr_position_z = project_size(currPosition.z);\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceNeighborPositions64xyLow.xy, instanceStartEndPositions64xyLow.xy, isEnd);\n\n vec2 projected_prev_position[2];\n project_position_fp64(prevPosition.xy, prevPosition64xyLow, projected_prev_position);\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceStartEndPositions64xyLow.zw, instanceNeighborPositions64xyLow.zw, isEnd);\n\n vec2 projected_next_position[2];\n project_position_fp64(nextPosition.xy, nextPosition64xyLow, projected_next_position);\n\n vec3 pos = lineJoin(projected_prev_position, projected_curr_position, projected_next_position);\n vec2 vertex_pos_modelspace[4];\n\n vertex_pos_modelspace[0] = sum_fp64(vec2(pos.x, 0.0), projected_curr_position[0]);\n vertex_pos_modelspace[1] = sum_fp64(vec2(pos.y, 0.0), projected_curr_position[1]);\n vertex_pos_modelspace[2] = vec2(pos.z + projected_curr_position_z, 0.0);\n vertex_pos_modelspace[3] = vec2(1.0, 0.0);\n\n gl_Position = project_common_position_to_clipspace_fp64(vertex_pos_modelspace);\n}\n",fs:_,modules:["project64","picking"]}:{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec4 instanceStartEndPositions64xyLow;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceNeighborPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = step(0.0, -lenA) > 0.5;\n bool isEndCap = step(0.0, -lenB) > 0.5;\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n\n return currPoint + vec3(vCornerOffset * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels)\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceNeighborPositions64xyLow.xy, instanceStartEndPositions64xyLow.xy, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceStartEndPositions64xyLow.xy, instanceStartEndPositions64xyLow.zw, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceStartEndPositions64xyLow.zw, instanceNeighborPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec3 pos = lineJoin(prevPosition, currPosition, nextPosition);\n gl_Position = project_common_position_to_clipspace(vec4(pos, 1.0));\n }\n}\n",fs:_,modules:["project32","picking"]}}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({instanceStartPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0},instanceEndPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0},instanceStartEndPositions64xyLow:{size:4,update:this.calculateInstanceStartEndPositions64xyLow,noAlloc:!0},instanceLeftPositions:{size:3,accessor:"getPath",update:this.calculateLeftPositions,noAlloc:!0},instanceRightPositions:{size:3,accessor:"getPath",update:this.calculateRightPositions,noAlloc:!0},instanceNeighborPositions64xyLow:{size:4,update:this.calculateInstanceNeighborPositions64xyLow,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:P,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:4,type:5121,accessor:"getColor",transition:P,defaultValue:x},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new b({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||i.fp64!==n.fp64||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions()}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),a.invalidateAll()}if(i.fp64!==n.fp64){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new p.Geometry({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateInstanceStartEndPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startEndPositions64XyLow"):new Float32Array(4)}},{key:"calculateLeftPositions",value:function(e){var t=this.state.pathTesselator;e.value=t.get("leftPositions")}},{key:"calculateRightPositions",value:function(e){var t=this.state.pathTesselator;e.value=t.get("rightPositions")}},{key:"calculateInstanceNeighborPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("neighborPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(116),v=n(1),g=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.withParameters)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.withParameters)(e,{scissorTest:!0,scissor:l},function(){return Object(v.clear)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(v.setParameters)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.withParameters)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return P});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(124),v=n(22),g=n(57),p=n(85),m=n(55),y=n(56),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,P=void 0===w?b.minZoom:w,O=e.maxZoom,k=void 0===O?b.maxZoom:O,S=e.startPanPosition,j=e.startTarget,C=e.startRotationX,E=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:P,maxZoom:k})))._interactiveState={startPanPosition:S,startTarget:j,startRotationX:C,startRotationOrbit:E,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c in n)if(!(c in r)){if(!(c in t))return"".concat(u,".").concat(c," dropped");var l=t[c],f=n[c],h=o[c],d=h&&h.equal;if(d&&!d(l,f,h))return"".concat(u,".").concat(c," changed deeply");if(!d&&(d=l&&f&&l.equals)&&!d.call(l,f))return"".concat(u,".").concat(c," changed deeply");if(!d&&f!==l)return"".concat(u,".").concat(c," changed shallowly")}for(var v in t)if(!(v in r||v in n))return"".concat(u,".").concat(v," added: undefined -> ").concat(t[v]);return null}function P(e,t,n){var i=e.updateTriggers[n];i=null==i?{}:i;var r=t.updateTriggers[n];return w({oldProps:r=null==r?{}:r,newProps:i,triggerName:n})}function O(e){var t=e._component,n=t&&t.constructor;return n?n._propTypes:{}}var k=n(120),S=n(13),j=n(1),C=n(95),E=n(65),A={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return I(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return T(e,t)}},accessor:{validate:function(e,t){var n=F(e);return"function"===n||n===F(t.value)},equal:function(e,t,n){return"function"==typeof t||T(e,t)}},array:{validate:function(e,t){return t.optional&&!e||I(e)},equal:function(e,t,n){return n.compare?T(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function T(e,t){if(e===t)return!0;if(!I(e)||!I(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=U,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps={},this.oldProps)this.oldAsyncProps[e]=this.oldProps[e]}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),t=this._postProcessValue(e,t),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){return n._setAsyncPropValue(e,t,r)}).catch(function(e){return S.a.error(e)()})}},{key:"_postProcessValue",value:function(e,t){var n=(this.component?this.component.props:{}).dataTransform;return"data"===e&&n&&(t=n(t)),t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),G=0,W=function(){function e(){o()(this,e),this.props=function(){for(var e=N(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(C.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(X.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(C.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){S.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){S.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitProjection",value:function(){if(this.props.fp64){if(this.props.coordinateSystem===g.a.LNGLAT_DEPRECATED)return!0;S.a.once(0,"Legacy 64-bit mode only works with coordinateSystem set to\n COORDINATE_SYSTEM.LNGLAT_DEPRECATED. Rendering in 32-bit mode instead")()}return!1}},{key:"use64bitPositions",value:function(){return this.props.fp64||this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return S.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();t.dataChanged&&n&&n.invalidateAll()}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(S.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(S.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=this.getModels();if(r.length>0)for(var a=t.getChangedAttributes({clearChangedFlags:!0}),o=0,s=r.length;o2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=b(v),o[2*l+1]=b(g)),s[l]=1,l++}if(h)for(var m=0;m0&&void 0!==arguments[0]?arguments[0]:[];return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}}]),e}(),u=function(){function e(){Object(i.a)(this,e),this.shaderModules={},this.defaultShaderModules=[]}return Object(r.a)(e,[{key:"setDefaultShaderModules",value:function(e){this.defaultShaderModules=this.resolveModules(e)}},{key:"registerShaderModules",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof s)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof s)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new s(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"c",function(){return h}),n.d(t,"a",function(){return d});var c=new u;function l(e){c.setDefaultShaderModules(e)}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;c.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(c.defaultShaderModules),v(e=c.resolveModules(e))}function d(e){return c.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]=0&&e=0&&e0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,t,n){"use strict";(function(e,i){n.d(t,"a",function(){return a});var r=n(123),a="object"!==(void 0===e?"undefined":Object(r.a)(e))||"[object process]"!==String(e)||e.browser;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document}).call(this,n(49),n(53))},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(64),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=n(93),g=n(67),p={color:[255,255,255],intensity:1},m=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],y=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n.applyDefaultLights(),n}return h()(t,e),o()(t,[{key:"getParameters",value:function(e){var t=this.ambientLight,n=this.getProjectedPointLights(e);return{lightSources:{ambientLight:t,directionalLights:this.getProjectedDirectionalLights(e),pointLights:n}}}},{key:"applyDefaultLights",value:function(){var e=this.ambientLight,t=this.pointLights,n=this.directionalLights;e||0!==t.length||0!==n.length||(this.ambientLight=new d.AmbientLight(p),this.directionalLights.push(new v.a(m[0])),this.directionalLights.push(new v.a(m[1])))}},{key:"getProjectedPointLights",value:function(e){for(var t=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.withParameters)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new v.ClipSpace(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(v.clear)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(116).a),p=n(145);n.d(t,"a",function(){return m});var m=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(p.a)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=_(t),a=new g(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=_(t,r),s="".concat(n,"-").concat(a);return new g(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return y(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return b(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(19),r=n.n(i),a=n(26),o=n(83),s=n(39),u=n(40),c=n(28);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.c([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.h(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(4),r=n(6),a=n(11),o=n(10),s=n(12),u=n(27),c=n(21),l=n(38),f=n(28),h=n(18),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(129),p=n(35);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,P=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var O=Object(f.l)(g);x=Math.max(.75,x);var k=Object(f.g)([d,l],O);k[2]=0;var S=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:P||1.01}),j=Object(f.f)({height:s,center:k,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:j,projectionMatrix:S}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=O,e.center=k,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,function(e,t,n){"use strict";(function(e){var t=n(64),i=n(91);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(110);n.d(t,"c",function(){return S}),n.d(t,"b",function(){return j}),n.d(t,"a",function(){return C});var w=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),O={},k="precision highp float;\n\n";function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function j(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);O[e]=O[e]||{},O[e][o]=O[e][o]||{},Object(s.a)(!O[e][o][n],"Module injection already created"),O[e][o][n]={injection:i,order:a}}function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.vs,i=t.fs,r=Object(o.c)(t.modules||[]);return{gl:e,vs:E(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:E(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:A(r),modules:T(r)}}function E(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=void 0===o?[]:o,c=t.defines,l=void 0===c?{}:c,f=t.inject,h=void 0===f?{}:f,v=t.prologue,p=void 0===v||v,b=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var _=r===a.b,S=i.split("\n"),j=100,C="",E=i;0===S[0].indexOf("#version ")&&(j=300,C=S[0],E=S.slice(1).join("\n"));var A={};u.forEach(function(e){Object.assign(A,e.getDefines())}),Object.assign(A,l);var T=p?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(w[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(w[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(A),"\n").concat(_?"":k,"\n"):"".concat(C,"\n"),M=!1,L={},I={};for(var F in h){var R="string"==typeof h[F]?{injection:h[F],order:0}:h[F];F.match(/^(v|f)s:/)?"#"===F[3]?I[F]=[R]:L[F]=[R]:I[F]=[R]}var N=!0,D=!1,z=void 0;try{for(var B,U=u[Symbol.iterator]();!(N=(B=U.next()).done);N=!0){var V=B.value;switch(V.name){case"inject":M=!0;break;default:if(V.checkDeprecations(E,b),T+=V.getModuleSource(r,j),O[V.name]){var G=O[V.name][r];for(var W in G)W.match(/^(v|f)s:#/)?(I[W]=I[W]||[],I[W].push(G[W])):(L[W]=L[W]||[],L[W].push(G[W]))}}}}catch(e){D=!0,z=e}finally{try{N||null==U.return||U.return()}finally{if(D)throw z}}return T+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,L),T+=E,T=Object(x.b)(T,r,I,M)}function A(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function T(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.a)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;var n=Array.isArray(e)||ArrayBuffer.isView(e),i=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&i&&e.length===t.length){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,P=void 0!==w&&w,O=n.width,k=n.height,S=n.altitude,j=void 0===S?1.5:S;O=O||1,k=k||1,j=Math.max(.75,j);var C=Object(y.e)({width:O,height:k,pitch:d,altitude:j,nearZMultiplier:b,farZMultiplier:x}),E=C.fov,A=C.aspect,T=C.focalDistance,M=C.near,L=C.far,I=Object(y.f)({height:k,pitch:d,bearing:g,altitude:j}),F=Object.assign({},n,{width:O,height:k,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:P,fovyRadians:E,aspect:A,orthographicFocalDistance:T,near:M,far:L});return(e=l()(this,h()(t).call(this,F))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=j,e.orthographic=P,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);P.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(119),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(14),l=n(1),f=n(30),h=n.n(f),d=n(79),v=n(65),g=n(13),p=n(52),m=n(187),y=n(33),b=n(46),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l._ShaderCache({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(19),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(7),l=n.n(c),f=n(5),h=n.n(f),d=n(8),v=n.n(d),g=n(57),p=n(85),m=n(22),y=n(47);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(57),v=n(78),g=n(55),p=n(56),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(19),u=n.n(s),c=n(7),l=n.n(c),f=n(5),h=n.n(f),d=n(17),v=n.n(d),g=n(8),p=n.n(g),m=n(1),y=n(14),b=n(70),_=n(52),x=[],w=[[0,1/0]];var P=n(13),O=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(m.uid)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(m.hasFeature)(t,m.FEATURES.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a);for(var o=this.offset/4,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,k,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getInstanceCount",value:function(){return null!==this.value?this.value.length/this.size:0}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;var n=this.getInstanceCount();if((0===n||n=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(O);function j(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}function C(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.Buffer){var c=new Float32Array(r),l=t.getData({}),f=n.size,h=n.constant,d=h?n.getValue():n.getBuffer().getData({}),v=h?function(e,t){return u(d,t)}:function(e,t){return u(d.subarray(e,e+f),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.getData,a=e.sourceLayout,o=e.targetLayout;if(!Array.isArray(o))return C({source:t,target:n,getData:r}),n;for(var s=0,u=0,c=r&&function(e,t){return r(e+u,t)},l=Math.min(a.length,o.length),f=0;f0),this.needsRedraw=!0;var n=Object.assign({},I,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return D});function R(){}var N={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;P.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;N.savedMessages=[],N.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;N.savedMessages&&N.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-N.timeStart),a="".concat(r,"ms");P.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=N.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;P.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}P.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),N.savedMessages=null}},D=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new F(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(N.onLog=t||R),void 0!==n&&(N.onUpdateStart=n||R),void 0!==i&&(N.onUpdate=i||R),void 0!==r&&(N.onUpdateEnd=r||R)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in N.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h],this.numInstances)||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&N.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&P.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new S(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),P.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&N.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);N.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(70),p=n(79),m=n(1),y=n(153),b=n.n(y),_=n(13),x=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(m.uid)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;_.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.0;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.0;\n }\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","gouraud-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:4,type:5121,transition:!0,accessor:"getFillColor",defaultValue:O},instanceLineColors:{size:4,type:5121,transition:!0,accessor:"getLineColor",defaultValue:O},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=n.fp64!==i.fp64;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new x({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:4,transition:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new m.Model(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new m.Geometry({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,b=f[Symbol.iterator]();!(d=(m=b.next()).done);d=!0){var _=m.value;h.index++;var x=s(_,h);u[c++]=y(x[0]),u[c++]=y(x[1])}}catch(e){v=!0,p=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw p}}}else e.value=new Float32Array(2)}}]),t}(p.a);x.layerName="ScatterplotLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(19),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(7),l=n.n(c),f=n(5),h=n.n(f),d=n(8),v=n.n(d),g=n(22),p=n(57),m=n(85),y=n(96),b=n(38),_=85.05113,x=-85.05113;var w=n(14),P=n(55),O=n(56);n.d(t,"a",function(){return A});var k={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new P.a,transitionInterruption:O.a.BREAK},S={transitionDuration:0},j={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},C={pitch:0,bearing:0,altitude:1.5},E=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?C.bearing:c,d=n.pitch,v=void 0===d?C.pitch:d,g=n.altitude,p=void 0===g?C.altitude:g,m=n.maxZoom,y=void 0===m?j.maxZoom:m,b=n.minZoom,_=void 0===b?j.minZoom:b,x=n.maxPitch,P=void 0===x?j.maxPitch:x,O=n.minPitch,k=void 0===O?j.minPitch:O,S=n.startPanLngLat,E=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,M=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:P,minPitch:k})))._interactiveState={startPanLngLat:S,startZoomLngLat:E,startBearing:A,startPitch:T,startZoom:M},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,E,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return k}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,S,{isDragging:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i,r=n(0),a=n(48),o=n(72);n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u=/void main\s*\([^)]*\)\s*\{\n?/,c=/}\n?[^{}]*$/,l=[];function f(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),l.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(13),u=n(7),c=n.n(u),l=n(5),f=n.n(l),h=n(17),d=n.n(h),v=n(8),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(77).a),m=n(121),y=n(122),b=n(94),_=n(1);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h}),m=this.lastPostProcessEffect?this.screenBuffer:_.Framebuffer.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.Framebuffer(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.Framebuffer(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.Framebuffer.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(23),r=n(113);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(49))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(23);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(49))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(6),a=n(11),o=n(10),s=n(12),u=n(22);var c=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"clone",value:function(){return(new this.constructor).copy(this).check()}},{key:"copy",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(22),u=n(14),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){var i=n(173),r=n(174),a=n(175);e.exports=function(e){return i(e)||r(e)||a()}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(32),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(77),p=n(1),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.withParameters)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(14);function r(e){return Object(i.a)("boolean"==typeof e,"Invalid useDevicePixels"),e&&"undefined"!=typeof window?window.devicePixelRatio:1}},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(6),a=n(11),o=n(10),s=n(12),u=n(82),c=n(35),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(82).a),p=n(18),m=n(35),y=n(40),b=n(39);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.i(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.c(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.c(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.c(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.c(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(79),p=n(13),m=n(52),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){h()(l()(t.prototype),"setState",this).call(this,e),this.setLayerNeedsUpdate()}},{key:"getPickingInfo",value:function(e){return e.info}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,f=t.coordinateOrigin,h=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,g=t._subLayerProps,p={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:v};if(e){var m=g&&g[e.id],y=m&&m.updateTriggers;Object.assign(p,e,m,{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers,y)})}return p}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?p.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,p.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(g.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(103),u=n(14),c=n(86),l=n(37),f=n(33),h=n(13),d=n(52),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return o()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"project",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{topLeft:!0},n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.contains(e,t))return r.project(e,t)}return null}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.containsPixel(e,t))return r.unproject(e)}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(u.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(d.b)(e,{filter:Boolean}).map(function(e){return e instanceof f.a?new l.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(c.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):h.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),g=n(101),p=n(92),m=function(){function e(){r()(this,e),this.effects=[],this._needsRedraw="Initial render",this.defaultLightingEffect=new p.a,this.needApplyDefaultLighting=!1}return o()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(c.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed")),this.checkLightingEffect()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){var e=this.effects;return this.needApplyDefaultLighting&&(e=this.effects.slice()).push(this.defaultLightingEffect),e}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}this.effects.length=0}},{key:"checkLightingEffect",value:function(){var e=!1,t=!0,n=!1,i=void 0;try{for(var r,a=this.effects[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){if(r.value instanceof p.a){e=!0;break}}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}this.needApplyDefaultLighting=!e}}]),e}(),y=n(67),b=n(111),_=n(1),x=n(122),w=n(121),P={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function O(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,d=-1,v=0,g=0;gf)v+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,d=v)}v+=4}}if(d>=0){var x=t[d+3]-1,w=t.slice(d,d+4),O=n[x];if(O){var k=O.decodePickingColor(w);return{pickedColor:w,pickedLayer:O,pickedObjectIndex:k}}h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return P}function k(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=S({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function S(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var j=function(){function e(t){r()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new w.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(x.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new _.Framebuffer(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-r*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=S({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(u.a)(r),Object(u.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(u.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,c=r.y,l=r.width,f=r.height,h=new Uint8Array(l*f*4);return Object(_.readPixelsToArray)(o,{sourceX:s,sourceY:c,sourceWidth:l,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight;if(!(t>=0&&n>=0&&t0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&L&&0===e.which&&(t=I),this.pressed&&(t&I&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var z=D;var B=z?[[z.Rotate,{enable:!1}],[z.Pinch,{enable:!1}],[z.Swipe,{enable:!1}],[z.Pan,{threshold:0,enable:!1}],[z.Press,{enable:!1}],[z.Tap,{event:"doubletap",taps:2,enable:!1}],[z.Tap,{event:"anytap",enable:!1}],[z.Tap,{enable:!1}]]:null,U={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},V={doubletap:["tap"]},G={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},W=["keydown","keyup"],H=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],X=["wheel","mousewheel","DOMMouseScroll"],q={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",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"},Z={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Y=n(74),Q=-1!==Y.b.indexOf("firefox"),K=X,J=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=K.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!Y.a&&{passive:!1})})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;Y.c.WheelEvent&&(Q&&e.deltaMode===Y.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=Y.c.devicePixelRatio),e.deltaMode===Y.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),$=H,ee=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=$.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),te=W,ne=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=te.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),ie=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(T.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),re=1,ae=2,oe=4,se={pointerdown:re,pointermove:ae,pointerup:oe,mousedown:re,mousemove:ae,mouseup:oe},ue=1,ce=2,le=3,fe=0,he=1,de=2,ve=1,ge=2,pe=4;var me=function(){function e(t){Object(A.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(T.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(A.a)(this,e),this.options=Object.assign({},ye,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(T.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||B}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(U).forEach(function(e){var n=t.manager.get(e);n&&U[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new J(e,this._onOtherEvent,{enable:!1}),this.moveInput=new ee(e,this._onOtherEvent,{enable:!1}),this.keyInput=new ne(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new ie(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(E.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=V[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=Z[e]||e,o=r.get(a);o||(o=new me(this),r.set(a,o),o.recognizerName=q[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=Z[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=G[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),_e=n(26);function xe(){}n.d(t,"a",function(){return Pe});var we={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:xe,onResize:xe,onViewStateChange:xe,onBeforeRender:xe,onAfterRender:xe,onLoad:xe,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Pe=function(){function e(t){r()(this,e),t=Object.assign({},we,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerLeave=this._onPointerLeave.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new C.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return o()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&h.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&h.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(u.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new _.AnimationLoop({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(_.createGLContext)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new g.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_requestPick",value:function(e){var t=e.event,n=e.callback,i=e.mode,r=this._pickRequest;if("pointerleave"===t.type)r.x=-1,r.y=-1,r.radius=0;else{var a=t.offsetCenter;if(!a)return;r.x=a.x,r.y=a.y,r.radius=this.props.pickingRadius}r.callback=n,r.event=t,r.mode=i}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(_.trackContextState)(e,{enable:!0,copyState:!0})),Object(_.setParameters)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new be(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerLeave}}),_e.b)this.eventManager.on(t,this._onEvent);this.viewManager=new v({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(u.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new s.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new m,this.deckRenderer=new b.a(e),this.deckPicker=new j(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(_.setParameters)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),h.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=_e.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_onPointerMove",value:function(e){e.leftButton||e.rightButton||this._requestPick({callback:this.props.onHover,event:e,mode:"hover"})}},{key:"_onPointerLeave",value:function(e){this._requestPick({callback:this.props.onHover,event:e,mode:"hover"})}},{key:"_getFrameStats",value:function(){this.stats.get("frameRate").timeEnd(),this.stats.get("frameRate").timeStart();var e=this.animationLoop.stats;this.stats.get("GPU Time").addTime(e.get("GPU Time").lastTiming),this.stats.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){this.metrics.fps=this.stats.get("frameRate").getHz(),this.metrics.setPropsTime=this.stats.get("setProps Time").time,this.metrics.updateAttributesTime=this.stats.get("Update Attributes").time,this.metrics.framesRedrawn=this.stats.get("Redraw Count").count,this.metrics.pickTime=this.stats.get("pickObject Time").time+this.stats.get("pickMultipleObjects Time").time+this.stats.get("pickObjects Time").time,this.metrics.pickCount=this.stats.get("Pick Count").count,this.metrics.gpuTime=this.stats.get("GPU Time").time,this.metrics.cpuTime=this.stats.get("CPU Time").time,this.metrics.gpuTimePerFrame=this.stats.get("GPU Time").getAverageTime(),this.metrics.cpuTimePerFrame=this.stats.get("CPU Time").getAverageTime();var e=_.lumaStats.get("Memory Usage");this.metrics.bufferMemory=e.get("Buffer Memory").count,this.metrics.textureMemory=e.get("Texture Memory").count,this.metrics.renderbufferMemory=e.get("Renderbuffer Memory").count,this.metrics.gpuMemory=e.get("GPU Memory").count}}]),e}();Pe.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(y.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Pe.defaultProps=we},function(e,t,n){"use strict";var i=n(0);t.a={enable:function(e,t){return e(Object(i.a)({},t,!0))},disable:function(e,t){return e(Object(i.a)({},t,!1))},pixelStorei:function(e,t,n){return e(Object(i.a)({},t,n))},hint:function(e,t,n){return e(Object(i.a)({},t,n))},bindFramebuffer:function(e,t,n){var r;switch(t){case 36160:return e((r={},Object(i.a)(r,36006,n),Object(i.a)(r,36010,n),r));case 36009:return e(Object(i.a)({},36006,n));case 36008:return e(Object(i.a)({},36010,n));default:return null}},blendColor:function(e,t,n,r,a){return e(Object(i.a)({},32773,new Float32Array([t,n,r,a])))},blendEquation:function(e,t){var n;return e((n={},Object(i.a)(n,32777,t),Object(i.a)(n,34877,t),n))},blendEquationSeparate:function(e,t,n){var r;return e((r={},Object(i.a)(r,32777,t),Object(i.a)(r,34877,n),r))},blendFunc:function(e,t,n){var r;return e((r={},Object(i.a)(r,32969,t),Object(i.a)(r,32968,n),Object(i.a)(r,32971,t),Object(i.a)(r,32970,n),r))},blendFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,32969,t),Object(i.a)(o,32968,n),Object(i.a)(o,32971,r),Object(i.a)(o,32970,a),o))},clearColor:function(e,t,n,r,a){return e(Object(i.a)({},3106,new Float32Array([t,n,r,a])))},clearDepth:function(e,t){return e(Object(i.a)({},2931,t))},clearStencil:function(e,t){return e(Object(i.a)({},2961,t))},colorMask:function(e,t,n,r,a){return e(Object(i.a)({},3107,[t,n,r,a]))},cullFace:function(e,t){return e(Object(i.a)({},2885,t))},depthFunc:function(e,t){return e(Object(i.a)({},2932,t))},depthRange:function(e,t,n){return e(Object(i.a)({},2928,new Float32Array([t,n])))},depthMask:function(e,t){return e(Object(i.a)({},2930,t))},frontFace:function(e,t){return e(Object(i.a)({},2886,t))},lineWidth:function(e,t){return e(Object(i.a)({},2849,t))},polygonOffset:function(e,t,n){var r;return e((r={},Object(i.a)(r,32824,t),Object(i.a)(r,10752,n),r))},sampleCoverage:function(e,t,n){var r;return e((r={},Object(i.a)(r,32938,t),Object(i.a)(r,32939,n),r))},scissor:function(e,t,n,r,a){return e(Object(i.a)({},3088,new Int32Array([t,n,r,a])))},stencilMask:function(e,t){var n;return e((n={},Object(i.a)(n,2968,t),Object(i.a)(n,36005,t),n))},stencilMaskSeparate:function(e,t,n){return e(Object(i.a)({},1028===t?2968:36005,n))},stencilFunc:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2962,t),Object(i.a)(a,2967,n),Object(i.a)(a,2963,r),Object(i.a)(a,34816,t),Object(i.a)(a,36003,n),Object(i.a)(a,36004,r),a))},stencilFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2962:34816,n),Object(i.a)(o,1028===t?2967:36003,r),Object(i.a)(o,1028===t?2963:36004,a),o))},stencilOp:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2964,t),Object(i.a)(a,2965,n),Object(i.a)(a,2966,r),Object(i.a)(a,34817,t),Object(i.a)(a,34818,n),Object(i.a)(a,34819,r),a))},stencilOpSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2964:34817,n),Object(i.a)(o,1028===t?2965:34818,r),Object(i.a)(o,1028===t?2966:34819,a),o))},viewport:function(e,t,n,r,a){return e(Object(i.a)({},2978,new Int32Array([t,n,r,a])))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(21),r=n(96),a=n(60);function o(e){var t=e.width,n=e.height,o=e.bounds,s=e.padding,u=void 0===s?0:s,c=e.offset,l=void 0===c?[0,0]:c,f=Object(i.a)(o,2),h=Object(i.a)(f[0],2),d=h[0],v=h[1],g=Object(i.a)(f[1],2),p=g[0],m=g[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else Object(a.a)(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var y=new r.a({width:t,height:n,longitude:0,latitude:0,zoom:0}),b=y.project([d,m]),_=y.project([p,v]),x=[Math.abs(_[0]-b[0]),Math.abs(_[1]-b[1])],w=[t-u.left-u.right-2*Math.abs(l[0]),n-u.top-u.bottom-2*Math.abs(l[1])];Object(a.a)(w[0]>0&&w[1]>0);var P=w[0]/x[0],O=w[1]/x[1],k=(u.right-u.left)/2/P,S=(u.bottom-u.top)/2/O,j=[(_[0]+b[0])/2+k,(_[1]+b[1])/2+S],C=y.unproject(j),E=y.zoom+Math.log2(Math.abs(Math.min(P,O)));return{longitude:C[0],latitude:C[1],zoom:E}}},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(21),r=n(4),a=n(6),o=n(22),s=n(47),u=n(40),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.c(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},,,,function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(37),v=n(33),g=n(132),p=n(125),m=n(104);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(3),r=n.n(i),a=n(2),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(37),v=n(33),g=n(125),p=n(78),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,P=e.zoom,O=void 0===P?0:P;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:O}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:O}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(3),r=n.n(i),a=n(5),o=n.n(a),s=n(2),u=n.n(s),c=n(7),l=n.n(c),f=n(8),h=n.n(f),d=n(37),v=n(33),g=n(125),p=n(105),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.CubeGeometry}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(107).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=n(70),g=n(126),p=n(80),m=n(71),y=n(88),b=new d.PhongMaterial,_={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,fp64:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:b},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=e.changeFlags;(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon))&&(this.state.paths=this._getPaths(t))}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.object&&t.object.object||t.object})}},{key:"_getPaths",value:function(e){var t=e.data,n=e.getPolygon,i=[],r="XY"===e.positionFormat?2:3,a=Object(v.a)(t),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++;var g=y.c(n(d,s),r),p=g.positions,m=g.holeIndices;if(m)for(var b=0;b<=m.length;b++){var _=p.subarray(m[b-1]||0,m[b]||p.length);i.push({path:_,object:d})}else i.push({path:p,object:d})}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return i}},{key:"_getAccessor",value:function(e){return"function"==typeof e?function(t){return e(t.object)}:e}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.stroked,i=e.filled,r=e.extruded,a=e.wireframe,o=e.elevationScale,s=e.transitions,u=this.props,c=u.lineWidthUnits,l=u.lineWidthScale,f=u.lineWidthMinPixels,h=u.lineWidthMaxPixels,d=u.lineJointRounded,v=u.lineMiterLimit,g=u.lineDashJustified,y=u.fp64,b=this.props,_=b.getFillColor,x=b.getLineColor,w=b.getLineWidth,P=b.getLineDashArray,O=b.getElevation,k=b.getPolygon,S=b.updateTriggers,j=b.material,C=this.state.paths,E=this.getSubLayerClass("fill",p.a),A=this.getSubLayerClass("stroke",m.a),T=this.shouldRenderSubLayer("fill",C)&&new E({extruded:r,elevationScale:o,fp64:y,filled:i,wireframe:a,getElevation:O,getFillColor:_,getLineColor:x,material:j,transitions:s},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:S.getPolygon,getElevation:S.getElevation,getFillColor:S.getFillColor,getLineColor:S.getLineColor}}),{data:t,getPolygon:k});return[!r&&T,!r&&n&&this.shouldRenderSubLayer("stroke",C)&&new A({fp64:y,widthUnits:c,widthScale:l,widthMinPixels:f,widthMaxPixels:h,rounded:d,miterLimit:v,dashJustified:g,transitions:s&&{getWidth:s.getLineWidth,getColor:s.getLineColor,getPath:s.getPolygon},getColor:this._getAccessor(x),getWidth:this._getAccessor(w),getDashArray:this._getAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:S.getLineWidth,getColor:S.getLineColor,getDashArray:S.getLineDashArray}}),{data:C,getPath:function(e){return e.path}}),r&&T]}}]),t}(g.a);x.layerName="PolygonLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(70),p=n(79),m=n(1),y="#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n";n.d(t,"a",function(){return w});var b=m.fp64.fp64LowPart,_=[0,0,0,255],x={fp64:!1,getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:_},getTargetColor:{type:"accessor",value:_},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return this.use64bitProjection()?{vs:"#define SHADER_NAME arc-layer-vertex-shader-64\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\n\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\n\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\n\nvec2 paraboloid_fp64(vec2 source[2], vec2 target[2], float ratio) {\n\n vec2 x[2];\n vec2_mix_fp64(source, target, ratio, x);\n vec2 center[2];\n vec2_mix_fp64(source, target, 0.5, center);\n\n vec2 dSourceCenter = vec2_distance_fp64(source, center);\n vec2 dXCenter = vec2_distance_fp64(x, center);\n return mul_fp64(sum_fp64(dSourceCenter, dXCenter), sub_fp64(dSourceCenter, dXCenter));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvoid get_pos_fp64(vec2 source[2], vec2 target[2], float segmentRatio, out vec2 position[4]) {\n\n vec2 vertex_height = paraboloid_fp64(source, target, segmentRatio);\n\n vec2 position_temp[2];\n\n vec2_mix_fp64(source, target, segmentRatio, position_temp);\n\n position[0] = position_temp[0];\n position[1] = position_temp[1];\n\n if (vertex_height.x < 0.0 || (vertex_height.x == 0.0 && vertex_height.y <= 0.0)) {\n vertex_height = vec2(0.0, 0.0);\n }\n\n position[2] = sqrt_fp64(vertex_height);\n position[3] = vec2(1.0, 0.0);\n}\n\nvoid main(void) {\n vec2 projected_source_coord[2];\n vec2 projected_target_coord[2];\n\n project_position_fp64(instancePositions.xy, instancePositions64Low.xy, projected_source_coord);\n project_position_fp64(instancePositions.zw, instancePositions64Low.zw, projected_target_coord);\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec2 curr_pos_modelspace[4];\n\n get_pos_fp64(projected_source_coord, projected_target_coord, segmentRatio,\n curr_pos_modelspace);\n\n vec2 next_pos_modelspace[4];\n\n get_pos_fp64(projected_source_coord, projected_target_coord, nextSegmentRatio,\n next_pos_modelspace);\n\n vec4 curr_pos_clipspace = project_common_position_to_clipspace_fp64(curr_pos_modelspace);\n vec4 next_pos_clipspace = project_common_position_to_clipspace_fp64(next_pos_modelspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n\n vec2 offset = getExtrusionOffset(next_pos_clipspace.xy - curr_pos_clipspace.xy, positions.y, widthPixels);\n\n gl_Position = curr_pos_clipspace + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:y,modules:["project64","picking"]}:{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n vec2 source = project_position(vec3(instancePositions.xy, 0.0), instancePositions64Low.xy).xy;\n vec2 target = project_position(vec3(instancePositions.zw, 0.0), instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels);\n gl_Position = curr + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:y,modules:["picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:4,type:5121,transition:!0,accessor:"getSourceColor",defaultValue:_},instanceTargetColors:{size:4,type:5121,transition:!0,accessor:"getTargetColor",defaultValue:_},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new m.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.Geometry({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,p=!1,m=void 0;try{for(var y,_=h[Symbol.iterator]();!(v=(y=_.next()).done);v=!0){var x=y.value;d.index++;var w=s(x,d);c[l++]=b(w[0]),c[l++]=b(w[1]);var P=u(x,d);c[l++]=b(P[0]),c[l++]=b(P[1])}}catch(e){p=!0,m=e}finally{try{v||null==_.return||_.return()}finally{if(p)throw m}}}else e.value=new Float32Array(4)}}]),t}(p.a);w.layerName="ArcLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(70),p=n(79),m=n(1);n.d(t,"a",function(){return _});var y=m.fp64.fp64LowPart,b={fp64:!1,getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},_=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nvoid main(void) {\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.));\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.));\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n vec2 offset = getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels);\n gl_Position = p + vec4(offset, 0.0, 0.0);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[this.use64bitProjection()?"project64":"project32","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},instanceColors:{size:4,type:5121,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.fp64!==i.fp64){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new m.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.Geometry({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,p=!1,m=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),P=u(x,d);c[l++]=y(w[0]),c[l++]=y(w[1]),c[l++]=y(P[0]),c[l++]=y(P[1])}}catch(e){p=!0,m=e}finally{try{v||null==_.return||_.return()}finally{if(p)throw m}}}else e.value=new Float32Array(4)}}]),t}(p.a);_.layerName="LineLayer",_.defaultProps=b},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(8),h=n.n(f),d=n(126),v=n(108),g=n(71),p=n(1),m=n(80),y=n(13);function b(e,t,n){var i=e.type,r=e.coordinates,a=t.pointFeatures,o=t.lineFeatures,s=t.polygonFeatures,u=t.polygonOutlineFeatures;if(function(e,t){var n=x[e];y.a.assert(n,"Unknown GeoJSON type ".concat(e));for(;t&&--n>0;)t=t[0];return t&&Number.isFinite(t[0])}(i,r))switch(i){case"Point":a.push({geometry:e,sourceFeature:n});break;case"MultiPoint":r.forEach(function(e){a.push({geometry:{type:"Point",coordinates:e},sourceFeature:n})});break;case"LineString":o.push({geometry:e,sourceFeature:n});break;case"MultiLineString":r.forEach(function(e){o.push({geometry:{type:"LineString",coordinates:e},sourceFeature:n})});break;case"Polygon":s.push({geometry:e,sourceFeature:n}),r.forEach(function(e){u.push({geometry:{type:"LineString",coordinates:e},sourceFeature:n})});break;case"MultiPolygon":r.forEach(function(e){s.push({geometry:{type:"Polygon",coordinates:e},sourceFeature:n}),e.forEach(function(e){u.push({geometry:{type:"LineString",coordinates:e},sourceFeature:n})})})}else y.a.warn("".concat(i," coordinates are malformed"))()}function _(e){return e.sourceFeature.feature}var x={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return S});var w=new p.PhongMaterial,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,fp64:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:w};function O(e){return e.geometry.coordinates}function k(e){return"function"!=typeof e?e:function(t){return e(_(t))}}var S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props;if(e.changeFlags.dataChanged){var n=function(e){if(Array.isArray(e))return e;switch(y.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return y.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data);this.state.features=function(e){for(var t={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},n=0;n=t.min)}}};function o(e,t){switch(s(t)){case"object":return function(e){var t=e.type;(a[t]||{}).typeValidator;return e}(t=function(e,t){if(!("type"in t))return"value"in t?Object.assign({name:e,type:s(t.value)},t):{name:e,type:"object",value:t};return Object.assign({name:e},t)}(e,t));case"array":return function(e,t){if(/color/i.test(e)&&(3===t.length||4===t.length))return{name:e,type:"color",value:t};return{name:e,type:"array",value:t}}(e,t);case"boolean":return{name:e,type:"boolean",value:t};case"number":return function(e,t){var n=/radius|scale|width|height|pixel|size|miter/i.test(e)&&/^((?!scale).)*$/.test(e)?100:1;return{name:e,type:"number",max:Math.max(t,n),min:Math.min(t,0),value:t}}(e,t);case"function":return{name:e,type:"function",value:t};default:return{name:e,type:"unknown",value:t}}}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":null===e?"null":Object(i.a)(e)}function u(e){if(!e.normalized){if(e.normalized=!0,e.uniforms){var t=function(e){for(var t={},n={},i=0,a=Object.entries(e);i=0}).call(this,n(49))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(23),r=n(148);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(49))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(23);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(49))},function(e,t,n){var i=n(171);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(29),a=n.n(r),o=n(75);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(49))},function(e,t){},function(e,t){},function(e,t,n){var i=n(9);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===k(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(P(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(P(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),P(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),P(i),P(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new O(e.i,e.x,e.y),i=new O(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new O(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function P(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function O(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function k(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:"id";k[e]=k[e]||1;var t=k[e]++;return"".concat(e,"-").concat(t)}function E(e){return S("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function C(e){var t=!0;for(var n in e){t=!1;break}return t}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,i=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,i=void 0===n?16:n,r=t.size,a=void 0===r?1:r,o="[",s=0;s0&&(o+=",".concat(s%a==0?" ":"")),o+=A(e[s],t);var u=e.length>i?"...":"]";return"".concat(o).concat(u)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return i?"0":"0.";if(i)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var r=e.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function T(e,t,n,i){var r="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),a=Object.getPrototypeOf(e);i.forEach(function(e){a.methodName||(a[e]=function(){throw s.removed("Calling removed method ".concat(t,".").concat(e,": "),r)(),new Error(e)})})}function L(e,t,n){var i=n.removedProps,r=void 0===i?{}:i,a=n.deprecatedProps,o=void 0===a?{}:a,u=n.replacedProps,c=void 0===u?{}:u;for(var l in r)if(l in t){var f=r[l]?"".concat(e,".").concat(r[l]):"N/A";s.removed("".concat(e,".").concat(l),f)()}for(var h in o)if(h in t){var d=o[h];s.deprecated("".concat(e,".").concat(h),"".concat(e,".").concat(d))()}var v=null;for(var g in c)if(g in t){var p=c[g];s.deprecated("".concat(e,".").concat(g),"".concat(e,".").concat(p))(),(v=v||Object.assign({},t))[p]=t[g],delete v[g]}return v||t}var M,I=a.a&&"undefined"!=typeof document,F=I&&"complete"===document.readyState;function R(){return M||(M=I?new Promise(function(e,t){if(I&&"complete"===document.readyState)return F=!0,void e(document);window.onload=function(){F=!0,e(document)}}):Promise.resolve({})),M}function D(e){var t,n=e.canvas,i=e.width,r=e.height,a=e.onError,o=void 0===a?function(){}:a;return"string"==typeof n?(F||o("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:o}),t}function N(e){var t=e.getParameter(7936),n=e.getParameter(7937),i=e.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&e.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||t,renderer:i&&e.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}var z="Invalid WebGLRenderingContext",B="Requires WebGL2";function U(e){return Boolean(e&&Number.isFinite(e._version))}function V(e){return Boolean(e&&2===e._version)}function G(e){S(U(e),z)}function W(e){S(V(e),B)}function H(e){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function X(e){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var q="Failed to deduce GL constant from typed array";function Z(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(q)}}function Y(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function K(e){for(var t=e.data,n=e.width,i=e.height,r=Math.round(n/2),a=Math.round(i/2),o=new Uint8Array(r*a*4),s=0;s1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),G(t);var r=n.id,a=n.userData,o=void 0===a?{}:a;this.gl=t,this.id=r||j(this.constructor.name),this.userData=o,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S(e=Q(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=V(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=V(this.gl),o={},s=n||Object.keys(r),u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value,v=r[d];if(v&&(!("webgl2"in v)||a)&&(!("extension"in v)||this.gl.getExtension(v.extension))){var g=i?J(this.gl,d):d;o[g]=this.getParameter(d,e),i&&"GLenum"===v.type&&(o[g]=J(this.gl,o[g]))}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return o}},{key:"setParameter",value:function(e,t){S(e=Q(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=V(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Q(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return T(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(ie)}},{key:"_deleteHandle",value:function(){throw new Error(ie)}},{key:"_bindHandle",value:function(){throw new Error(ie)}},{key:"_getOptsFromHandle",value:function(){throw new Error(ie)}},{key:"_getParameter",value:function(e,t){throw new Error(ie)}},{key:"_setParameter",value:function(e,t){throw new Error(ie)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=l.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;l.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=l.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=l.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}(),ae=n(123);function oe(e,t,n){return(oe=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&Object(ae.a)(r,n.prototype),r}).apply(null,arguments)}var se,ue,ce,le={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},fe={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},he=function(){function e(){var t=this;Object(i.a)(this,e);for(var n=arguments.length,r=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=L("Accessor",e,fe)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}(),de={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"},ve={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:de},ge={removedProps:de},pe=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/he.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/he.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=L("Buffer",e,ve),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=L("Buffer",e,ge))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new he(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;S(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(W(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return W(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;W(this.gl);var c,l,f=Y(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(r),d=o;n?c=(l=n.length)-d:l=d+(c=Math.min(h,u||h));var v=Math.min(h,c);return S((u=u||v)<=v),n=n||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(S(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;S(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=Z(e);return S(i),this.setAccessor(new he(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;S(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/Y(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new he(this.accessor,{type:Z(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return s.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return s.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new he(this.accessor,e),this}},{key:"type",get:function(){return s.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return s.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(re),me=(se={},Object(x.a)(se,6407,{dataFormat:6407,types:[5121,33635]}),Object(x.a)(se,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(x.a)(se,6406,{dataFormat:6406,types:[5121]}),Object(x.a)(se,6409,{dataFormat:6409,types:[5121]}),Object(x.a)(se,6410,{dataFormat:6410,types:[5121]}),Object(x.a)(se,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(x.a)(se,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(x.a)(se,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(x.a)(se,34836,{dataFormat:6408,types:[5126],gl2:!0}),se),ye=(ue={},Object(x.a)(ue,6403,1),Object(x.a)(ue,36244,1),Object(x.a)(ue,33319,2),Object(x.a)(ue,33320,2),Object(x.a)(ue,6407,3),Object(x.a)(ue,36248,3),Object(x.a)(ue,6408,4),Object(x.a)(ue,36249,4),Object(x.a)(ue,6402,1),Object(x.a)(ue,34041,1),Object(x.a)(ue,6406,1),Object(x.a)(ue,6409,1),Object(x.a)(ue,6410,2),ue),be=(ce={},Object(x.a)(ce,5126,4),Object(x.a)(ce,5125,4),Object(x.a)(ce,5124,4),Object(x.a)(ce,5123,2),Object(x.a)(ce,5122,2),Object(x.a)(ce,5131,2),Object(x.a)(ce,5120,1),Object(x.a)(ce,5121,1),ce);var _e=[9729,9728],xe=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=n.id,o=void 0===a?j("texture"):a,s=n.handle,u=n.target;return(r=Object($.a)(this,Object(ee.a)(t).call(this,e,{id:o,handle:s}))).target=u,r.hasFloatTexture=e.getExtension("OES_texture_float"),r.textureUnit=void 0,r.loaded=!1,r.width=void 0,r.height=void 0,r.depth=void 0,r.format=void 0,r.type=void 0,r.dataFormat=void 0,r.border=void 0,r.textureUnit=void 0,r.mipmaps=void 0,r}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&function(e,t){var n=me[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=V(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}(e,n))&&(!i||function(e,t){var n=me[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}(e,n))),r}}]),Object(r.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var i=t.pixels,r=void 0===i?null:i,a=t.format,o=void 0===a?6408:a,u=t.type,c=void 0===u?5121:u,l=t.border,f=void 0===l?0:l,h=t.recreate,d=void 0!==h&&h,v=t.parameters,g=void 0===v?{}:v,p=t.pixelStore,m=void 0===p?{}:p,y=t.textureUnit,b=void 0===y?void 0:y,_=t.unpackFlipY,w=void 0===_||_,O=t.mipmaps,P=void 0===O||O;n||(n=r);var S=t.width,k=t.height,j=t.dataFormat,E=t.depth,C=void 0===E?0:E,A=this._deduceParameters({format:o,type:c,dataFormat:j,compressed:!1,data:n,width:S,height:k});S=A.width,k=A.height,j=A.dataFormat,this.width=S,this.height=k,this.depth=C,this.format=o,this.type=c,this.dataFormat=j,this.border=f,this.textureUnit=b,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var T=Object(x.a)({},37440,w),L=Object.assign({},T,m);return P&&this._isNPOT()&&(s.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),P=!1,this._updateForNPOT(g)),this.mipmaps=P,this.setImageData({data:n,width:S,height:k,depth:C,format:o,type:c,dataFormat:j,border:f,mipmaps:P,parameters:L}),P&&this.generateMipmap(),this.setParameters(g),d&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.height,n=e.width,i=e.mipmaps,r=void 0!==i&&i;return n!==this.width||t!==this.height?this.initialize({width:n,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(s.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),b(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,v=void 0===d?{}:d,g=e.data,p=void 0===g?null:g,m=e.type,y=void 0===m?this.type:m,_=e.width,x=void 0===_?this.width:_,w=e.height,O=void 0===w?this.height:w,P=e.dataFormat,k=void 0===P?this.dataFormat:P,j=e.compressed,E=void 0!==j&&j;p||(p=r);var C=this._deduceParameters({format:u,type:y,dataFormat:k,compressed:E,data:p,width:x,height:O});y=C.type,k=C.dataFormat,E=C.compressed,x=C.width,O=C.height;var A=this.gl;A.bindTexture(this.target,this.handle);var T,L=this._getDataType({data:p,compressed:E});if(p=L.data,T=L.dataType,b(this.gl,v,function(){switch(T){case"null":A.texImage2D(n,o,u,x,O,l,k,y,p);break;case"typed-array":A.texImage2D(n,o,u,x,O,l,k,y,p,h);break;case"buffer":W(A),A.bindBuffer(35052,p.handle||p),A.texImage2D(n,o,u,x,O,l,k,y,h),A.bindBuffer(35052,null);break;case"browser-object":V(A)?A.texImage2D(n,o,u,x,O,l,k,y,p):A.texImage2D(n,o,u,k,y,p);break;case"compressed":A.compressedTexImage2D(n,o,u,x,O,l,p);break;default:S(!1,"Unknown image data type")}}),p&&p.byteLength)this._trackAllocatedMemory(p.byteLength,"Texture");else{var M=ye[this.dataFormat]||4,I=be[this.type]||1;this._trackAllocatedMemory(this.width*this.height*M*I,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,v=e.height,g=void 0===v?this.height:v,p=e.level,m=void 0===p?0:p,y=e.format,x=void 0===y?this.format:y,w=e.type,O=void 0===w?this.type:w,P=e.dataFormat,k=void 0===P?this.dataFormat:P,j=e.compressed,E=void 0!==j&&j,C=e.offset,A=void 0===C?0:C,T=e.border,L=(void 0===T&&this.border,e.parameters),M=void 0===L?{}:L,I=this._deduceParameters({format:x,type:O,dataFormat:k,compressed:E,data:s,width:d,height:g});if(O=I.type,k=I.dataFormat,E=I.compressed,d=I.width,g=I.height,S(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var F=s;s=F.data,d=F.shape[0],g=F.shape[1]}s instanceof pe&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),b(this.gl,M,function(){E?t.gl.compressedTexSubImage2D(i,m,c,f,d,g,x,s):null===s?t.gl.texSubImage2D(i,m,c,f,d,g,k,O,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,m,c,f,d,g,k,O,s,A):s instanceof _.b?(W(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,m,c,f,d,g,k,O,A),t.gl.bindBuffer(35052,null)):V(t.gl)?t.gl.texSubImage2D(i,m,c,f,d,g,k,O,s):t.gl.texSubImage2D(i,m,c,f,k,O,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof pe?{data:t.handle,dataType:"buffer"}:t instanceof _.b?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=me[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return S(i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},"Could not deduced texture size"),S(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),S(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:S(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!V(this.gl)&&(!(!this.width||!this.height)&&(!E(this.width)||!E(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===_e.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(re),we="";function Oe(e){we=e}function Pe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S("string"==typeof e),e=we+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function Se(e,t){return S("string"==typeof e),e=we+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}var ke=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),G(e),(r instanceof Promise||"string"==typeof r)&&(r={data:r}),"string"==typeof r.data&&(r=Object.assign({},r,{data:Se(r.data)})),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},r,{target:3553})))).initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e,t){return xe.isSupported(e,t)}}]),t}(xe),je=n(31),Ee=n.n(je),Ce=n(48),Ae=[34069,34070,34071,34072,34073,34074],Te=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),G(e),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},r,{target:34067})))).initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(Ce.a)(Ee.a.mark(function e(t){var n,i,r,a,o,u,c,l,f,h,d,v,g,p=this;return Ee.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,r=t.pixels,a=t.data,o=t.border,u=void 0===o?0:o,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,v=r||a,e.next=5,Promise.all(Ae.map(function(e){var t=v[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:g=e.sent,this.bind(),Ae.forEach(function(e,t){g[t].length>1&&!1!==p.opts.mipmaps&&s.warn("".concat(p.id," has mipmap and multiple LODs."))(),g[t].forEach(function(t,r){n&&i?d.texImage2D(e,r,l,n,i,u,l,h,t):d.texImage2D(e,r,l,l,h,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(xe);Te.FACES=Ae;var Le,Me=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),W(e),r=Object.assign({depth:1},r,{target:32879,unpackFlipY:!1}),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return V(e)}}]),Object(r.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,c=void 0===u?1:u,l=e.border,f=void 0===l?0:l,h=e.format,d=e.type,v=void 0===d?5121:d,g=e.offset,p=void 0===g?0:g,m=e.data,y=e.parameters,_=void 0===y?{}:y;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),b(this.gl,_,function(){ArrayBuffer.isView(m)&&t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,m),m instanceof pe&&(t.gl.bindBuffer(35052,m.handle),t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,p))}),m&&m.byteLength)this._trackAllocatedMemory(m.byteLength,"Texture");else{var x=ye[this.dataFormat]||4,w=be[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*x*w,"Texture")}return this.loaded=!0,this}}]),t}(xe),Ie="EXT_color_buffer_float",Fe=(Le={},Object(x.a)(Le,33189,{bpp:2}),Object(x.a)(Le,33190,{gl2:!0,bpp:3}),Object(x.a)(Le,36012,{gl2:!0,bpp:4}),Object(x.a)(Le,36168,{bpp:1}),Object(x.a)(Le,34041,{bpp:4}),Object(x.a)(Le,35056,{gl2:!0,bpp:4}),Object(x.a)(Le,36013,{gl2:!0,bpp:5}),Object(x.a)(Le,32854,{bpp:2}),Object(x.a)(Le,36194,{bpp:2}),Object(x.a)(Le,32855,{bpp:2}),Object(x.a)(Le,33321,{gl2:!0,bpp:1}),Object(x.a)(Le,33330,{gl2:!0,bpp:1}),Object(x.a)(Le,33329,{gl2:!0,bpp:1}),Object(x.a)(Le,33332,{gl2:!0,bpp:2}),Object(x.a)(Le,33331,{gl2:!0,bpp:2}),Object(x.a)(Le,33334,{gl2:!0,bpp:4}),Object(x.a)(Le,33333,{gl2:!0,bpp:4}),Object(x.a)(Le,33323,{gl2:!0,bpp:2}),Object(x.a)(Le,33336,{gl2:!0,bpp:2}),Object(x.a)(Le,33335,{gl2:!0,bpp:2}),Object(x.a)(Le,33338,{gl2:!0,bpp:4}),Object(x.a)(Le,33337,{gl2:!0,bpp:4}),Object(x.a)(Le,33340,{gl2:!0,bpp:8}),Object(x.a)(Le,33339,{gl2:!0,bpp:8}),Object(x.a)(Le,32849,{gl2:!0,bpp:3}),Object(x.a)(Le,32856,{gl2:!0,bpp:4}),Object(x.a)(Le,32857,{gl2:!0,bpp:4}),Object(x.a)(Le,36220,{gl2:!0,bpp:4}),Object(x.a)(Le,36238,{gl2:!0,bpp:4}),Object(x.a)(Le,36975,{gl2:!0,bpp:4}),Object(x.a)(Le,36214,{gl2:!0,bpp:8}),Object(x.a)(Le,36232,{gl2:!0,bpp:8}),Object(x.a)(Le,36226,{gl2:!0,bpp:16}),Object(x.a)(Le,36208,{gl2:!0,bpp:16}),Object(x.a)(Le,33325,{gl2:Ie,bpp:2}),Object(x.a)(Le,33327,{gl2:Ie,bpp:4}),Object(x.a)(Le,34842,{gl2:Ie,bpp:8}),Object(x.a)(Le,33326,{gl2:Ie,bpp:4}),Object(x.a)(Le,33328,{gl2:Ie,bpp:8}),Object(x.a)(Le,34836,{gl2:Ie,bpp:16}),Object(x.a)(Le,35898,{gl2:Ie,bpp:4}),Le);var Re,De=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=V(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,Fe)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return S(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&V(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Fe[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(re),Ne=256,ze=1024,Be=16384,Ue=6144,Ve=6145,Ge=6146,We=34041,He="clear: bad arguments";function Xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.color,a=void 0===r?null:r,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};i&&(l.framebuffer=i);var f=0;a&&(f|=Be,!0!==a&&(l.clearColor=a)),s&&(f|=Ne,!0!==s&&(l.clearDepth=s)),c&&(f|=ze,!0!==s&&(l.clearStencil=s)),S(0!==f,He),b(e,l,function(){e.clear(f)})}function qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.buffer,a=void 0===r?Ue:r,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;W(e),b(e,{framebuffer:i},function(){switch(a){case Ue:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case Ve:e.clearBufferfv(Ve,0,[c]);break;case Ge:e.clearBufferiv(Ge,0,[c]);break;case We:var t=Object(h.a)(c,2),n=t[0],i=t[1];e.clearBufferfi(We,0,n,i);break;default:S(!1,He)}})}function Ze(e){switch(e){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 S(!1),0}}function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,g=tt(e),p=g.framebuffer,m=g.deleteFramebuffer;S(p);var y=p.gl,b=p.handle,_=p.attachments;h=h||p.width,d=d||p.height,36064===c&&null===b&&(c=1028),S(_[c]),f=function(e,t,n,i,r){if(e)return e;var a=Y(t=t||5121,{clamped:!1}),o=Ze(n);return new a(i*r*o)}(f,v=v||_[c].type,s,h,d),v=v||Z(f);var x=y.bindFramebuffer(36160,b);return y.readPixels(i,a,h,d,s,v,f),y.bindFramebuffer(36160,x||null),m&&p.delete(),f}function Ke(e,t){var n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.target,c=void 0===u?null:u,l=t.targetByteOffset,f=void 0===l?0:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,g=tt(e),p=g.framebuffer,m=g.deleteFramebuffer;S(p);var y=p.gl;if(h=h||p.width,d=d||p.height,W(y),v=v||(c?c.type:5121),!c){var _=Ze(s),x=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return S(!1),0}}(v);c=new pe(y,{byteLength:f+h*d*_*x,accessor:{type:v,size:_}})}return c.bind({target:35051}),b(y,{framebuffer:p},function(){y.readPixels(i,a,h,d,s,v,f)}),c.unbind({target:35051}),m&&p.delete(),c}function Qe(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=Ye(e,{sourceAttachment:i}),s=e.width,u=e.height;u>a;){var c=K({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}!function(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=Qe(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function $e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,a=n.sourceY,o=void 0===a?0:a,s=n.targetX,u=n.targetY,c=n.targetZ,l=n.targetMipmaplevel,f=void 0===l?0:l,h=n.targetInternalFormat,d=void 0===h?6408:h,v=n.width,g=n.height,p=tt(e),m=p.framebuffer,y=p.deleteFramebuffer;S(m);var b=m.gl,_=m.handle,x=void 0!==s||void 0!==u||void 0!==c;s=s||0,u=u||0,c=c||0;var w=b.bindFramebuffer(36160,_);S(t);var O=null;if(t instanceof xe&&(O=t,v=Number.isFinite(v)?v:O.width,g=Number.isFinite(g)?g:O.height,O.bind(0),t=O.target),x)switch(t){case 3553:case 34067:b.copyTexSubImage2D(t,f,s,u,r,o,v,g);break;case 35866:case 32879:b.copyTexSubImage3D(t,f,s,u,c,r,o,v,g)}else b.copyTexImage2D(t,f,d,r,o,v,g,0);return O&&O.unbind(),b.bindFramebuffer(36160,w||null),y&&m.delete(),O}function et(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,u=n.sourceY0,c=void 0===u?0:u,l=n.sourceX1,f=n.sourceY1,h=n.targetX0,d=void 0===h?0:h,v=n.targetY0,g=void 0===v?0:v,p=n.targetX1,m=n.targetY1,y=n.color,b=void 0===y||y,_=n.depth,x=void 0!==_&&_,w=n.stencil,O=void 0!==w&&w,P=n.mask,k=void 0===P?0:P,j=n.filter,E=void 0===j?9728:j,C=tt(e),A=C.framebuffer,T=C.deleteFramebuffer,L=tt(t),M=L.framebuffer,I=L.deleteFramebuffer;S(A),S(M);var F=M.gl,R=M.handle,D=M.width,N=M.height,z=M.readBuffer;W(F),A.handle||36064!==r||(r=1028),b&&(k|=16384),x&&(k|=256),O&&(k|=1024),(T||I)&&1280&k&&(k=16384,s.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),S(k),l=void 0===l?A.width:l,f=void 0===f?A.height:f,p=void 0===p?D:p,m=void 0===m?N:m;var B=F.bindFramebuffer(36009,R),U=F.bindFramebuffer(36008,A.handle);return F.readBuffer(r),F.blitFramebuffer(o,c,l,f,d,g,p,m,k,E),F.readBuffer(z),F.bindFramebuffer(36008,U||null),F.bindFramebuffer(36009,B||null),T&&A.delete(),I&&M.delete(),M}function tt(e){return e instanceof gt?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,i=t.gl,r=t.width,a=t.height,o=t.id,s=new gt(i,Object.assign({},n,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(x.a)({},36064,t)})),s),deleteFramebuffer:!0};var t,n,i,r,a,o,s}var nt,it=(Re={},Object(x.a)(Re,33902,{gl1:new Float32Array([1,1])}),Object(x.a)(Re,33901,{gl1:new Float32Array([1,1])}),Object(x.a)(Re,3379,{gl1:64,gl2:2048}),Object(x.a)(Re,34076,{gl1:16}),Object(x.a)(Re,34930,{gl1:8}),Object(x.a)(Re,35661,{gl1:8}),Object(x.a)(Re,35660,{gl1:0}),Object(x.a)(Re,34024,{gl1:1}),Object(x.a)(Re,36348,{gl1:8}),Object(x.a)(Re,34921,{gl1:8}),Object(x.a)(Re,36347,{gl1:128}),Object(x.a)(Re,36349,{gl1:16}),Object(x.a)(Re,3386,{gl1:new Int32Array([0,0])}),Object(x.a)(Re,32883,{gl1:0,gl2:256}),Object(x.a)(Re,35071,{gl1:0,gl2:256}),Object(x.a)(Re,37447,{gl1:0,gl2:0}),Object(x.a)(Re,36063,{gl1:0,gl2:4}),Object(x.a)(Re,35379,{gl1:0,gl2:0}),Object(x.a)(Re,35374,{gl1:0,gl2:0}),Object(x.a)(Re,35377,{gl1:0,gl2:0}),Object(x.a)(Re,34852,{gl1:0,gl2:4}),Object(x.a)(Re,36203,{gl1:0,gl2:0}),Object(x.a)(Re,33001,{gl1:0,gl2:0}),Object(x.a)(Re,33e3,{gl1:0,gl2:0}),Object(x.a)(Re,37157,{gl1:0,gl2:0}),Object(x.a)(Re,35373,{gl1:0,gl2:0}),Object(x.a)(Re,35657,{gl1:0,gl2:0}),Object(x.a)(Re,36183,{gl1:0,gl2:0}),Object(x.a)(Re,37137,{gl1:0,gl2:0}),Object(x.a)(Re,34045,{gl1:0,gl2:0}),Object(x.a)(Re,35978,{gl1:0,gl2:0}),Object(x.a)(Re,35979,{gl1:0,gl2:0}),Object(x.a)(Re,35968,{gl1:0,gl2:0}),Object(x.a)(Re,35376,{gl1:0,gl2:0}),Object(x.a)(Re,35375,{gl1:0,gl2:0}),Object(x.a)(Re,35659,{gl1:0,gl2:0}),Object(x.a)(Re,37154,{gl1:0,gl2:0}),Object(x.a)(Re,35371,{gl1:0,gl2:0}),Object(x.a)(Re,35658,{gl1:0,gl2:0}),Object(x.a)(Re,35076,{gl1:0,gl2:-8,negative:!0}),Object(x.a)(Re,35077,{gl1:0,gl2:7}),Object(x.a)(Re,35380,{gl1:0,gl2:0}),Re);function rt(e){if(e.luma=e.luma||{},!e.luma.limits){e.luma.limits={},e.luma.webgl1MinLimits={},e.luma.webgl2MinLimits={};var t=V(e);for(var n in it){var i=it[n],r=i.gl1,a="gl2"in i?i.gl2:i.gl1,o=t?a:r,s="gl2"in i&&!t||"extension"in i&&!e.getExtension(i.extension)?o:e.getParameter(n);e.luma.limits[n]=s,e.luma.webgl1MinLimits[n]=r,e.luma.webgl2MinLimits[n]=a}}return e.luma.limits}function at(e){e.luma=e.luma||{};var t,n=N(e);e.luma.info||(e.luma.info=(t={},Object(x.a)(t,37445,n.vendor),Object(x.a)(t,37446,n.renderer),Object(x.a)(t,7936,n.vendorMasked),Object(x.a)(t,7937,n.rendererMasked),Object(x.a)(t,7938,n.version),Object(x.a)(t,35724,n.shadingLanguageVersion),t));return e.luma.info}function ot(e){return Object.assign(N(e),{limits:rt(e),info:at(e),webgl1MinLimits:e.luma.webgl1MinLimits,webgl2MinLimits:e.luma.webgl2MinLimits})}var st={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",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"},ut=(nt={},Object(x.a)(nt,st.WEBGL2,[function(e){return V(e)}]),Object(x.a)(nt,st.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(x.a)(nt,st.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(x.a)(nt,st.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(x.a)(nt,st.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(x.a)(nt,st.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(x.a)(nt,st.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(x.a)(nt,st.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(x.a)(nt,st.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(x.a)(nt,st.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(x.a)(nt,st.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(x.a)(nt,st.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(x.a)(nt,st.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(x.a)(nt,st.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(x.a)(nt,st.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(x.a)(nt,st.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(x.a)(nt,st.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(x.a)(nt,st.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(x.a)(nt,st.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(x.a)(nt,st.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(x.a)(nt,st.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),nt);function ct(e,t){return lt(e,t)}function lt(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return ht(e,t)})}function ft(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=V(e),ut)e.luma.caps[t]=ht(e,t);return e.luma.caps}function ht(e,t){var n=ut[t];S(n,t);var i,r=V(e)&&n[1]||n[0];if("function"==typeof r)i=r(e);else if(Array.isArray(r)){i=!0;var a=!0,o=!1,s=void 0;try{for(var u,c=r[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i=i&&Boolean(e.getExtension(l))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}else"string"==typeof r?i=Boolean(e.getExtension(r)):"boolean"==typeof r?i=r:S(!1);return i}var dt={};function vt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=ut[t];if(S(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in dt)return dt[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),dt[t]=s,s}var gt=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(V(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(V(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(S(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return S(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&s.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,r=void 0!==i&&i,a=n.resizeAttachments,o=void 0===a||a,s={};r&&Object.keys(this.attachments).forEach(function(e){s[e]=null}),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){S(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],d=f;if(d)if(d instanceof De)this._attachRenderbuffer({attachment:l,renderbuffer:d});else if(Array.isArray(f)){var v=Object(h.a)(f,3),g=v[0],p=v[1],m=void 0===p?0:p,y=v[2],b=void 0===y?0:y;d=g,this._attachTexture({attachment:l,texture:g,layer:m,level:b})}else this._attachTexture({attachment:l,texture:d,layer:0,level:0});else this._unattach(l);o&&d&&d.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(function(e){return(gt.STATUS||{})[e]||"Framebuffer error ".concat(e)}(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&Xe(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){qe({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;W(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=J(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?J(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>s.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Qe(this,{maxHeight:100});return s.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,i,r){var a,o=null;e&&((o=o||{})[36064]=new ke(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:(a={},Object(x.a)(a,10241,9728),Object(x.a)(a,10240,9728),Object(x.a)(a,10242,33071),Object(x.a)(a,10243,33071),a)}));return t&&n?(o=o||{})[33306]=new De(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}):t?(o=o||{})[36096]=new De(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}):n&&S(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof De?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:S(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;V(t)?t.readBuffer(e):S(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(V(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):S(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=ft(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(re);function pt(e,t){S(e instanceof ke||e instanceof Te||e instanceof Me);var n=e.constructor,i=e.gl,r=e.width,a=e.height,o=e.format,s=e.type,u=e.dataFormat,c=e.border,l=e.mipmaps;return new n(i,Object.assign({width:r,height:a,format:o,type:s,dataFormat:u,border:c,mipmaps:l},t))}gt.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];function mt(e){return Boolean(e&&2===e._version)}var yt={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function bt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(yt,{width:1,height:1},e)}function _t(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},yt,t),i=n.width,r=n.height;function o(e){if(t.throwOnError)throw new Error(e);return null}a.a?e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(D({canvas:t.canvas,width:i,height:r,onError:o}),t):e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,a=e.onError;if(r&&!i)return a("headless-gl does not support WebGL2");if(!_.c)return a(O);var o=Object(_.c)(t,n,e);return o||a(P)}(w({},t,{width:i,height:r,onError:o}));return e?(function(e){var t=mt(e)?"WebGL2":"WebGL1",n=N(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";s.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=xt(e,t)),e):null}function xt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==_.a&&e instanceof _.a)return 2;return 1}(e);var n=t=Object.assign({},yt,t),i=n.manageState,r=n.debug;return i&&Object(m.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}function Pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}var St=35632,kt=35633;function jt(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Pt(t)||"(unnamed)",u="".concat(function(e){switch(e){case St:return"fragment";case kt:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=Ct(a,r-o);return s+n+e})}(t);return{shaderName:u,errors:Et(a,v),warnings:Et(o,v)}}function Et(e,t){for(var n="",i=0;i=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}var Tt,Lt="Shader: GLSL source code must be a JavaScript string",Mt=function(e){function t(e,n){var r;Object(i.a)(this,t),G(e),S("string"==typeof n.source,Lt);var a=Pt(n.source,null)||n.id||j("unnamed ".concat(t.getTypeName(n.shaderType)));return(r=Object($.a)(this,Object(ee.a)(t).call(this,e,{id:a}))).shaderType=n.shaderType,r.source=n.source,r.initialize(n),r}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"getTypeName",value:function(e){switch(e){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return S(!1),"unknown"}}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.source,n=Pt(t,null);n&&(this.id=j(n)),this._compile(t)}},{key:"getParameter",value:function(e){return this.gl.getShaderParameter(this.handle,e)}},{key:"toString",value:function(){return"".concat(t.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return Pt(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var e=this.gl.getExtension("WEBGL.debug_shaders");return e?e.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL.debug_shaders not implemented"}},{key:"_compile",value:function(){if(this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){var e=jt(this.gl.getShaderInfoLog(this.handle),this.source,this.shaderType,this.id),t=e.shaderName,n=e.errors,i=e.warnings;throw s.error("GLSL compilation errors in ".concat(t,"\n").concat(n))(),s.warn("GLSL compilation warnings in ".concat(t,"\n").concat(i))(),new Error("GLSL compilation errors in ".concat(t))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}]),t}(re),It=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},n,{shaderType:35633})))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),t}(Mt),Ft=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},n,{shaderType:35632})))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),t}(Mt);function Rt(e,t,n){return(Rt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(ee.a)(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}var Dt,Nt=(Tt={},Object(x.a)(Tt,5126,function(e,t,n){return e.uniform1fv(t,Wt(n,1))}),Object(x.a)(Tt,35664,function(e,t,n){return e.uniform2fv(t,Wt(n,2))}),Object(x.a)(Tt,35665,function(e,t,n){return e.uniform3fv(t,Wt(n,3))}),Object(x.a)(Tt,35666,function(e,t,n){return e.uniform4fv(t,Wt(n,4))}),Object(x.a)(Tt,5124,function(e,t,n){return e.uniform1iv(t,Ht(n,1))}),Object(x.a)(Tt,35667,function(e,t,n){return e.uniform2iv(t,Ht(n,2))}),Object(x.a)(Tt,35668,function(e,t,n){return e.uniform3iv(t,Ht(n,3))}),Object(x.a)(Tt,35669,function(e,t,n){return e.uniform4iv(t,Ht(n,4))}),Object(x.a)(Tt,35670,function(e,t,n){return e.uniform1iv(t,Ht(n,1))}),Object(x.a)(Tt,35671,function(e,t,n){return e.uniform2iv(t,Ht(n,2))}),Object(x.a)(Tt,35672,function(e,t,n){return e.uniform3iv(t,Ht(n,3))}),Object(x.a)(Tt,35673,function(e,t,n){return e.uniform4iv(t,Ht(n,4))}),Object(x.a)(Tt,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,Wt(n,4))}),Object(x.a)(Tt,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,Wt(n,9))}),Object(x.a)(Tt,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,Wt(n,16))}),Object(x.a)(Tt,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,5125,function(e,t,n){return e.uniform1uiv(t,Xt(n,1))}),Object(x.a)(Tt,36294,function(e,t,n){return e.uniform2uiv(t,Xt(n,2))}),Object(x.a)(Tt,36295,function(e,t,n){return e.uniform3uiv(t,Xt(n,3))}),Object(x.a)(Tt,36296,function(e,t,n){return e.uniform4uiv(t,Xt(n,4))}),Object(x.a)(Tt,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,Wt(n,6))}),Object(x.a)(Tt,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,Wt(n,8))}),Object(x.a)(Tt,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,Wt(n,6))}),Object(x.a)(Tt,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,Wt(n,12))}),Object(x.a)(Tt,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,Wt(n,8))}),Object(x.a)(Tt,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,Wt(n,12))}),Object(x.a)(Tt,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36311,function(e,t,n){return e.uniform1i(t,n)}),Tt),zt={},Bt={},Ut={},Vt=[0];function Gt(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(Vt[0]=e,e=Vt);var r=e.length;if(r%t&&s.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(V(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",gn),n._isCached=!1,n.initialize(r),Object.seal(Object(te.a)(n)),n._setId(r.id),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new It(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new Ft(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,S(this.vs instanceof It),S(this.fs instanceof Ft),this.uniforms={},i&&(W(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new vn(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Rt(Object(ee.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,u=void 0===o?0:o,c=e.start,l=e.end,f=e.isIndexed,h=void 0!==f&&f,d=e.indexType,v=void 0===d?5123:d,g=e.isInstanced,p=void 0!==g&&g,m=e.instanceCount,y=void 0===m?0:m,_=e.vertexArray,x=void 0===_?null:_,w=e.transformFeedback,O=e.framebuffer,P=e.parameters,k=void 0===P?{}:P,j=e.uniforms,E=e.samplers;if((j||E)&&(s.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(j||{})),void 0!==n){var C=O?O.id:"default",A="mode=".concat(J(this.gl,r)," verts=").concat(a," ")+"instances=".concat(y," indexType=").concat(J(this.gl,v)," ")+"isInstanced=".concat(p," isIndexed=").concat(h," ")+"Framebuffer=".concat(C);s.log(n,A)()}return S(x),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(x.bindForDraw(a,y,function(){if(void 0!==O&&(k=Object.assign({},k,{framebuffer:O})),w){var e=fn(r);w.begin(e)}t._bindTextures(),b(t.gl,k,function(){h&&p?t.gl.drawElementsInstanced(r,a,v,u,y):h&&V(t.gl)&&!isNaN(c)&&!isNaN(l)?t.gl.drawRangeElements(r,c,l,a,v,u):h?t.gl.drawElements(r,a,v,u):p?t.gl.drawArraysInstanced(r,u,a,y):t.gl.drawArrays(r,u,a)}),w&&w.end()}),!0)}},{key:"setUniforms",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=!1,r={};for(var a in t)Kt(this.uniforms[a],t[a])||(i=!0,r[a]=t[a],this.uniforms[a]=(e=t[a],Array.isArray(e)||ArrayBuffer.isView(e)?e.slice():e));return i&&(n(),function(e,t,n){for(var i in e){var r=e[i];if((!n||Boolean(n[i]))&&!Yt(r))throw t=t?"".concat(t," "):"",console.error("".concat(t," Bad uniform ").concat(i),r),new Error("".concat(t," Bad uniform ").concat(i))}}(r,this.id,this._uniformSetters),this._setUniforms(r)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof gt)i=i.texture;if(i instanceof xe)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof gt&&(n=n.texture),n instanceof xe)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof gt&&(n=n.texture),n instanceof xe){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new It({handle:u});break;case 35632:n.fs=new Ft({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=j(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),s.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),s.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||s.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=V(e),i=lt(e,st.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:S(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(r.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(re),yn=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),W(e),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).initialize(r),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return V(e)}}]),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,C(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,u=r.byteOffset;return i<0?(this.unused[e]=a,s.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,u,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof pe==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(re),bn=null;function _n(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!bn||bn.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var a=r.id||r.program&&r.program.id;return(n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},r,{id:a})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?V(e)||"Chrome"===function(e){if(!e&&!Object(wn.a)())return"Node";if(Object(On.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":xn.b.chrome?"Chrome":xn.b.safari?"Safari":xn.b.mozInnerScreenX?"Firefox":"Unknown"}():V(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:S(!1)}}}]),Object(r.a)(t,[{key:"delete",value:function(){Rt(Object(ee.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return S(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(S(V(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new pe(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=_n(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=Pn.isSupported(t)?new Pn(t):Pn.getDefaultArray(t),T(this,"VertexArray","v6.0",kn),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new pe(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof pe){var a=n;if(r){var o=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,o)}else{var s=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,s)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}(),En=5126,Cn=5124,An=5125,Tn=function(){function e(t){var n;for(var r in Object(i.a)(this,e),this.layout={},this.size=0,t)this._addUniform(r,t[r]);this.size+=(4-this.size%4)%4;var a=new Float32Array(this.size);this.typedArray=(n={},Object(x.a)(n,En,a),Object(x.a)(n,Cn,new Int32Array(a.buffer)),Object(x.a)(n,An,new Uint32Array(a.buffer)),n)}return Object(r.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[En]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];S(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=hn(t);S(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}();function Ln(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,i=e.program,r=e.uniforms,a=e.undefinedOnly,o=void 0!==a&&a;S(i);var s=i._uniformSetters,u={},c=Object.keys(s).sort(),l=0,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;p.match(".*_.*")||p.match(".*Matrix")||Mn({table:u,header:n,uniforms:r,uniformName:p,undefinedOnly:o})&&l++}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}var m=!0,y=!1,b=void 0;try{for(var _,w=c[Symbol.iterator]();!(m=(_=w.next()).done);m=!0){var O=_.value;O.match(".*Matrix")&&Mn({table:u,header:n,uniforms:r,uniformName:O,undefinedOnly:o})&&l++}}catch(e){y=!0,b=e}finally{try{m||null==w.return||w.return()}finally{if(y)throw b}}var P=!0,k=!1,j=void 0;try{for(var E,C=c[Symbol.iterator]();!(P=(E=C.next()).done);P=!0){var T=E.value;u[T]||Mn({table:u,header:n,uniforms:r,uniformName:T,undefinedOnly:o})&&l++}}catch(e){k=!0,j=e}finally{try{P||null==C.return||C.return()}finally{if(k)throw j}}var L=0,M={};if(!o)for(var I in r){var F=r[I];u[I]||(L++,M[I]=Object(x.a)({Type:"NOT USED: ".concat(F)},n,A(F)))}return{table:u,count:l,unusedTable:M,unusedCount:L}}function Mn(e){var t,n=e.table,i=e.header,r=e.uniforms,a=e.uniformName,o=e.undefinedOnly,s=r[a],u=function(e){return null!=e}(s);return(!o||!u)&&(n[a]=(t={},Object(x.a)(t,i,u?A(s):"N/A"),Object(x.a)(t,"Uniform Type",u?s:"NOT PROVIDED"),t),!0)}function In(e,t,n,i){var r,a,o,s,u=e.gl,c="NOT PROVIDED",l="N/A",f="N/A",h="N/A";if(n&&(c=n.type,l=n.size,a=-1!==(c=String(c).replace("Array","")).indexOf("nt")),t instanceof pe){var d,v,g=t,p=g.getDebugData(),m=p.data;if(o=p.modified?"*":"",s=m,f=(h=g.byteLength)/m.BYTES_PER_ELEMENT/l,n){var y=n.divisor>0;v="".concat(y?"I ":"P "," ").concat(f," (x").concat(l,"=").concat(h," bytes ").concat(J(u,c),")")}else a=!0,v="".concat(h," bytes");return d={},Object(x.a)(d,i,"".concat(o).concat(A(s,{size:l,isInteger:a}))),Object(x.a)(d,"Format ",v),d}return s=t,l=t.length,a=-1!==(c=String(t.constructor.name).replace("Array","")).indexOf("nt"),r={},Object(x.a)(r,i,"".concat(A(s,{size:l,isInteger:a})," (constant)")),Object(x.a)(r,"Format ","".concat(l,"x").concat(c," (constant)")),r}function Fn(e,t){var n=dn(t.type,t.size);return n?"".concat(e," (").concat(n.name,")"):e}function Rn(e){var t=e.accessor,n=dn(t.type,t.size);return n?"".concat(n.name," ").concat(e.name):e.name}var Dn={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Nn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id,r=void 0===n?j("geometry"):n,a=t.drawMode,o=void 0===a?Dn.TRIANGLES:a,s=t.mode,u=t.attributes,c=void 0===u?{}:u,l=t.indices,f=void 0===l?null:l,h=t.vertexCount,d=void 0===h?null:h;this.id=r,this.drawMode=0|o||0|s,this.attributes={},this.userData={},this._setAttributes(c,f),this.vertexCount=d||this._calculateVertexCount(this.attributes,this.indices)}return Object(r.a)(e,null,[{key:"DRAW_MODE",get:function(){return Dn}}]),Object(r.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?w({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,S(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"indices"===n?(S(!this.indices),this.indices=i,void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed)):this.attributes[n]=i}return this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}if(!Number.isFinite(n)){var s=e.POSITION||e.positions;s&&(n=s.value&&s.value.length/(s.size||3))}return S(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}(),zn=function e(){Object(i.a)(this,e)},Bn=n(30),Un=[255,255,255],Vn=[0,0,1],Gn=[0,0,-1],Wn=[0,0,1],Hn=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e),this.id=t.id||j("light");var n=t.color,r=void 0===n?Un:n;this.color=r;var a=t.intensity,o=void 0===a?1:a;this.intensity=o},Xn=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).type="ambient",e}return Object(ne.a)(t,e),t}(Hn),qn=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).type="directional";var r=n.direction,a=void 0===r?Gn:r;return e.direction=new Bn.a(a).normalize().toArray(),e}return Object(ne.a)(t,e),t}(Hn),Zn=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).type="point";var r=n.position,a=void 0===r?Wn:r;return e.position=a,e.attenuation=e._getAttenuation(n),e}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:Vn}}]),t}(Hn),Yn=n(29),Kn=0,Qn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.onCreateContext,r=void 0===n?function(e){return _t(e)}:n,a=t.onAddHTML,o=void 0===a?null:a,u=t.onInitialize,c=void 0===u?function(){}:u,f=t.onRender,h=void 0===f?function(){}:f,d=t.onFinalize,v=void 0===d?function(){}:d,g=t.gl,p=void 0===g?null:g,m=t.glOptions,y=void 0===m?{}:m,b=t.debug,_=void 0!==b&&b,x=t.createFramebuffer,w=void 0!==x&&x,O=t.autoResizeViewport,P=void 0===O||O,S=t.autoResizeDrawingBuffer,k=void 0===S||S,j=t.stats,E=void 0===j?l.get("animation-loop-".concat(Kn++)):j,C=t.useDevicePixels,A=void 0===C||C;"useDevicePixelRatio"in t&&(s.deprecated("useDevicePixelRatio","useDevicePixels")(),A=t.useDevicePixelRatio),this.props={onCreateContext:r,onAddHTML:o,onInitialize:c,onRender:h,onFinalize:v,gl:p,glOptions:y,debug:_,createFramebuffer:w},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=E,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:P,autoResizeDrawingBuffer:k,useDevicePixels:A}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return S("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,R().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=mn.isSupported(e.gl,["timers"])?new mn(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),X(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(Ce.a)(Ee.a.mark(function e(){return Ee.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return s.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;X(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||H(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(Yn.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?xt(this.props.gl,e):this.onCreateContext(e),!U(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(f.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas,r=i.clientWidth,a=i.clientHeight;return r>0&&a>0?n=r/a:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Ot(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new gt(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()&&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(){this.gl.canvas.addEventListener("mousemove",this._onMousemove),this.gl.canvas.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}}]),e}(),Jn=new Uint8Array([0,0,0]);function $n(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function ei(e){var t=Object(h.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function ti(){return Jn}var ni={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function ii(e,t){var n=(t||{}).attributeMap,i=void 0===n?ni:n;return i&&i[e]||e}function ri(e,t){var n;switch(e){case"indices":n=n||"indices";break;case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2;break;case"indices":t.size=t.size||1,t.isIndexed=void 0===t.isIndexed||t.isIndexed,S(t.value instanceof Uint16Array||t.value instanceof Uint32Array,'attribute array for "indices" must be of integer type')}S(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var ai=n(25),oi=n(108),si=n(36),ui=n.n(si),ci={},li=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},fi=new Map;ui.a.listenFor("luma.gl",function(e){var t=ci[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){o.d.__SEER_INITIALIZED__&&(fi.has(e)||fi.set(e,new Map),fi.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();li(i,n,e.value),t.setUniforms(i)}});var hi,di=["renderPickingBuffer","pickingEnabled"],vi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),S(U(t));var r=n.id,a=void 0===r?j("base-model"):r;this.id=a,this.gl=t,this.id=n.id||j("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(r.a)(e,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props={},this.program=this._createProgram(e),this.vertexArray=new jn(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete ci[t],ui.a.deleteItem("luma.gl",t)}},{key:"destroy",value:function(){this.delete()}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.getUniforms()}},{key:"setUniforms",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),function(e,t){if(o.d.__SEER_INITIALIZED__&&e){var n=fi.get(e);n&&n.forEach(function(e,n){li(t,n,e)})}}(this.id,t),t=this._extractAnimatedUniforms(t),this.program.setUniforms(t,function(){e._checkForDeprecatedUniforms(t)}),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return Xe(this.program.gl,e),this}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,u=t.attributes,c=void 0===u?{}:u,l=t.transformFeedback,f=void 0===l?this.transformFeedback:l,h=t.parameters,d=void 0===h?{}:h,v=t.vertexArray,g=void 0===v?this.vertexArray:v,p=t.animationProps;ci[(e=this).id]||(ci[e.id]=e,ui.a.listItem("luma.gl",e.id)),this.setAttributes(c),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(p);var m=this._logDrawCallStart(2),y=this.vertexArray.getDrawParams(this.props);y.isInstanced&&!this.isInstanced&&s.warn("Found instanced attributes on non-instanced model",this.id)();var b=y.isIndexed,_=y.indexType,x=y.indexOffset,w=this.isInstanced,O=this.instanceCount,P=function(){},S=this.props,k=S.onBeforeRender,j=void 0===k?P:k,E=S.onAfterRender,C=void 0===E?P:E;j(),this._timerQueryStart();var A=this.program.draw(Object.assign({},t,{logPriority:m,uniforms:null,framebuffer:r,parameters:d,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:g,transformFeedback:f,isIndexed:b,indexType:_,isInstanced:w,instanceCount:O,offset:b?x:0}));return this._timerQueryEnd(),C(),this._logDrawCallEnd(m,g,r),A}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(x.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&mn.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&s.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,u=e.defines,c=void 0===u?{}:u,l=e.inject,f=void 0===l?{}:l,h=e.shaderCache,d=void 0===h?null:h,v=e.varyings,g=void 0===v?null:v,p=e.bufferMode,m=void 0===p?35981:p,y=e.program,b=void 0===y?null:y;this.getModuleUniforms=function(e){};var _=this.id;if(!b){n=n||ai.a.vs,r=r||ai.a.fs;var x=Object(oi.a)(this.gl,{vs:n,fs:r,modules:o,inject:f,defines:c,log:s});n=x.vs,r=x.fs,b=d?d.getProgram(this.gl,{id:_,vs:n,fs:r}):new pn(this.gl,{id:_,vs:n,fs:r,varyings:g,bufferMode:m}),this.getModuleUniforms=x.getUniforms||function(e){}}return S(b instanceof pn,"Model needs a program"),b}},{key:"_checkForDeprecatedUniforms",value:function(e){di.forEach(function(t){t in e&&s.deprecated(t,"use picking shader module and Model class updateModuleSettings()")()})}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!C(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new mn(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,s.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(s.priority>> DRAWING MODEL ".concat(this.id),{collapsed:s.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=In(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),c=t.accessors[s.location];c&&(u="".concat(o,": ").concat(Fn(s.name,c))),r[u]=In(t,a[o],c,i)}}return r}({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=Ln({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,u=a.unusedTable,c=a.unusedCount,l=Ln({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),f=l.table;l.count>0&&s.log("MISSING UNIFORMS",Object.keys(f))(),c>0&&s.log("UNUSED UNIFORMS",Object.keys(u))();var h=function(e){var t={},n="Accessors for ".concat(e.id),i=!0,r=!1,a=void 0;try{for(var o,s=e.attributeInfos[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(u){var c=Rn(u);t["in ".concat(c)]=Object(x.a)({},n,JSON.stringify(u.accessor))}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}var l=!0,f=!1,h=void 0;try{for(var d,v=e.varyingInfos[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;if(g){var p=Rn(g);t["out ".concat(p)]=Object(x.a)({},n,JSON.stringify(g.accessor))}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return t}(this.vertexArray.configuration);s.table(e,r)(),s.table(e,o)(),s.table(e+1,h)(),function(e,t){if(ui.a.isReady()&&!ui.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);ui.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),s.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}(),gi=function(e){function t(e,n){Object(i.a)(this,t);var r=n.id,a=void 0===r?j("model"):r;return Object($.a)(this,Object(ee.a)(t).call(this,e,w({},n,{id:a})))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Rt(Object(ee.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},S(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){Rt(Object(ee.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){Rt(Object(ee.a)(t.prototype),"delete",this).call(this),this._deleteGeometryBuffers()}},{key:"destroy",value:function(){this.delete()}},{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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return S(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return S(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=function(e,t,n){var i={};for(var r in t.attributes){var a=t.attributes[r],o=ii(r,n);if(a.constant)i[o]=a.value;else{var s=a.value,u=w({},a);delete u.value,i[o]=[new pe(e,s),u],ri(r,u)}}return t.indices&&(i.indices=new pe(e,{data:t.indices.value||t.indices,target:34963})),i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(C(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(x.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof pe&&t.delete()}}},{key:"_setAnimationProps",value:function(e){var t=this;if(this.animated){S(e,"Model.draw(): animated uniforms but no animationProps");var n=this._evaluateAnimateUniforms(e);this.program.setUniforms(n,function(){t._checkForDeprecatedUniforms(n)})}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(C(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new yn(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new mn(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,s.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}}]),t}(vi),pi=n(100),mi=n(82),yi=n(139),bi="transform_uSampler_",_i="transform_uSize_",xi="transform_position";function wi(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,s={},u=t,c={};if(a>0||i){var l=u.split("\n"),f=l.slice();if(l.forEach(function(e,t,r){if(a>0){var u=function(e,t){var n={},i=function(e){return Object(mi.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(bi).concat(e),n="".concat(_i).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),u=s.samplerName,c=s.sizeName,l=s.uniformDeclerations,f=Object(mi.e)(r),h=" ".concat(r," ").concat(a," = transform_getInput(").concat(u,", ").concat(c,").").concat(f,";\n");n[u]=a;var d={"vs:#decl":l,"vs:#main-start":h};return{updatedLine:o,inject:d,samplerTextureMap:n}}return null}(e,n);if(u){var l=u.updatedLine,h=u.inject;f[t]=l,c=Object(pi.b)([c,h]),Object.assign(s,u.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(mi.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){S(r);var h="".concat(_i).concat(i),d={"vs:#decl":"uniform vec2 ".concat(h,";\n"),"vs:#main-start":" vec2 ".concat(xi," = transform_getPos(").concat(h,");\n gl_Position = vec4(").concat(xi,", 0, 1.);\n")};c=Object(pi.b)([c,d])}u=f.join("\n")}return{vs:u,targetTextureType:o,inject:c,samplerTextureMap:s}}var Oi=(hi={},Object(x.a)(hi,10241,9728),Object(x.a)(hi,10240,9728),Object(x.a)(hi,10242,33071),Object(x.a)(hi,10243,33071),hi),Pi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),S(V(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this._createdBuffers={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(r.a)(e,null,[{key:"isSupported",value:function(e){return V(e)}}]),Object(r.a)(e,[{key:"delete",value:function(){for(var e in this._createdBuffers)this._createdBuffers[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof pe?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();S(!n||n===this.targetTextureVarying);var o=Ye(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,u=Object(mi.d)(this.targetTextureType),c=new s(o.length*u/4),l=0,f=0;f0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,S(s=this.framebuffers[this.currentIndex]),r.viewport=[0,0,s.width,s.height],o&&this.gl.clear(this.gl.COLOR_BUFFER_BIT)),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){s.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){S(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)S(r[o]instanceof pe||r[o].buffer instanceof pe);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(Oi)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,S(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(s.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(s.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,u=e.varyings,c=e._sourceTextures,l=e._targetTexture,f=e._targetTextureVarying,h=e._swapTexture;for(var d in S(a&&(u||n||l)&&o),t||{})S(t[d]instanceof pe||t[d].buffer instanceof pe);for(var v in c||{})S(c[v]instanceof ke);return S(!l||f),S(!h||c[h]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n);S(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e){var t;if(e instanceof ke)return e;var n=this.sourceTextures[0][e];return n?(this._targetRefTexName=e,pt(n,{parameters:(t={},Object(x.a)(t,10241,9728),Object(x.a)(t,10240,9728),Object(x.a)(t,10242,33071),Object(x.a)(t,10243,33071),t),pixelStore:Object(x.a)({},37440,!1)})):null}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=new pe(this.gl,{byteLength:o,usage:s,accessor:u});this._createdBuffers[r]&&this._createdBuffers[r].delete(),this._createdBuffers[r]=c,this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new pe(this.gl,t);return this._createdBuffers[e]&&(this._createdBuffers[e].delete(),this._createdBuffers[e]=n),n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],S(this.feedbackBuffers[t][i]instanceof pe))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new gi(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){C(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new yn(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new yn(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new gt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(x.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new gt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(x.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new pe(this.gl,{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,s=Object(pi.b)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:Object(mi.b)({version:At(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[yi.a].concat(e.modules||[]):e.modules,uniforms:i,inject:s,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return wi({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}(),Si="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",ki=[-1,-1,1,-1,-1,1,1,1],ji=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=ki.map(function(e){return-1===e?0:e});return(r=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},n,{vs:Si,geometry:new Nn({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(ki)},aTexCoord:{size:2,value:new Float32Array(a)},aCoordinate:{size:2,value:new Float32Array(a)}}})})))).setVertexCount(4),r}return Object(ne.a)(t,e),t}(gi),Ei=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),S(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){S("string"==typeof t),S(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new It(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){S("string"==typeof t),S(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new Ft(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){S(this._compareContexts(e,this.gl)),S("string"==typeof t.vs),S("string"==typeof t.fs),S("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new pn(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}(),Ci=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.onInitialize,a=void 0===r?function(){}:r,o=n.onFinalize,s=void 0===o?function(){}:o,u=n.useDevicePixels,c=void 0===u||u,l=n.autoResizeDrawingBuffer,f=void 0===l||l;this.props={onInitialize:a,onFinalize:s},this.setProps({autoResizeDrawingBuffer:f,useDevicePixels:c}),S(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._resolveNextFrame=null,this._nextFramePromise=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(r.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.addEventListener("message",function(n){switch(n.data.command){case"start":i=n.data.opts.canvas,r=new Map,i.addEventListener=function(e,n){t.postMessage({command:"addEventListener",type:e}),r.has(e)||r.set(e,[]),r.get(e).push(n)},i.removeEventListener=function(e,n){t.postMessage({command:"removeEventListener",type:e});var i=r.get(e);i&&i.splice(i.indexOf(n),1)},i.dispatchEvent=function(e,t){var n=r.get(e);n&&n.forEach(function(e){return e(t)})},t.canvas=i,e.start(n.data.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=n.data.width,t.canvas.height=n.data.height;break;case"event":t.canvas.dispatchEvent(n.data.type,n.data.event)}var i,r})}}}]),Object(r.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,R().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=H(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(X(this._animationFrameId),this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"waitForRender",value:function(){var e=this;return this._nextFramePromise||(this._nextFramePromise=new Promise(function(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(Yn.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._animationFrameId=H(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=D(e);t.transferControlToOffscreen||s.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),Ai=function(){function e(t,n){Object(i.a)(this,e);var r=n.id,a=void 0===r?"pass":r;this.id=a,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(r.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=gt.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),b(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),Ti=function(e){function t(e,n){return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(Ai),Li=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(i.a)(this,e),this.gl=t,this.framebuffer1=new gt(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new gt(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(r.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),Mi=function(e){function t(e,n){var r;return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,(r=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"multi-pass"},n)))).renderState=new Li(e,n),r}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(Ti),Ii=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.gl,n=this.props.clearBits,i=void 0===n?16640:n;t.clear(i)}}]),t}(Ai),Fi=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(Ai),Ri="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",Di=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},r)))).clipspace=new ji(e,{id:"copy-pass",fs:Ri}),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Ai),Ni="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",zi=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t),n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"texture-pass"},r)));var a=r.texture,o=r.opacity,s=void 0===o?1:o;return n.clipspace=new ji(e,{id:"texture-pass",fs:Ni,uniforms:{uDiffuseSampler:a,uOpacity:s}}),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Ai),Bi=n(147),Ui=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Ai),Vi=function(e){function t(e,n){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t);var o="".concat(n.name,"-pass");Object(Bi.a)(n);var s=function(e,t,n,i){if(t.filter||t.sampler){var r=Xi(t),a=new Ui(e,{id:n,model:Gi(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=Xi(t,r),s="".concat(n,"-").concat(o.length+1);return new Ui(e,Object.assign({id:s,model:Gi(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,o,a);return(r=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:o,passes:s},a)))).module=n,r}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.module.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1,c.uniforms&&c.model.setUniforms(c.uniforms),c.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(Ti);function Gi(e,t,n,i,r){var a=new ji(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var Wi=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},Hi=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function Xi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return Wi(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return Hi(i)}return null}var qi={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Zi=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("truncated-code-geometry"):n,a=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,O=x(b),P=_(b),S=v?-2:0,k=l+(p?2:0),j=u+1,E=new Uint16Array(u*(l+m)*6),C=qi[h],A=new Float32Array(3*y),T=new Float32Array(3*y),L=new Float32Array(2*y),M=0,I=0,F=S;F<=k;F++){var R=F/l,D=o*R,N=void 0;F<0?(D=0,R=1,N=n):F>l?(D=o,R=1,N=r):N=n+F/l*(r-n),-2!==F&&F!==l+2||(N=0,R=0),D-=o/2;for(var z=0;zl?0:B*O,T[M+C[1]]=F<0?-1:F>l?1:P,T[M+C[2]]=F<0||F>l?0:U*O,L[I+0]=z/u,L[I+1]=R,I+=2,M+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("cone-geometry"):n,a=e.radius,o=void 0===a?1:a,s=e.cap,u=void 0===s||s;return Object($.a)(this,Object(ee.a)(t).call(this,w({},e,{id:r,topRadius:0,topCap:Boolean(u),bottomCap:Boolean(u),bottomRadius:o})))}return Object(ne.a)(t,e),t}(Zi),Ki=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]),Qi=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]),Ji=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]),$i=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]),er={POSITION:{size:3,value:new Float32Array(Qi)},NORMAL:{size:3,value:new Float32Array(Ji)},TEXCOORD_0:{size:2,value:new Float32Array($i)}},tr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("cube-geometry"):n;return Object($.a)(this,Object(ee.a)(t).call(this,w({},e,{id:r,indices:{size:1,value:new Uint16Array(Ki)},attributes:w({},er,e.attributes)})))}return Object(ne.a)(t,e),t}(Nn),nr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("cylinder-geometry"):n,a=e.radius,o=void 0===a?1:a;return Object($.a)(this,Object(ee.a)(t).call(this,w({},e,{id:r,bottomRadius:o,topRadius:o})))}return Object(ne.a)(t,e),t}(Zi),ir=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],rr=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],ar=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("ico-sphere-geometry"):n,a=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).iterations,t=void 0===e?0:e,n=Math.PI,i=2*n,r=[].concat(ir),a=[].concat(rr);r.push(),a.push();for(var o=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,a=t>n?t:n,o="".concat(i,"|").concat(a);if(o in e)return e[o];var s=r[t],u=r[t+1],c=r[t+2],l=r[n],f=r[n+1],h=r[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,r.push(d,v,g),e[o]=r.length/3-1}}(),s=0;s=0;g-=3){var p=a[g+0],m=a[g+1],y=a[g+2],b=3*p,_=3*m,x=3*y,w=2*p,O=2*m,P=2*y,S=r[b+0],k=r[b+1],j=r[b+2],E=Math.acos(j/Math.sqrt(S*S+k*k+j*j)),C=Math.atan2(k,S)+n,A=E/n,T=1-C/i,L=r[_+0],M=r[_+1],I=r[_+2],F=Math.acos(I/Math.sqrt(L*L+M*M+I*I)),R=Math.atan2(M,L)+n,D=F/n,N=1-R/i,z=r[x+0],B=r[x+1],U=r[x+2],V=Math.acos(U/Math.sqrt(z*z+B*B+U*U)),G=Math.atan2(B,z)+n,W=V/n,H=1-G/i,X=[z-L,B-M,U-I],q=[S-L,k-M,j-I],Z=new Bn.a(X).cross(q).normalize(),Y=void 0;(0===T||0===N||0===H)&&(0===T||T>.5)&&(0===N||N>.5)&&(0===H||H>.5)&&(r.push(r[b+0],r[b+1],r[b+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=A,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z,r.push(r[_+0],r[_+1],r[_+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=D,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z,r.push(r[x+0],r[x+1],r[x+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=W,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z),d[b+0]=d[_+0]=d[x+0]=Z.x,d[b+1]=d[_+1]=d[x+1]=Z.y,d[b+2]=d[_+2]=d[x+2]=Z.z,v[w+0]=T,v[w+1]=A,v[O+0]=N,v[O+1]=D,v[P+0]=H,v[P+1]=W}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(r)},NORMAL:{size:3,value:new Float32Array(d)},TEXCOORD_0:{size:2,value:new Float32Array(v)}}}}(e),o=a.indices,s=a.attributes;return Object($.a)(this,Object(ee.a)(t).call(this,w({},e,{id:r,indices:o,attributes:w({},s,e.attributes)})))}return Object(ne.a)(t,e),t}(Nn);var or=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("plane-geometry"):n,a=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")],f=e["".concat(c[1],"len")],h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,O=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=O,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*O-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*O-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*O-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0}y+=2,b+=3}for(var P=h+1,S=new Uint16Array(h*d*6),k=0;k0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("sphere-geometry"):n,a=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,O=s*y,P=Math.sin(w),S=Math.cos(w),k=Math.sin(O),j=Math.cos(O),E=S*k,C=j,A=P*k,T=o(E,C,A,m,y);f[x+0]=T*E,f[x+1]=T*C,f[x+2]=T*A,h[x+0]=E,h[x+1]=C,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var L=n+1,M=0;M1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){S(e),t=t||this.matrix;var n=new fr.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{key:"transform",value:function(){if(this.parent){var e=this.parent;this.endPosition.set(this.position.add(e.endPosition)),this.endRotation.set(this.rotation.add(e.endRotation)),this.endScale.set(this.scale.add(e.endScale))}else this.endPosition.set(this.position),this.endRotation.set(this.rotation),this.endScale.set(this.scale);for(var t=this.children,n=0;n0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var r=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===r?[]:r;return a.every(function(e){return S(e instanceof hr)}),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).children=a,e}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),Rt(Object(ee.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new fr.a:n,r=new fr.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l instanceof t?l.traverse(e,{worldMatrix:r}):e(l,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return s.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(hr),vr=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof gi?(n.model=e,n._setModelNodeProps(r)):n.model=new gi(e,r),n.managedResources=r.managedResources||[],n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return Rt(Object(ee.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(hr),gr=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(ne.a)(t,e),t}(hr);n.d(t,"isWebGL",function(){return U}),n.d(t,"isWebGL2",function(){return V}),n.d(t,"lumaStats",function(){return l}),n.d(t,"createGLContext",function(){return _t}),n.d(t,"destroyGLContext",function(){return wt}),n.d(t,"resizeGLContext",function(){return Ot}),n.d(t,"setGLContextDefaults",function(){return bt}),n.d(t,"getContextInfo",function(){return ot}),n.d(t,"getGLContextInfo",function(){return at}),n.d(t,"getContextLimits",function(){return rt}),n.d(t,"FEATURES",function(){return st}),n.d(t,"hasFeature",function(){return ct}),n.d(t,"hasFeatures",function(){return lt}),n.d(t,"getFeatures",function(){return ft}),n.d(t,"canCompileGLGSExtension",function(){return vt}),n.d(t,"cloneTextureFrom",function(){return pt}),n.d(t,"getKeyValue",function(){return Q}),n.d(t,"getKey",function(){return J}),n.d(t,"setContextDefaults",function(){return bt}),n.d(t,"glGetDebugInfo",function(){return N}),n.d(t,"trackContextState",function(){return m.a}),n.d(t,"resetParameters",function(){return f.d}),n.d(t,"getParameter",function(){return f.b}),n.d(t,"getParameters",function(){return f.c}),n.d(t,"setParameter",function(){return f.e}),n.d(t,"setParameters",function(){return p}),n.d(t,"withParameters",function(){return b}),n.d(t,"getModifiedParameters",function(){return f.a}),n.d(t,"Buffer",function(){return pe}),n.d(t,"Shader",function(){return Mt}),n.d(t,"VertexShader",function(){return It}),n.d(t,"FragmentShader",function(){return Ft}),n.d(t,"Program",function(){return pn}),n.d(t,"Framebuffer",function(){return gt}),n.d(t,"Renderbuffer",function(){return De}),n.d(t,"Texture2D",function(){return ke}),n.d(t,"TextureCube",function(){return Te}),n.d(t,"clear",function(){return Xe}),n.d(t,"clearBuffer",function(){return qe}),n.d(t,"readPixelsToArray",function(){return Ye}),n.d(t,"readPixelsToBuffer",function(){return Ke}),n.d(t,"copyToDataUrl",function(){return Qe}),n.d(t,"copyToImage",function(){return Je}),n.d(t,"copyToTexture",function(){return $e}),n.d(t,"blit",function(){return et}),n.d(t,"Query",function(){return mn}),n.d(t,"Texture3D",function(){return Me}),n.d(t,"TransformFeedback",function(){return yn}),n.d(t,"VertexArrayObject",function(){return Pn}),n.d(t,"VertexArray",function(){return jn}),n.d(t,"UniformBufferLayout",function(){return Tn}),n.d(t,"setPathPrefix",function(){return Oe}),n.d(t,"loadFile",function(){return Pe}),n.d(t,"loadImage",function(){return Se}),n.d(t,"_Accessor",function(){return he}),n.d(t,"_clearBuffer",function(){return qe}),n.d(t,"Geometry",function(){return Nn}),n.d(t,"Material",function(){return zn}),n.d(t,"AmbientLight",function(){return Xn}),n.d(t,"DirectionalLight",function(){return qn}),n.d(t,"PointLight",function(){return Zn}),n.d(t,"AnimationLoop",function(){return Qn}),n.d(t,"encodePickingColor",function(){return $n}),n.d(t,"decodePickingColor",function(){return ei}),n.d(t,"getNullPickingColor",function(){return ti}),n.d(t,"Model",function(){return gi}),n.d(t,"Transform",function(){return Pi}),n.d(t,"ClipSpace",function(){return ji}),n.d(t,"_ShaderCache",function(){return Ei}),n.d(t,"_AnimationLoopProxy",function(){return Ci}),n.d(t,"_MultiPassRenderer",function(){return Mi}),n.d(t,"_RenderState",function(){return Li}),n.d(t,"_Pass",function(){return Ai}),n.d(t,"_CompositePass",function(){return Ti}),n.d(t,"_ClearPass",function(){return Ii}),n.d(t,"_RenderPass",function(){return Fi}),n.d(t,"_CopyPass",function(){return Di}),n.d(t,"_TexturePass",function(){return zi}),n.d(t,"_ShaderModulePass",function(){return Vi}),n.d(t,"ConeGeometry",function(){return Yi}),n.d(t,"CubeGeometry",function(){return tr}),n.d(t,"CylinderGeometry",function(){return nr}),n.d(t,"IcoSphereGeometry",function(){return ar}),n.d(t,"PlaneGeometry",function(){return or}),n.d(t,"SphereGeometry",function(){return sr}),n.d(t,"TruncatedConeGeometry",function(){return Zi}),n.d(t,"PhongMaterial",function(){return cr}),n.d(t,"PBRMaterial",function(){return lr}),n.d(t,"ScenegraphNode",function(){return hr}),n.d(t,"GroupNode",function(){return dr}),n.d(t,"ModelNode",function(){return vr}),n.d(t,"CameraNode",function(){return gr}),n.d(t,"registerShaderModules",function(){return ai.u}),n.d(t,"setDefaultShaderModules",function(){return ai.v}),n.d(t,"assembleShaders",function(){return ai.c}),n.d(t,"createShaderHook",function(){return ai.g}),n.d(t,"createModuleInjection",function(){return ai.f}),n.d(t,"combineInjects",function(){return ai.d}),n.d(t,"normalizeShaderModule",function(){return ai.p}),n.d(t,"fp32",function(){return ai.j}),n.d(t,"fp64",function(){return ai.k}),n.d(t,"project",function(){return ai.t}),n.d(t,"lights",function(){return ai.o}),n.d(t,"dirlight",function(){return ai.i}),n.d(t,"picking",function(){return ai.s}),n.d(t,"diffuse",function(){return ai.h}),n.d(t,"gouraudlighting",function(){return ai.n}),n.d(t,"phonglighting",function(){return ai.r}),n.d(t,"pbr",function(){return ai.q}),n.d(t,"_transform",function(){return ai.b}),n.d(t,"MODULAR_SHADERS",function(){return ai.a}),n.d(t,"getQualifierDetails",function(){return ai.m}),n.d(t,"getPassthroughFS",function(){return ai.l}),n.d(t,"typeToChannelSuffix",function(){return ai.x}),n.d(t,"typeToChannelCount",function(){return ai.w}),n.d(t,"convertToVec4",function(){return ai.e}),n.d(t,"log",function(){return s}),n.d(t,"assert",function(){return S}),n.d(t,"uid",function(){return j}),n.d(t,"self",function(){return o.c}),n.d(t,"window",function(){return o.d}),n.d(t,"global",function(){return o.b}),n.d(t,"document",function(){return o.a})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n=24&&2303741511===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint32(16,u),height:e.getUint32(20,u)}}}],["image/jpeg",{test:function(e){return e.byteLength>=2&&65496===e.getUint16(0,u)},getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,u))return null;var t=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),n=t.tableMarkers,i=t.sofMarkers,r=2;for(;r=10&&1195984440===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint16(6,c),height:e.getUint16(8,c)}}}],["image/bmp",{test:function(e){return e.byteLength>=2&&16973===e.getUint16(0,u)},getSize:function(e){return{width:e.getUint32(18,c),height:e.getUint32(22,c)}}}]]);"Invalid MIME type. Supported MIME types are: ".concat(Array.from(l.keys()).join(", "));s.a._parseImageNode;function f(e,t){return h.apply(this,arguments)}function h(){return(h=Object(o.a)(a.a.mark(function e(t,n){var i,r,o;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return r=e.sent,e.next=6,r.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}var d=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],v={extensions:d,loadAndParse:f},g=n(78),p=n(14);var m={name:"JSON",extensions:["json","geojson"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},y=n(1),b={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n} geometry;\n",fs:"\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n"},_=n(61),x={name:"project32",dependencies:[_.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"};var w="7.2.0-alpha.4";if(g.a.deck&&g.a.deck.VERSION!==w)throw new Error("deck.gl - multiple versions detected: ".concat(g.a.deck.VERSION," vs ").concat(w));g.a.deck||(p.a.log(0,"deck.gl ".concat(w," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),g.a.deck=g.a.deck||{VERSION:w,version:w,log:p.a},Object(i.b)([m,v]),Object(y.registerShaderModules)([y.fp32,_.a,x,y.gouraudlighting,y.phonglighting,y.picking]),Object(y.setDefaultShaderModules)([b,_.a]),Object(y.createShaderHook)("vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)"),Object(y.createShaderHook)("vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)"),Object(y.createShaderHook)("vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)"),Object(y.createShaderHook)("fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"),Object(y.createModuleInjection)("geometry",{hook:"vs:DECKGL_FILTER_COLOR",order:99,injection:"\n #ifdef COLOR_FORMAT_RGB\n color.a *= 255.;\n #endif\n"}),Object(y.createModuleInjection)("picking",{hook:"fs:DECKGL_FILTER_COLOR",order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n"}));var O=n(27),P=n(98),S=n(2),k=n.n(S),j=n(3),E=n.n(j),C=n(7),A=n.n(C),T=n(4),L=n.n(T),M=n(8),I=n.n(M),F=n(102),R=function(e){function t(e){var n;return k()(this,t),(n=A()(this,L()(t).call(this,e))).projectedLight=new y.PointLight(e),n}return I()(t,e),E()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=Object(F.b)(this.position,{viewport:n,coordinateSystem:r,coordinateOrigin:a,fromCoordinateSystem:n.isGeospatial?O.a.LNGLAT:O.a.IDENTITY,fromCoordinateOrigin:[0,0,0]});return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=o,this.projectedLight}}]),t}(y.PointLight),D=n(99),N=n(90),z=function(e){function t(){return k()(this,t),A()(this,L()(t).apply(this,arguments))}return I()(t,e),E()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=i.modelMatrix,s=Object(N.b)({viewport:n,modelMatrix:o,coordinateSystem:r,coordinateOrigin:a}).project_uCameraPosition;return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=s,this.projectedLight}}]),t}(R),B=n(150),U=n.n(B),V=Math.PI/180,G=864e5,W=2440588,H=2451545,X=23.4397*V,q=357.5291,Z=.98560028,Y=280.147,K=360.9856235;function Q(e,t,n){var i,r,a,o,s,u,c=V*-n,l=V*t,f=function(e){return function(e){return e/G-.5+W}(e)-H}(e),h=(i=V*(q+Z*f),r=V*(1.9148*Math.sin(i)+.02*Math.sin(2*i)+3e-4*Math.sin(3*i)),a=i+r+102.9372*V+Math.PI,{declination:(o=a,s=0,u=o,Math.asin(Math.sin(s)*Math.cos(X)+Math.cos(s)*Math.sin(X)*Math.sin(u))),rightAscension:J(a,0)}),d=function(e,t){return V*(Y+K*e)-t}(f,c)-h.rightAscension;return{azimuth:$(d,l,h.declination),altitude:ee(d,l,h.declination)}}function J(e,t){var n=e;return Math.atan2(Math.sin(n)*Math.cos(X)-Math.tan(t)*Math.sin(X),Math.cos(n))}function $(e,t,n){var i=e,r=t,a=n;return Math.atan2(Math.sin(i),Math.cos(i)*Math.sin(r)-Math.tan(a)*Math.cos(r))}function ee(e,t,n){var i=e,r=t,a=n;return Math.asin(Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos(i))}var te=function(e){function t(e){var n,i=e.timestamp,r=U()(e,["timestamp"]);return k()(this,t),(n=A()(this,L()(t).call(this,r))).timestamp=i,n}return I()(t,e),E()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer.context.viewport,n=t.latitude,i=t.longitude;return this.direction=function(e,t,n){var i=Q(e,t,n),r=i.azimuth,a=i.altitude,o=r+Math.PI;return[-Math.sin(o),-Math.cos(o),-Math.sin(a)]}(this.timestamp,n,i),this}}]),t}(y.DirectionalLight),ne=n(101),ie=n(83),re=n(135),ae=n(113),oe=n(116),se=n(85),ue=n(134),ce=n(120),le=n(39),fe=n(112),he=n(109),de=n(42),ve=n(111),ge=n(140),pe=n(138),me=n(30),ye=n(81);var be=function(e){function t(){return k()(this,t),A()(this,L()(t).apply(this,arguments))}return I()(t,e),E()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.bearing,i=t.pitch,r=t.position,a=t.up,o=50*t.zoom,s=function(e){var t=e.bearing,n=e.pitch;return new pe.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:n,pitch:i}).scale(-o).multiply(new me.a(1,1,-1)),u=(new ye.a).multiplyRight((new ye.a).lookAt({eye:s,center:r,up:a}));return new le.a(Object.assign({},e,{id:this.id,zoom:null,viewMatrix:u}))}}]),t}(de.a);be.displayName="ThirdPersonView";var _e=n(141),xe=n(18),we=Math.PI/180,Oe=function(e){function t(){return k()(this,t),A()(this,L()(t).apply(this,arguments))}return I()(t,e),E()(t,[{key:"_getViewport",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.viewState,o=a.eye,s=a.lookAt,u=void 0===s?[0,0,0]:s,c=a.up,l=void 0===c?[0,1,0]:c,f=e.fovy||a.fovy||75,h=e.near||a.near||1,d=e.far||a.far||100,v=Number.isFinite(a.aspect)?a.aspect:i/r,g=f*we;return new le.a({id:this.id,x:t,y:n,width:i,height:r,viewMatrix:xe.f([],o,u,l),projectionMatrix:xe.i([],g,v,h,d)})}}]),t}(de.a);Oe.displayName="PerspectiveView";var Pe=n(142),Se=n(60),ke=n(119),je=n(114),Ee=n(84),Ce=n(115),Ae=n(72),Te=n(59),Le=n(58),Me=n(125),Ie=n(20),Fe=n(44),Re=n(24),De=n(41),Ne=.01,ze=["longitude","latitude","zoom"];var Be=["bearing","pitch"],Ue=function(e){function t(){return k()(this,t),A()(this,L()(t).call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]}))}return I()(t,e),E()(t,[{key:"interpolateProps",value:function(e,t,n){for(var i=function(e,t,n){var i={},r=e.zoom,a=[e.longitude,e.latitude],o=Object(Re.l)(r),s=t.zoom,u=[t.longitude,t.latitude],c=Object(Re.l)(s-r),l=Object(Re.g)(a,o),f=Object(Re.g)(u,o),h=De.g([],f,l),d=Math.max(e.width,e.height),v=d/c,g=De.c(h);if(Math.abs(g)0&&void 0!==arguments[0]?arguments[0]:{};k()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=He.a,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return E()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64,a=e.dataChanged;if(this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,Array.isArray(a)){var o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;this._rebuildGeometry(f)}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(Ge.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w0&&void 0!==arguments[0]?arguments[0]:{};k()(this,e),this.opts=t}return E()(e,[{key:"equals",value:function(e){return this===e||this.constructor===e.constructor&&Object(Ye.a)(this.opts,e.opts)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var t=e.constructor.defaultProps,n=void 0===t?{}:t,i={updateTriggers:{}};for(var r in n)if(r in this.props){var a=n[r],o=this.props[r];i[r]=o,a&&"accessor"===a.type&&(i.updateTriggers[r]=this.props.updateTriggers[r],"function"==typeof o&&(i[r]=this.getSubLayerAccessor(o,!0)))}return i}},{key:"initializeState",value:function(e,t){}},{key:"updateState",value:function(e,t){}},{key:"finalizeState",value:function(e){}}]),e}();n.d(t,"experimental",function(){return Qe}),n.d(t,"COORDINATE_SYSTEM",function(){return O.a}),n.d(t,"LightingEffect",function(){return P.a}),n.d(t,"PointLight",function(){return R}),n.d(t,"DirectionalLight",function(){return D.a}),n.d(t,"_CameraLight",function(){return z}),n.d(t,"_SunLight",function(){return te}),n.d(t,"PostProcessEffect",function(){return ne.a}),n.d(t,"_LayersPass",function(){return ie.a}),n.d(t,"Deck",function(){return re.a}),n.d(t,"LayerManager",function(){return ae.a}),n.d(t,"AttributeManager",function(){return oe.a}),n.d(t,"Layer",function(){return se.a}),n.d(t,"CompositeLayer",function(){return ue.a}),n.d(t,"DeckRenderer",function(){return ce.a}),n.d(t,"Viewport",function(){return le.a}),n.d(t,"WebMercatorViewport",function(){return fe.a}),n.d(t,"project",function(){return _.a}),n.d(t,"project64",function(){return he.a}),n.d(t,"View",function(){return de.a}),n.d(t,"MapView",function(){return ve.a}),n.d(t,"FirstPersonView",function(){return ge.a}),n.d(t,"ThirdPersonView",function(){return be}),n.d(t,"OrbitView",function(){return _e.a}),n.d(t,"PerspectiveView",function(){return Oe}),n.d(t,"OrthographicView",function(){return Pe.a}),n.d(t,"Controller",function(){return Se.a}),n.d(t,"MapController",function(){return ke.a}),n.d(t,"_FirstPersonController",function(){return je.a}),n.d(t,"_OrbitController",function(){return Ee.b}),n.d(t,"_OrthographicController",function(){return Ce.a}),n.d(t,"Effect",function(){return Ae.a}),n.d(t,"TRANSITION_EVENTS",function(){return Te.a}),n.d(t,"LinearInterpolator",function(){return Le.a}),n.d(t,"FlyToInterpolator",function(){return Ue}),n.d(t,"log",function(){return p.a}),n.d(t,"createIterable",function(){return Ge.a}),n.d(t,"fp64LowPart",function(){return We.c}),n.d(t,"AmbientLight",function(){return y.AmbientLight}),n.d(t,"LayerExtension",function(){return Ke});var Qe={Tesselator:Xe,flattenVertices:Ve.c,fillArray:Ve.a,count:qe.a,memoize:Ze.a}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"e",function(){return d});var i={};function r(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function a(e){return Math.round(e/i.EPSILON)*i.EPSILON}function o(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function O(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.h([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function S(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function k(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){"use strict";var i=n(87),r=n(108),a=n(100),o=n(147),s=n(82),u={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null};function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var l="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",f="".concat(l,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),h={ONE:1};var d={name:"fp64",vs:f,fs:null,fp64ify:c,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var i=0;i<4;++i){var r=4*n+i;c(e[4*i+n],t,2*r)}return t},getUniforms:function(){return Object.assign({},h)}},v=("".concat(l),n(81)),g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p={modelMatrix:g,viewMatrix:g,projectionMatrix:g,cameraPositionWorld:[0,0,0]};var m="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",y={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new v.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(m,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(m)},b="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",_={name:"lights",vs:b,fs:b,getUniforms:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,r=n.pointLights,a=n.directionalLights,o=i||r&&r.length>0||a&&a.length>0;return o?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,a=void 0===r?[]:r,o={};o["lighting_uAmbientLight.color"]=t?w(t):[0,0,0];return i.forEach(function(e,t){o["lighting_uPointLight[".concat(t,"].color")]=w(e),o["lighting_uPointLight[".concat(t,"].position")]=e.position,o["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),o.lighting_uPointLightCount=i.length,a.forEach(function(e,t){o["lighting_uDirectionalLight[".concat(t,"].color")]=w(e),o["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),o.lighting_uDirectionalLightCount=a.length,o}({ambientLight:i,pointLights:r,directionalLights:a}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var s={pointLights:[],directionalLights:[]},u=!0,c=!1,l=void 0;try{for(var f,h=(t.lights||[])[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;switch(d.type){case"ambient":s.ambientLight=d;break;case"directional":s.directionalLights.push(d);break;case"point":s.pointLights.push(d)}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return e({lightSources:s})}return{}},defines:{MAX_LIGHTS:3}},x={};function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}var O={lightDirection:new Float32Array([1,1,2])};var P={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[y]},S={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};var k={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:S,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}},j={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var E={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},C="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",A={name:"gouraud-lighting",dependencies:[_],vs:C,defines:{LIGHTING_VERTEX:1},getUniforms:M},T={name:"phong-lighting",dependencies:[_],fs:C,defines:{LIGHTING_FRAGMENT:1},getUniforms:M},L={};function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor,t}(t):{lighting_uEnabled:!1}}var I="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",F={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[{name:"project2",vs:I,fs:I},_]},R=n(139);n.d(t,"a",function(){return D}),n.d(t,"u",function(){return i.b}),n.d(t,"v",function(){return i.d}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.b}),n.d(t,"p",function(){return o.a}),n.d(t,"m",function(){return s.c}),n.d(t,"l",function(){return s.b}),n.d(t,"x",function(){return s.e}),n.d(t,"w",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u}),n.d(t,"k",function(){return d}),n.d(t,"t",function(){return y}),n.d(t,"o",function(){return _}),n.d(t,"i",function(){return P}),n.d(t,"s",function(){return k}),n.d(t,"h",function(){return E}),n.d(t,"n",function(){return A}),n.d(t,"r",function(){return T}),n.d(t,"q",function(){return F}),n.d(t,"b",function(){return R.a});var D={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",defaultUniforms:{}}},function(e,t,n){"use strict";(function(e){n.d(t,"c",function(){return c}),n.d(t,"b",function(){return d}),n.d(t,"a",function(){return v});var i=n(5),r=n(37),a=n(71),o="luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",s=e,u=null;function c(){var e=s.require("gl");if(!e)throw new Error(o);return e.apply(void 0,arguments)}if(!a.a)try{u=s.require("gl/wrap")}catch(e){}var l=function e(){Object(i.a)(this,e)},f=u||r.b,h=(f.WebGLRenderingContext,f.WebGLProgram,f.WebGLShader,f.WebGLBuffer),d=void 0===h?l:h;f.WebGLFramebuffer,f.WebGLRenderbuffer,f.WebGLTexture,f.WebGLUniformLocation,f.WebGLActiveInfo,f.WebGLShaderPrecisionFormat;var v=r.b.WebGL2RenderingContext||function e(){Object(i.a)(this,e)};r.b.Image}).call(this,n(164)(e))},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r});var i={LNGLAT:1,LNGLAT_DEPRECATED:5,METER_OFFSETS:2,METERS:2,LNGLAT_OFFSETS:3,IDENTITY:0},r={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},function(e,t,n){"use strict";function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(5),r=n(6),a=n(11),o=n(10),s=n(12),u=n(88),c=n(20),l=n(35),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.c(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.j(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.k(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.l(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,n,i){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e[3]=s+i*(n[3]-s),e}function g(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}function p(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function m(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=i.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-u)<=i.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=i.b*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var y,b;y=new i.a(4),i.a!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),b=y},function(e,t,n){e.exports=n(179)()},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=i=function(e){return n(e)}:e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},i(t)}e.exports=i},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"g",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"n",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return v}),n.d(t,"a",function(){return g}),n.d(t,"m",function(){return m}),n.d(t,"f",function(){return y});var i=n(13);function r(){var e=new i.a(3);return i.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function l(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function f(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function v(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function g(e,t){var n=o(e[0],e[1],e[2]),i=o(t[0],t[1],t[2]);u(n,n),u(i,i);var r=c(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var p,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},y=a;p=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";(function(e){n.d(t,"c",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},r=i.self||i.window||i.global,a=i.window||i.self||i.global,o=i.global||i.self||i.window,s=i.document||{}}).call(this,n(56))},,function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(17),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(14),l=n(62),f=n(20),h=n(81),d=n(30),v=n(18),g=n(24),p=n(16),m=Math.PI/180,y=Object(l.a)(),b=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(73),v=n(16);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,O=t.modelMatrix,P=void 0===O?null:O,S=t.viewportInstance,k=void 0===S?null:S,j=t.type,E=void 0===j?c.a:j;Object(v.a)(!k||k instanceof c.a),this.viewportInstance=k,this.id=i||this.constructor.displayName||"view",this.type=E,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(29),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(56),n(66))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(32);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.n([],t,e);return i.k(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){for(var t=1;t0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s})},function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return v}),n.d(t,"c",function(){return p});var i,r,a,o=n(23),s=n(0),u=n(49),c=(i={},Object(s.a)(i,3042,!1),Object(s.a)(i,32773,new Float32Array([0,0,0,0])),Object(s.a)(i,32777,32774),Object(s.a)(i,34877,32774),Object(s.a)(i,32969,1),Object(s.a)(i,32968,0),Object(s.a)(i,32971,1),Object(s.a)(i,32970,0),Object(s.a)(i,3106,new Float32Array([0,0,0,0])),Object(s.a)(i,3107,[!0,!0,!0,!0]),Object(s.a)(i,2884,!1),Object(s.a)(i,2885,1029),Object(s.a)(i,2929,!1),Object(s.a)(i,2931,1),Object(s.a)(i,2932,513),Object(s.a)(i,2928,new Float32Array([0,1])),Object(s.a)(i,2930,!0),Object(s.a)(i,3024,!0),Object(s.a)(i,36006,null),Object(s.a)(i,2886,2305),Object(s.a)(i,33170,4352),Object(s.a)(i,2849,1),Object(s.a)(i,32823,!1),Object(s.a)(i,32824,0),Object(s.a)(i,10752,0),Object(s.a)(i,32938,1),Object(s.a)(i,32939,!1),Object(s.a)(i,3089,!1),Object(s.a)(i,3088,new Int32Array([0,0,1024,1024])),Object(s.a)(i,2960,!1),Object(s.a)(i,2961,0),Object(s.a)(i,2968,4294967295),Object(s.a)(i,36005,4294967295),Object(s.a)(i,2962,519),Object(s.a)(i,2967,0),Object(s.a)(i,2963,4294967295),Object(s.a)(i,34816,519),Object(s.a)(i,36003,0),Object(s.a)(i,36004,4294967295),Object(s.a)(i,2964,7680),Object(s.a)(i,2965,7680),Object(s.a)(i,2966,7680),Object(s.a)(i,34817,7680),Object(s.a)(i,34818,7680),Object(s.a)(i,34819,7680),Object(s.a)(i,2978,new Int32Array([0,0,1024,1024])),Object(s.a)(i,3333,4),Object(s.a)(i,3317,4),Object(s.a)(i,37440,!1),Object(s.a)(i,37441,!1),Object(s.a)(i,37443,37444),Object(s.a)(i,35723,4352),Object(s.a)(i,36010,null),Object(s.a)(i,35977,!1),Object(s.a)(i,3330,0),Object(s.a)(i,3332,0),Object(s.a)(i,3331,0),Object(s.a)(i,3314,0),Object(s.a)(i,32878,0),Object(s.a)(i,3316,0),Object(s.a)(i,3315,0),Object(s.a)(i,32877,0),i),l=function(e,t,n){return t?e.enable(n):e.disable(n)},f=function(e,t,n){return e.hint(n,t)},h=function(e,t,n){return e.pixelStorei(n,t)},d=(r={},Object(s.a)(r,3042,l),Object(s.a)(r,32773,function(e,t){return e.blendColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,32777,"blendEquation"),Object(s.a)(r,34877,"blendEquation"),Object(s.a)(r,32969,"blendFunc"),Object(s.a)(r,32968,"blendFunc"),Object(s.a)(r,32971,"blendFunc"),Object(s.a)(r,32970,"blendFunc"),Object(s.a)(r,3106,function(e,t){return e.clearColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,3107,function(e,t){return e.colorMask.apply(e,Object(o.a)(t))}),Object(s.a)(r,2884,l),Object(s.a)(r,2885,function(e,t){return e.cullFace(t)}),Object(s.a)(r,2929,l),Object(s.a)(r,2931,function(e,t){return e.clearDepth(t)}),Object(s.a)(r,2932,function(e,t){return e.depthFunc(t)}),Object(s.a)(r,2928,function(e,t){return e.depthRange.apply(e,Object(o.a)(t))}),Object(s.a)(r,2930,function(e,t){return e.depthMask(t)}),Object(s.a)(r,3024,l),Object(s.a)(r,35723,f),Object(s.a)(r,36006,function(e,t){var n=Object(u.c)(e)?36009:36160;return e.bindFramebuffer(n,t)}),Object(s.a)(r,2886,function(e,t){return e.frontFace(t)}),Object(s.a)(r,33170,f),Object(s.a)(r,2849,function(e,t){return e.lineWidth(t)}),Object(s.a)(r,32823,l),Object(s.a)(r,32824,"polygonOffset"),Object(s.a)(r,10752,"polygonOffset"),Object(s.a)(r,35977,l),Object(s.a)(r,32938,"sampleCoverage"),Object(s.a)(r,32939,"sampleCoverage"),Object(s.a)(r,3089,l),Object(s.a)(r,3088,function(e,t){return e.scissor.apply(e,Object(o.a)(t))}),Object(s.a)(r,2960,l),Object(s.a)(r,2961,function(e,t){return e.clearStencil(t)}),Object(s.a)(r,2968,function(e,t){return e.stencilMaskSeparate(1028,t)}),Object(s.a)(r,36005,function(e,t){return e.stencilMaskSeparate(1029,t)}),Object(s.a)(r,2962,"stencilFuncFront"),Object(s.a)(r,2967,"stencilFuncFront"),Object(s.a)(r,2963,"stencilFuncFront"),Object(s.a)(r,34816,"stencilFuncBack"),Object(s.a)(r,36003,"stencilFuncBack"),Object(s.a)(r,36004,"stencilFuncBack"),Object(s.a)(r,2964,"stencilOpFront"),Object(s.a)(r,2965,"stencilOpFront"),Object(s.a)(r,2966,"stencilOpFront"),Object(s.a)(r,34817,"stencilOpBack"),Object(s.a)(r,34818,"stencilOpBack"),Object(s.a)(r,34819,"stencilOpBack"),Object(s.a)(r,2978,function(e,t){return e.viewport.apply(e,Object(o.a)(t))}),Object(s.a)(r,3333,h),Object(s.a)(r,3317,h),Object(s.a)(r,37440,h),Object(s.a)(r,37441,h),Object(s.a)(r,37443,h),Object(s.a)(r,3330,h),Object(s.a)(r,3332,h),Object(s.a)(r,3331,h),Object(s.a)(r,36010,function(e,t){return e.bindFramebuffer(36008,t)}),Object(s.a)(r,3314,h),Object(s.a)(r,32878,h),Object(s.a)(r,3316,h),Object(s.a)(r,3315,h),Object(s.a)(r,32877,h),r),v={blendEquation:function(e,t){return e.blendEquationSeparate(t[32777],t[34877])},blendFunc:function(e,t){return e.blendFuncSeparate(t[32969],t[32968],t[32971],t[32970])},polygonOffset:function(e,t){return e.polygonOffset(t[32824],t[10752])},sampleCoverage:function(e,t){return e.sampleCoverage(t[32938],t[32939])},stencilFuncFront:function(e,t){return e.stencilFuncSeparate(1028,t[2962],t[2967],t[2963])},stencilFuncBack:function(e,t){return e.stencilFuncSeparate(1029,t[34816],t[36003],t[36004])},stencilOpFront:function(e,t){return e.stencilOpSeparate(1028,t[2964],t[2965],t[2966])},stencilOpBack:function(e,t){return e.stencilOpSeparate(1029,t[34817],t[34818],t[34819])}},g=function(e,t){return e.isEnabled(t)},p=(a={},Object(s.a)(a,3042,g),Object(s.a)(a,2884,g),Object(s.a)(a,2929,g),Object(s.a)(a,3024,g),Object(s.a)(a,32823,g),Object(s.a)(a,32926,g),Object(s.a)(a,32928,g),Object(s.a)(a,3089,g),Object(s.a)(a,2960,g),Object(s.a)(a,35977,g),a)},function(t,n){t.exports=e},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n(110);function r(e){for(var t in e)return!1;return!0}function a(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"c",function(){return a}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(127),r=n.n(i),a=n(36),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});var i="vs",r="fs"},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(46),r=n(110),a=n(49);function o(e,t,n){var r=i.c[t],o=r?r(e,Number(t)):e.getParameter(Number(t)),s=i.d[t];return Object(a.a)("function"==typeof s),s(e,n,Number(t)),o}function s(e,t){var n={};for(var r in t){var a=Number(r),o=i.d[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],a))}var s=e.state&&e.state.cache;if(s){var u=Object.assign({},s,t);for(var c in n){(0,i.a[c])(e,u)}}}function u(e,t){var n=i.c[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function c(e,t){t=t||i.b;var n=Array.isArray(t)?t:Object.keys(t),r={},a=!0,o=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;r[f]=u(e,f)}}catch(e){o=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return r}function l(e){s(e,Object.assign({},i.b,{}))}function f(e){var t=c(i.b),n={};for(var a in i.b)Object(r.a)(t[a],i.b[a])||(n[a]=t[a]);return n}},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}function o(e){return e&&e[Symbol.asyncIterator]}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&uHTMLVideoElement.HAVE_METADATA&&(i.width!==o.videoWidth||i.height!==o.videoHeight?(i.resize({width:o.videoWidth,height:o.videoHeight,mipmaps:!0}),i.setSubImageData({data:o,paramters:w})):i.setSubImageData({data:o}),i.generateMipmap());i&&r&&r.setUniforms(Object.assign({},t,{bitmapTexture:i,desaturate:s,transparentColor:u,tintColor:c})).draw()}},{key:"loadTexture",value:function(e){var t=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),e instanceof x.Texture2D?this.setState({bitmapTexture:e}):e instanceof Image||e instanceof HTMLCanvasElement?this.setState({bitmapTexture:new x.Texture2D(t,{data:e,parameters:w})}):e instanceof HTMLVideoElement&&this.setState({bitmapTexture:new x.Texture2D(t,{width:1,height:1,parameters:w,mipmaps:!1})})}},{key:"calculatePositions",value:function(e){var t=e.value,n=this.state.positions;t.set(n)}},{key:"calculatePositions64xyLow",value:function(e){var t=this.use64bitPositions();(e.constant=!t,t)?e.value.set(this.state.positions.map(b.c)):e.value=new Float32Array(4)}}]),t}(_.a);O.layerName="BitmapLayer",O.defaultProps={image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};var P=n(53),S=n(31),k=n.n(S),j=n(48),E=n(154),C=n.n(E),A=n(155),T=n.n(A),L=n(21);function M(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}var I=!1,F=!0,R=new Map([["image/png",function(e){var t=B(e);if(t.byteLength<24||2303741511!==t.getUint32(0,I))return null;return{width:t.getUint32(16,I),height:t.getUint32(20,I)}}],["image/jpeg",function(e){var t=B(e);if(t.byteLength<2||65496!==t.getUint16(0,I))return null;var n=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),i=n.tableMarkers,r=n.sofMarkers,a=2;for(;a1&&void 0!==arguments[1]?arguments[1]:null;if(t){var n=R.get(t);if(!n)throw new Error(D);var i=n(e);if(!i)throw new Error("invalid image data for type: ".concat(t));return i}var r=z(e,t);if(!r)throw new Error(D);return r}function z(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=R.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=Object(L.a)(a.value,2),u=s[0],c=(0,s[1])(e);if(c)return c.mimeType=u,c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function B(e){if(M&&(e=M(e)),e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}function U(e,t){return V.apply(this,arguments)}function V(){return(V=Object(j.a)(k.a.mark(function e(t,n){var i,r,a,o,s;return k.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=T.a.promisify(C.a),r=N(t),a=r.mimeType,o=t instanceof Buffer?t:Buffer.from(t),e.next=5,i(o,a);case 5:return s=e.sent,e.abrupt("return",{width:s.shape[0],height:s.shape[1],data:s.data});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}var G;function W(e,t){return U?U(e,t):function(e){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var t=new Blob([new Uint8Array(e)]);return createImageBitmap(t)}(e)}function H(){return(H=Object(j.a)(k.a.mark(function e(t,n){var i,r;return k.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof Image){e.next=8;break}return e.next=3,fetch(t,n);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return r=e.sent,e.abrupt("return",W(r));case 8:return e.next=10,X(t,n);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function X(e,t){return q.apply(this,arguments)}function q(){return(q=Object(j.a)(k.a.mark(function e(t,n){var i,r,a;return k.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return r=e.sent,e.next=6,r.text();case 6:a=e.sent,i="data:image/svg+xml;base64,".concat(btoa(a)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Z=1024,Y=4,K=function(){},Q=(G={},y()(G,10241,9987),y()(G,10240,9729),G);function J(e){return e&&(e.id||e.url)}function $(e,t,n){for(var i=0;i0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&($(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&$(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new x.Texture2D(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:Q})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(x.readPixelsToBuffer)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:Q}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;(function(e,t){return H.apply(this,arguments)})(e.url).then(function(r){var a=J(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},Q,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),te=[0,0,0,255],ne={iconAtlas:{type:"object",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},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:te},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},ie=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors / 255.;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new ee(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getColor",defaultValue:te},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s||this.props._asyncPropOriginalValues.iconAtlas?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),r.extensionsChanged){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new x.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new x.Geometry({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(P.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=Object(b.c)(p[0]),a[o++]=Object(b.c)(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(P.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(P.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(P.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(_.a);ie.layerName="IconLayer",ie.defaultProps=ne;var re=n(145),ae=[0,0,0,255],oe=[0,0,1],se=new x.PhongMaterial,ue={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:oe},getColor:{type:"accessor",value:ae},material:se,radiusPixels:{deprecatedFor:"pointSize"}};var ce=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity) / 255.0;\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:oe},instanceColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getColor",defaultValue:ae}})}},{key:"updateState",value:function(e){var n,i,r,a=e.props,o=e.oldProps,s=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:a,oldProps:o,changeFlags:s}),s.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),this.getAttributeManager().invalidateAll()}s.dataChanged&&(n=a.data,i=n.header,r=n.attributes,i&&r&&(n.length=i.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION,r.instancePositions64xyLow={constant:!0,value:new Float32Array(2)}),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0&&(r.instanceColors=r.COLOR_0)))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new x.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new x.Geometry({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(P.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var _=s(y,h);u[c++]=Object(b.c)(_[0]),u[c++]=Object(b.c)(_[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(_.a);ce.layerName="PointCloudLayer",ce.defaultProps=ue;var le=n(118),fe=n(117),he=n(143),de=n(75),ve=n(144),ge=n(148),pe=n(134),me=n(17),ye=n.n(me),be=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position); \n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getParagraphSize,f=r.getRowSize,h=r.getOffsets,d=e.value,v=n*e.size,g=Object(P.a)(a,n,i).iterable,p=!0,m=!1,y=void 0;try{for(var b,_=g[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){var x=b.value,w=o[s(x)]||{},O=l(x),S=ye()(O,2),k=S[0],j=S[1],E=f(x),C=ye()(E,1)[0],A=h(x),T=ye()(A,2),L=T[0],M=T[1],I=u(x),F=c(x),R=(1-I)*(k-C)/2;d[v++]=(I-1)*k/2+R+w.width/2+L||0,d[v++]=(F-1)*j/2+w.height/2+M||0}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(P.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(ie);be.layerName="MultiIconLayer",be.defaultProps={getRowSize:{type:"accessor",value:function(e){return e.rowSize||[0,0]}},getOffsets:{type:"accessor",value:function(e){return e.offsets||[0,0]}},getParagraphSize:{type:"accessor",value:function(e){return e.size||[1,1]}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var _e=n(158),xe=n.n(_e),we=n(14),Oe=32;function Pe(e,t,n,i,r){var a=e.split("\n"),o=[0,0],s=0;a.forEach(function(e){var a=function(e,t,n){var i=0,r=0,a=Array.from(e);return{characters:a=a.map(function(e,a){var o={text:e,offsetLeft:i},s=t[e];return s?(i+=s.width,r||(r=s.height*n)):(we.a.warn("Missing character: ".concat(e))(),i+=Oe),o}),rowWidth:i,rowHeight:r}}(e,n,t),u=a.characters,c=a.rowWidth,l=a.rowHeight,f=[c,l];u.forEach(function(e){e.offsetTop=s,e.size=o,e.rowSize=f,r.push(i(e))}),s+=l,o[0]=Math.max(o[0],c)}),o[1]=s}var Se=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ke=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),je="Monaco, monospace",Ee="normal",Ce=64,Ae=2,Te=.25,Le=3,Me=new Se(3),Ie=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Fe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};Ie.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=Me.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=Me.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),Me.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");Re(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(Re(h,r,o,a),u){var b=new xe.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,O=void 0;try{for(var P,S=t[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var k=P.value;Fe(b.draw(k),_),h.putImageData(_,v[k].x-s,v[k].y-s)}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}}else{var j=!0,E=!1,C=void 0;try{for(var A,T=t[Symbol.iterator]();!(j=(A=T.next()).done);j=!0){var L=A.value;h.fillText(L,v[L].x,v[L].y+.9*o)}}catch(e){E=!0,C=e}finally{try{j||null==T.return||T.return()}finally{if(E)throw C}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=Me.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),Ne=n(93),ze={fontSize:Ce,buffer:Ae,sdf:!1,radius:Le,cutoff:Te},Be={start:1,middle:0,end:-1},Ue={top:1,center:0,bottom:-1},Ve=["fontSize","buffer","sdf","radius","cutoff"],Ge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ke,fontFamily:je,fontWeight:Ee,lineHeight:1,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},We=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new De(this.context.gl)}}},{key:"updateState",value:function(e){var t=this,n=e.props,i=e.oldProps,r=e.changeFlags,a=this.fontChanged(i,n);a&&this.updateFontAtlas({oldProps:i,props:n});var o=r.dataChanged||a||n.lineHeight!==i.lineHeight||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText);if(o&&Array.isArray(r.dataChanged)){var s=this.state.data.slice(),u=r.dataChanged.map(function(e){return Object(Ne.a)({data:s,getIndex:function(e){return e.__source.index},dataRange:e,replace:t.transformStringToLetters(e)})});this.setState({data:s,dataDiff:u})}else o&&this.setState({data:this.transformStringToLetters(),dataDiff:null})}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},ze,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return Ve.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,r=n.lineHeight,a=n.getText,o=this.state.iconMapping,s=t.startRow,u=t.endRow,c=Object(P.a)(i,s,u),l=c.iterable,f=c.objectInfo,h=[],d=!0,v=!1,g=void 0;try{for(var p,m=function(){var t=p.value;f.index++;var n=a(t,f);n&&Pe(n,r,o,function(n){return e.getSubLayerRow(n,t,f.index)},h)},y=l[Symbol.iterator]();!(d=(p=y.next()).done);d=!0)m()}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}return h}},{key:"getAnchorXFromTextAnchor",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Be[e(t)]||0}):function(){return Be[e]||0}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Be[e(t)]||0}):function(){return Ue[e]||0}}},{key:"renderLayers",value:function(){var e=this.state,t=e.data,n=e.dataDiff,i=e.scale,r=e.iconAtlas,a=e.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.billboard,g=o.sdf,p=o.sizeScale,m=o.sizeUnits,y=o.sizeMinPixels,b=o.sizeMaxPixels,_=o.transitions,x=o.updateTriggers;return new(this.getSubLayerClass("characters",be))({sdf:g,iconAtlas:r,iconMapping:a,_dataDiff:n&&function(){return n},getPosition:this.getSubLayerAccessor(s),getColor:this.getSubLayerAccessor(u),getSize:this.getSubLayerAccessor(c),getAngle:this.getSubLayerAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this.getSubLayerAccessor(d),getPickingIndex:function(e){return e.__source.index},billboard:v,sizeScale:p*i,sizeUnits:m,sizeMinPixels:y*i,sizeMaxPixels:b*i,transitions:_&&{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:x.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:x.getPixelOffset,getAnchorX:x.getTextAnchor,getAnchorY:x.getAlignmentBaseline}}),{data:t,getIcon:function(e){return e.text},getRowSize:function(e){return e.rowSize},getOffsets:function(e){return[e.offsetLeft,e.offsetTop]},getParagraphSize:function(e){return e.size}})}}]),t}(pe.a);We.layerName="TextLayer",We.defaultProps=Ge;var He=n(86);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return O}),n.d(t,"IconLayer",function(){return ie}),n.d(t,"LineLayer",function(){return re.a}),n.d(t,"PointCloudLayer",function(){return ce}),n.d(t,"ScatterplotLayer",function(){return le.a}),n.d(t,"ColumnLayer",function(){return fe.a}),n.d(t,"GridCellLayer",function(){return he.a}),n.d(t,"PathLayer",function(){return de.a}),n.d(t,"PolygonLayer",function(){return ve.a}),n.d(t,"GeoJsonLayer",function(){return ge.a}),n.d(t,"TextLayer",function(){return We}),n.d(t,"SolidPolygonLayer",function(){return He.a}),n.d(t,"_MultiIconLayer",function(){return be})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(125),v=n(20),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(58),u=n(126),c=n(16),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(59),u=n(14),c=n(16),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,e.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){if(!this.isDragging())return!1;var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState,r={};switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut(),r.isZooming=!0;break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn(),r.isZooming=!0;break;case 37:n?(t=i.rotateLeft(),r.isRotating=!0):(t=i.moveLeft(),r.isPanning=!0);break;case 39:n?(t=i.rotateRight(),r.isRotating=!0):(t=i.moveRight(),r.isPanning=!0);break;case 38:n?(t=i.rotateUp(),r.isRotating=!0):(t=i.moveUp(),r.isPanning=!0);break;case 40:n?(t=i.rotateDown(),r.isRotating=!0):(t=i.moveDown(),r.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),r),!0}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";var i=n(1),r=n(40),a=Object.keys(r.a).map(function(e){return"const float COORDINATE_SYSTEM_".concat(e," = ").concat(r.a[e],".;")}).join(""),o="".concat(a,"\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform float project_uAntimeridian;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n dy = clamp(dy, -1., 1.);\n }\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return project_uViewProjectionMatrix * position + project_uCenter;\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n"),s=n(90),u={};t.a={name:"project",dependencies:[i.fp32],vs:o,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?Object(s.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return v});var i=n(30);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-t[2],-t[6],-t[10]],up:[t[1],t[5],t[9]],right:[t[0],t[4],t[8]]}}var o=new i.a,s=new i.a,u=new i.a,c=new i.a,l=new i.a,f=new i.a,h=new i.a;function d(e){var t=e.aspect,n=e.near,r=e.far,a=e.fovyRadians,d=e.position,v=e.direction,g=e.up,p=e.right;s.copy(v);var m=1/s.len();s.normalize(),o.copy(d),u.copy(g).normalize(),c.copy(p).normalize();var y=2*Math.tan(a/2)*n,b=y*t;l.copy(s).scale(n*m).add(o),f.copy(s).scale(r*m).add(o);var _=s.clone().negate(),x=_.dot(l),w={near:{d:x,n:_},far:{d:s.dot(f),n:s.clone()}};return h.copy(c).scale(.5*b).add(l).subtract(o).normalize(),_=new i.a(u).cross(h),x=o.dot(_),w.right={n:_,d:x},h.copy(c).scale(.5*-b).add(l).subtract(o).normalize(),_=new i.a(h).cross(u),x=o.dot(_),w.left={n:_,d:x},h.copy(u).scale(.5*y).add(l).subtract(o).normalize(),_=new i.a(h).cross(c),x=o.dot(_),w.top={n:_,d:x},h.copy(u).scale(.5*-y).add(l).subtract(o).normalize(),_=new i.a(c).cross(h),x=o.dot(_),w.bottom={n:_,d:x},w}function v(e){return e-Math.fround(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(68),r=n(43);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t){var n,i,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),c(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(56))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(121),r="7.2.0-alpha.4",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},function(e,t,n){"use strict";(function(e){var i=n(29),r=n(149),a=!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||r.a;t.a=a}).call(this,n(66))},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";function i(e,t){return e===t||Object.keys(e).every(function(n){return Array.isArray(e[n])&&Array.isArray(t[n])?i(e[n],t[n]):e[n]===t[n]})}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(85),p=n(1),m=n(19),y=n(62),b=m.experimental.Tesselator,_=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3,padding:3},endPositions:{size:3,padding:3},segmentTypes:{size:1,type:Uint8ClampedArray},startPositions64XyLow:{size:2,padding:2,fp64Only:!0},endPositions64XyLow:{size:2,padding:2,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){var t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t+1:Math.max(0,t-1)}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.startPositions64XyLow,o=n.endPositions64XyLow,s=n.segmentTypes,u=this.fp64,c=t.geometrySize;if(0!==c)for(var l,f,h=this.isClosed(e),d=t.vertexStart,v=0;v=e.length&&(t+=1-e.length/n),[e[t*n],e[t*n+1],3===n?e[t*n+2]:0]}return t>=e.length&&(t+=1-e.length),e[t]}},{key:"isClosed",value:function(e){var t=this.getPathLength(e),n=this.getPointOnPath(e,0),i=this.getPointOnPath(e,t-1);return n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]}}]),t}(b);n.d(t,"a",function(){return P});var x=[0,0,0,255],w={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:x},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},O={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},P=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceLeftStartPositions64xyLow;\nattribute vec4 instanceEndRightPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width, vec2 widthPixels\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = !isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0);\n bool isEndCap = isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0);\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(vCornerOffset * widthPixels * isValid, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n return currPoint + vec3(offset.xy / widthPixels * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n vec2 width = billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width, widthPixels\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.worldPosition = instanceStartPositions;\n geometry.worldPositionAlt = instanceEndPositions;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceLeftStartPositions64xyLow.xy, instanceLeftStartPositions64xyLow.zw, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceLeftStartPositions64xyLow.zw, instanceEndRightPositions64xyLow.xy, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceEndRightPositions64xyLow.xy, instanceEndRightPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({startPositions:{size:3,offset:12,transition:O,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{offset:0},instanceStartPositions:{offset:12}}},endPositions:{size:3,transition:O,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0,shaderAttributes:{instanceEndPositions:{offset:0},instanceRightPositions:{offset:12}}},instanceLeftStartPositions64xyLow:{size:4,stride:8,update:this.calculateLeftStartPositions64xyLow,noAlloc:!0},instanceEndRightPositions64xyLow:{size:4,stride:8,update:this.calculateEndRightPositions64xyLow,noAlloc:!0},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:O,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:this.props.colorFormat.length,type:5121,accessor:"getColor",transition:O,defaultValue:x},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new _({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions(),dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),r.dataChanged||a.invalidateAll()}if(r.extensionsChanged){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new p.Geometry({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateSegmentTypes",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("segmentTypes")}},{key:"calculateLeftStartPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startPositions64XyLow"):new Float32Array(4)}},{key:"calculateEndRightPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("endPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(88).a),p=n(18),m=n(41),y=n(35),b=n(32);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.n(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.n(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.n(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.n(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.n(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(21),r=n(77),a="void main() {gl_FragColor = vec4(0);}",o="#version 300 es\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}";function s(e,t){t=Array.isArray(t)?t:[t];var n=e.replace(/^\s+/,"").split(/\s+/),r=Object(i.a)(n,3),a=r[0],o=r[1],s=r[2];return t.includes(a)&&o&&s?{qualifier:a,type:o,name:s.split(";")[0]}:null}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(124),v=n(1),g=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.withParameters)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.withParameters)(e,{scissorTest:!0,scissor:l},function(){return Object(v.clear)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(v.setParameters)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,mousePosition:e.context.mousePosition,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.withParameters)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return O});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(132),v=n(20),g=n(60),p=n(92),m=n(58),y=n(59),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,O=void 0===w?b.minZoom:w,P=e.maxZoom,S=void 0===P?b.maxZoom:P,k=e.startPanPosition,j=e.startTarget,E=e.startRotationX,C=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:O,maxZoom:S})))._interactiveState={startPanPosition:k,startTarget:j,startRotationX:E,startRotationOrbit:C,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c=Object.keys(t),l=0;l=0&&n.modules.splice(i,1)}return"inject"in t&&(n.inject=Object.assign({},e.inject,t.inject)),n}var T=n(102),L=n(70),M=n(53),I={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return N(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return F(e,t)}},accessor:{validate:function(e,t){var n=z(e);return"function"===n||n===z(t.value)},equal:function(e,t,n){return"function"==typeof t||F(e,t)}},array:{validate:function(e,t){return t.optional&&!e||N(e)},equal:function(e,t,n){return n.compare?F(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function F(e,t){if(e===t)return!0;if(!N(e)||!N(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=Q,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):Object(M.b)(t)?this._resolveAsyncIterable(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){t=n._postProcessValue(e,t),n._setAsyncPropValue(e,t,r);var i=n.layer.props.onDataLoad;"data"===e&&i&&i(t,{propName:e,layer:n.layer})}).catch(function(e){return E.a.error(e)()})}},{key:"_resolveAsyncIterable",value:function(){var e=Z()(X.a.mark(function e(t,n){var i,r,a,o,s,u,c,l,f,h,d,v;return X.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"data"!==t&&this._setPropValue(t,n),(i=this.asyncProps[t]).pendingLoadCount++,r=i.pendingLoadCount,a=[],o=0,s=!0,u=!1,e.prev=8,l=K()(n);case 10:return e.next=12,l.next();case 12:return f=e.sent,s=f.done,e.next=16,f.value;case 16:if(h=e.sent,s){e.next=26;break}d=h,a=this._postProcessValue(t,d,a),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:o,endRow:a.length}]}),o=a.length,this._setAsyncPropValue(t,a,r);case 23:s=!0,e.next=10;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(8),u=!0,c=e.t0;case 32:if(e.prev=32,e.prev=33,s||null==l.return){e.next=37;break}return e.next=37,l.return();case 37:if(e.prev=37,!u){e.next=40;break}throw c;case 40:return e.finish(37);case 41:return e.finish(32);case 42:(v=this.layer.props.onDataLoad)&&v(a,{propName:t,layer:this.layer});case 44:case"end":return e.stop()}},e,this,[[8,28,32,42],[33,,37,41]])}));return function(t,n){return e.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(e,t,n){var i=(this.component?this.component.props:{}).dataTransform;return"data"!==e?t:i?i(t,n):n?n.concat(t):t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),$=0,ee=function(){function e(){o()(this,e),this.props=function(){for(var e=U(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=e.match(Oe);if(i&&i[0]){var r=function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object(_e.b)(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,i[0]);if(r)return r}var a=function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s.testText&&s.testText(t))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,t);return a||null}var Se=n(76),ke=function(e){return e&&e instanceof ArrayBuffer},je=function(e){return e&&e instanceof Buffer};function Ee(e){if(ke(e))return e;if(je(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){var t=e;return(new TextEncoder).encode(t).buffer}return Object(ge.a)(!1)}var Ce=new Map;function Ae(e,t,n){var i=function(e){var t=Ce.get(e);if(!t){var n=new Blob([e],{type:"application/javascript"});t=URL.createObjectURL(n),Ce.set(e,t)}return new Worker(t)}(e);n=function(e){null!==(e=Object.assign({},e)).log&&delete e.log;return e}(n);var r=function(e,t){return new Promise(function(n,r){i.onmessage=function(e){switch(e.data.type){case"done":n(e.data.result),i.terminate();break;case"error":r(new Error(e.data.message))}};var a=Ee(e);i.postMessage({arraybuffer:a,opts:t},[a])})};return t?r(t,n):r}function Te(e){this.wrapped=e}function Le(e){var t,n;function i(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Te;Promise.resolve(s?o.wrapped:o).then(function(e){s?i("next",e):r(a.done?"return":"normal",e)},function(e){i("throw",e)})}catch(e){r("throw",e)}}function r(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(a,o){var s={key:e,arg:r,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,i(e,r))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(Le.prototype[Symbol.asyncIterator]=function(){return this}),Le.prototype.next=function(e){return this._invoke("next",e)},Le.prototype.throw=function(e){return this._invoke("throw",e)},Le.prototype.return=function(e){return this._invoke("return",e)};n(151);var Me="Cannot convert supplied data type";function Ie(e){return se(e)?e.url:null}function Fe(e,t){if(t.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){var n=e.buffer||e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}throw new Error(Me)}function Re(e,t){return De.apply(this,arguments)}function De(){return(De=oe(re.a.mark(function e(t,n){var i;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(t=e.sent,i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=6;break}return e.abrupt("return",Fe(t,n));case 6:if(!ue(t)){e.next=10;break}return e.next=9,me(t);case 9:t=e.sent;case 10:if(!se(t)){e.next=19;break}if(!n.binary){e.next=17;break}return e.next=14,t.arrayBuffer();case 14:e.t0=e.sent,e.next=18;break;case 17:e.t0=t.text();case 18:return e.abrupt("return",e.t0);case 19:throw new Error(Me);case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ne(e,t,n,i){return ze.apply(this,arguments)}function ze(){return(ze=oe(re.a.mark(function e(t,n,i,r){return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=r||Ie(t),e.next=3,Re(t,n);case 3:if(t=e.sent,!n.parseTextSync||"string"!=typeof t){e.next=7;break}return i.dataType="text",e.abrupt("return",n.parseTextSync(t,i,r,n));case 7:if(!n.parseSync){e.next=9;break}return e.abrupt("return",n.parseSync(t,i,r,n));case 9:if(!n.parse){e.next=13;break}return e.next=12,n.parse(t,i,r,n);case 12:return e.abrupt("return",e.sent);case 13:if(!n.worker){e.next=17;break}return e.next=16,Ae(n.worker,t,i);case 16:return e.abrupt("return",e.sent);case 17:return e.abrupt("return",Object(ge.a)(!1));case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Be(e,t,n,i){return Ue.apply(this,arguments)}function Ue(){return(Ue=oe(re.a.mark(function e(t,n,i,r){var a,o;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||Object(_e.a)(n)||(r=i,i=n,n=null),a=ue(r)?r.name:r,n=n||Object(Se.a)(),o=Array.isArray(n)?Pe(a,t,n):n){e.next=6;break}return e.abrupt("return",null);case 6:return Object(_e.b)(o),i=we(i,o),e.next=10,Ne(t,o,i,a);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ve(){return(Ve=oe(re.a.mark(function e(t,n,i){var r,a,o;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||Object(_e.a)(n)||(i=n,n=null),r=ue(t)?t.name:t,n=n||Object(Se.a)(),a=Array.isArray(n)?Pe(r,null,n):n,i=we(i,a),!a||!a.loadAndParse){e.next=9;break}return e.next=8,a.loadAndParse(t,i);case 8:return e.abrupt("return",e.sent);case 9:if(!ue(o=t)&&"string"!=typeof o){e.next=14;break}return e.next=13,ye(t,i);case 13:o=e.sent;case 14:return e.abrupt("return",Be(o,n,i,r));case 15:case"end":return e.stop()}},e)}))).apply(this,arguments)}n.d(t,"a",function(){return Xe});var Ge=Object.freeze([]),We=new Uint8ClampedArray(0),He={data:{type:"data",value:Ge,async:!0},dataComparator:null,_dataDiff:{type:"function",value:function(e){return e&&e.__diff},compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:function(e,t){return function(e,t,n){return Ve.apply(this,arguments)}(e,t.layer.getLoadOptions())},compare:!1},updateTriggers:{},numInstances:void 0,visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:.8},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:g.a.LNGLAT,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:{},uniforms:{},extensions:[],framebuffer:null,animation:null,getPolygonOffset:{type:"function",value:function(e){return[0,100*-e.layerIndex]},compare:!1},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"color",value:[0,0,128,128]}},Xe=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,[{key:"toString",value:function(){var e=this.constructor.layerName||this.constructor.name;return"".concat(e,"({id: '").concat(this.props.id,"'})")}},{key:"setState",value:function(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}},{key:"setNeedsRedraw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{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:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(T.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(ne.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(T.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){E.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){E.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitPositions",value:function(){return this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return E.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.props.extensions[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=A(e,o.getShaders.call(this,o))}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return"RGB"===this.props.colorFormat&&(e=A(e,{defines:{COLOR_FORMAT_RGB:1}})),e}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();if(t.dataChanged&&n){var i=t.dataChanged;if(Array.isArray(i)){var r=!0,a=!1,o=void 0;try{for(var s,u=i[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;n.invalidateAll(c)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}else n.invalidateAll()}}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(E.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(E.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=this.getModels();if(r.length>0)for(var a=t.getChangedAttributes({clearChangedFlags:!0}),o=0,s=r.length;o2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=Object(b.c)(v),o[2*l+1]=Object(b.c)(g)),s[l]=1,l++}if(h)for(var m=0;m0&&void 0!==arguments[0]?arguments[0]:[];return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}}]),e}(),u=function(){function e(){Object(i.a)(this,e),this.shaderModules={},this.defaultShaderModules=[]}return Object(r.a)(e,[{key:"setDefaultShaderModules",value:function(e){this.defaultShaderModules=this.resolveModules(e)}},{key:"registerShaderModules",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof s)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof s)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new s(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"c",function(){return h}),n.d(t,"a",function(){return d});var c=new u;function l(e){c.setDefaultShaderModules(e)}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;c.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(c.defaultShaderModules),v(e=c.resolveModules(e))}function d(e){return c.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]=0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;ih&&d>=o&&(l=h),d>=u){f=h;break}}for(var v=l,g=f-l!==r.length,p=g&&t.slice(f),m=0;m=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(69),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},,function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=n(99),g=n(72),p={color:[255,255,255],intensity:1},m=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],y=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n.applyDefaultLights(),n}return h()(t,e),o()(t,[{key:"getParameters",value:function(e){var t=this.ambientLight,n=this.getProjectedPointLights(e);return{lightSources:{ambientLight:t,directionalLights:this.getProjectedDirectionalLights(e),pointLights:n}}}},{key:"applyDefaultLights",value:function(){var e=this.ambientLight,t=this.pointLights,n=this.directionalLights;e||0!==t.length||0!==n.length||(this.ambientLight=new d.AmbientLight(p),this.directionalLights.push(new v.a(m[0])),this.directionalLights.push(new v.a(m[1])))}},{key:"getProjectedPointLights",value:function(e){for(var t=[],n=0;n1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(72),v=n(1),g=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.withParameters)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new v.ClipSpace(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(v.clear)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(124).a),p=n(147);n.d(t,"a",function(){return m});var m=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(p.a)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=_(t),a=new g(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=_(t,r),s="".concat(n,"-").concat(a);return new g(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return y(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return b(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(17),r=n.n(i),a=n(27),o=n(90),s=n(32),u=n(35),c=n(24);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.n([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.m(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.overAlloc,i=void 0===n?2:n,a=t.poolSize,o=void 0===a?100:a;r()(this,e),this.overAlloc=i,this.poolSize=o,this._pool=[]}return o()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=void 0===i?1:i,a=n.type,o=n.padding,s=void 0===o?0:o,u=n.copy,c=void 0!==u&&u,l=a||e&&e.constructor||Float32Array,f=t*r+s;if(ArrayBuffer.isView(e)){if(f<=e.length)return e;if(f*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new l(e.buffer,0,f)}var h=this._allocate(l,f);return e&&c?h.set(e):h.fill(0,0,4),this._release(e),h}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,t){t=Math.max(Math.ceil(t*this.overAlloc),1);var n=this._pool,i=e.BYTES_PER_ELEMENT*t,r=n.findIndex(function(e){return e.byteLength>=i});return r>=0?new e(n.splice(r,1)[0],0,t):new e(t)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.poolSize&&t.shift()}}}]),e}();t.a=new s},function(e,t){function n(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise(function(r,a){var o=e.apply(t,i);function s(e){n(o,r,a,s,u,"next",e)}function u(e){n(o,r,a,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var i=n(5),r=n(6),a=n(11),o=n(10),s=n(12),u=n(28),c=n(21),l=n(44),f=n(24),h=n(18),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(137),p=n(41);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,O=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(f.l)(g);x=Math.max(.75,x);var S=Object(f.g)([d,l],P);S[2]=0;var k=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:O||1.01}),j=Object(f.f)({height:s,center:S,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:j,projectionMatrix:k}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=P,e.center=S,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,function(e,t,n){"use strict";(function(e){var t=n(69),i=n(96);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(100);n.d(t,"c",function(){return j}),n.d(t,"b",function(){return E}),n.d(t,"a",function(){return C});var w="\n\n".concat(x.a,"\n\n"),O=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),S={},k="precision highp float;\n\n";function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function E(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);S[e]=S[e]||{},S[e][o]=S[e][o]||{},Object(s.a)(!S[e][o][n],"Module injection already created"),S[e][o][n]={injection:i,order:a}}function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.vs,i=t.fs,r=Object(o.c)(t.modules||[]);return{gl:e,vs:A(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:A(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:T(r),modules:L(r)}}function A(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=void 0===o?[]:o,c=t.defines,l=void 0===c?{}:c,f=t.inject,h=void 0===f?{}:f,v=t.prologue,p=void 0===v||v,b=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var _=r===a.b,j=i.split("\n"),E=100,C="",A=i;0===j[0].indexOf("#version ")&&(E=300,C=j[0],A=j.slice(1).join("\n"));var T={};u.forEach(function(e){Object.assign(T,e.getDefines())}),Object.assign(T,l);var L=p?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(O[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(O[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(T),"\n").concat(_?"":k,"\n"):"".concat(C,"\n"),M=!1,I={},F={};for(var R in h){var D="string"==typeof h[R]?{injection:h[R],order:0}:h[R];R.match(/^(v|f)s:/)?"#"===R[3]?F[R]=[D]:I[R]=[D]:F[R]=[D]}var N=!0,z=!1,B=void 0;try{for(var U,V=u[Symbol.iterator]();!(N=(U=V.next()).done);N=!0){var G=U.value;switch(G.name){case"inject":M=!0;break;default:if(G.checkDeprecations(A,b),L+=G.getModuleSource(r,E),S[G.name]){var W=S[G.name][r];for(var H in W)H.match(/^(v|f)s:#/)?(F[H]=F[H]||[],F[H].push(W[H])):(I[H]=I[H]||[],I[H].push(W[H]))}}}}catch(e){z=!0,B=e}finally{try{N||null==V.return||V.return()}finally{if(z)throw B}}return L+=w,L+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,I),L+=A,L=Object(x.c)(L,r,F,M)}function T(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function L(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.a)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";var i=n(1),r=n(61),a=n(91),o=i.fp64.fp64ify,s=i.fp64.fp64ifyMatrix4,u=(t.a={name:"project64",dependencies:[r.a,i.fp64],vs:"\nconst vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);\n\nuniform vec2 project64_uScale;\nuniform vec2 project_uViewProjectionMatrixFP64[16];\nvoid mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) {\n\n#if defined(NVIDIA_FP64_WORKAROUND)\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64 * ONE);\n#else\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64);\n#endif\n out_val[1] = sub_fp64(PI_FP64,\n log_fp64(tan_fp64(sum_fp64(PI_4_FP64, radians_fp64(lnglat_fp64.zw) / 2.0))));\n return;\n}\n\nvoid project_position_fp64(vec4 position_fp64, out vec2 out_val[2]) {\n vec2 pos_fp64[2];\n mercatorProject_fp64(position_fp64, pos_fp64);\n vec2 x_fp64 = mul_fp64(pos_fp64[0], project64_uScale);\n vec2 y_fp64 = mul_fp64(pos_fp64[1], project64_uScale);\n out_val[0] = mul_fp64(x_fp64, WORLD_SCALE_FP64);\n out_val[1] = mul_fp64(y_fp64, WORLD_SCALE_FP64);\n\n return;\n}\n\nvoid project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val[2]) {\n vec4 position64xy = vec4(\n position.x, position64xyLow.x,\n position.y, position64xyLow.y);\n\n project_position_fp64(position64xy, out_val);\n}\n\nvec4 project_common_position_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n vec2 vertex_pos_clipspace[4];\n mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace,\n vertex_pos_clipspace);\n return vec4(\n vertex_pos_clipspace[0].x,\n vertex_pos_clipspace[1].x,\n vertex_pos_clipspace[2].x,\n vertex_pos_clipspace[3].x\n );\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec2 offset64[4];\n vec4_fp64(vec4(offset, 0.0), offset64);\n\n float z = project_size(position.z);\n vec2 projectedPosition64xy[2];\n project_position_fp64(position.xy, position64xyLow, projectedPosition64xy);\n\n vec2 commonPosition64[4];\n commonPosition64[0] = sum_fp64(offset64[0], projectedPosition64xy[0]);\n commonPosition64[1] = sum_fp64(offset64[1], projectedPosition64xy[1]);\n commonPosition64[2] = sum_fp64(offset64[2], vec2(z, 0.0));\n commonPosition64[3] = vec2(1.0, 0.0);\n\n commonPosition = vec4(projectedPosition64xy[0].x, projectedPosition64xy[1].x, z, 1.0);\n\n return project_common_position_to_clipspace_fp64(commonPosition64);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(\n position, position64xyLow, offset, commonPosition\n );\n}\nvec4 project_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n return project_common_position_to_clipspace_fp64(vertex_pos_modelspace);\n}\n",getUniforms:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return u({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},Object(a.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=s(t),r=o(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}}))},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;var n=Array.isArray(e)||ArrayBuffer.isView(e),i=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&i&&e.length===t.length){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,O=void 0!==w&&w,P=n.width,S=n.height,k=n.altitude,j=void 0===k?1.5:k;P=P||1,S=S||1,j=Math.max(.75,j);var E=Object(y.e)({width:P,height:S,pitch:d,altitude:j,nearZMultiplier:b,farZMultiplier:x}),C=E.fov,A=E.aspect,T=E.focalDistance,L=E.near,M=E.far,I=Object(y.f)({height:S,pitch:d,bearing:g,altitude:j}),F=Object.assign({},n,{width:P,height:S,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:O,fovyRadians:C,aspect:A,orthographicFocalDistance:T,near:L,far:M});return(e=l()(this,h()(t).call(this,F))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=j,e.orthographic=O,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);O.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(127),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(16),l=n(1),f=n(36),h=n.n(f),d=n(85),v=n(70),g=n(14),p=n(54),m=n(188),y=n(39),b=n(50),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,mousePosition:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l._ShaderCache({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(17),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(7),l=n.n(c),f=n(4),h=n.n(f),d=n(8),v=n.n(d),g=n(60),p=n(92),m=n(20),y=n(30);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(60),v=n(84),g=n(58),p=n(59),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(17),u=n.n(s),c=n(7),l=n.n(c),f=n(4),h=n.n(f),d=n(15),v=n.n(d),g=n(8),p=n.n(g),m=n(1),y=n(16),b=n(53),_=n(54),x=[],w=[[0,1/0]];var O=n(14),P=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(m.uid)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(m.hasFeature)(t,m.FEATURES.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a),this._setAccessor(e);for(var o=this.elementOffset,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,k,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"delete",value:function(){v()(h()(t.prototype),"delete",this).call(this),S.a.release(this.userData.allocatedValue)}},{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;if(t.update){Object(y.a)(Number.isFinite(e));var n=Math.max(e,1),i=E(this.type||5126),r=t.allocatedValue,a=t.updateRanges!==w;return this.constant=!1,this.value=S.a.allocate(r,n,{size:this.size,type:i,padding:this.elementOffset,copy:a}),this.buffer&&this.buffer.byteLength=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return n+e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(P);function E(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}function C(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.Buffer){var l=new Float32Array(r),f=t.getData({}),h=n.size,d=n.constant,v=d?n.getValue():n.getBuffer().getData({}),g=d?function(e,t){return c(v,t)}:function(e,t){return c(v.subarray(e,e+h),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.offset,a=void 0===r?0:r,o=e.getData,s=e.sourceLayout,u=e.targetLayout;if(!Array.isArray(u))return C({source:t,target:n,getData:o}),n;for(var c=a,l=a,f=o&&function(e,t){return o(e+l,t)},h=Math.min(s.length,u.length),d=0;d0),this.needsRedraw=!0;var n=Object.assign({},F,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return z});function D(){}var N={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;O.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;N.savedMessages=[],N.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;N.savedMessages&&N.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-N.timeStart),a="".concat(r,"ms");O.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=N.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;O.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}O.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),N.savedMessages=null}},z=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new R(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(N.onLog=t||D),void 0!==n&&(N.onUpdateStart=n||D),void 0!==i&&(N.onUpdate=i||D),void 0!==r&&(N.onUpdateEnd=r||D)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in N.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h]||t.attributes&&t.attributes[h])||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&N.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&O.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new j(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),O.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&N.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);N.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(53),p=n(62),m=n(85),y=n(1),b=n(156),_=n.n(b),x=n(14),w=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(y.uid)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;x.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity) / 255.0;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.0;\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getFillColor",defaultValue:P},instanceLineColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getLineColor",defaultValue:P},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=r.extensionsChanged;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new w({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new y.Model(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new y.Geometry({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);x.layerName="ScatterplotLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(17),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(7),l=n.n(c),f=n(4),h=n.n(f),d=n(8),v=n.n(d),g=n(20),p=n(60),m=n(92),y=n(105),b=n(44),_=85.05113,x=-85.05113;var w=n(16),O=n(58),P=n(59);n.d(t,"a",function(){return A});var S={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new O.a,transitionInterruption:P.a.BREAK},k={transitionDuration:0},j={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},E={pitch:0,bearing:0,altitude:1.5},C=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?E.bearing:c,d=n.pitch,v=void 0===d?E.pitch:d,g=n.altitude,p=void 0===g?E.altitude:g,m=n.maxZoom,y=void 0===m?j.maxZoom:m,b=n.minZoom,_=void 0===b?j.minZoom:b,x=n.maxPitch,O=void 0===x?j.maxPitch:x,P=n.minPitch,S=void 0===P?j.minPitch:P,k=n.startPanLngLat,C=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,L=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:O,minPitch:S})))._interactiveState={startPanLngLat:k,startZoomLngLat:C,startBearing:A,startPitch:T,startZoom:L},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,C,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return S}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,k,{isDragging:!0,isRotating:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(14),u=n(7),c=n.n(u),l=n(4),f=n.n(l),h=n(15),d=n.n(h),v=n(8),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(83).a),m=n(130),y=n(131),b=n(101),_=n(1);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h}),m=this.lastPostProcessEffect?this.screenBuffer:_.Framebuffer.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.Framebuffer(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.Framebuffer(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.Framebuffer.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(29),r=n(122);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(66))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(29);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(66))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(20),u=n(16),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){var i=n(173),r=n(174),a=n(175);e.exports=function(e){return i(e)||r(e)||a()}},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(34),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(83),p=n(1),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.withParameters)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";function i(e){return e&&"undefined"!=typeof window?window.devicePixelRatio:1}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(5),r=n(6),a=n(11),o=n(10),s=n(12),u=n(88),c=n(41),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return o()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"project",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{topLeft:!0},n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.contains(e,t))return r.project(e,t)}return null}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.containsPixel(e,t))return r.unproject(e)}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(u.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(d.b)(e,{filter:Boolean}).map(function(e){return e instanceof f.a?new l.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(c.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):h.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),g=n(111),p=n(98),m=function(){function e(){r()(this,e),this.effects=[],this._needsRedraw="Initial render",this.defaultLightingEffect=new p.a,this.needApplyDefaultLighting=!1}return o()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(c.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed")),this.checkLightingEffect()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){var e=this.effects;return this.needApplyDefaultLighting&&(e=this.effects.slice()).push(this.defaultLightingEffect),e}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}this.effects.length=0}},{key:"checkLightingEffect",value:function(){var e=!1,t=!0,n=!1,i=void 0;try{for(var r,a=this.effects[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){if(r.value instanceof p.a){e=!0;break}}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}this.needApplyDefaultLighting=!e}}]),e}(),y=n(72),b=n(120),_=n(1),x=n(131),w=n(130),O={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function P(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,d=-1,v=0,g=0;gf)v+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,d=v)}v+=4}}if(d>=0){var x=t[d+3]-1,w=t.slice(d,d+4),P=n[x];if(P){var S=P.decodePickingColor(w);return{pickedColor:w,pickedLayer:P,pickedObjectIndex:S}}h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return O}function S(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=k({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function k(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var j=function(){function e(t){r()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new w.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(x.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new _.Framebuffer(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-(r+1)*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=k({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(u.a)(r),Object(u.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(u.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,c=r.y,l=r.width,f=r.height,h=new Uint8Array(l*f*4);return Object(_.readPixelsToArray)(o,{sourceX:s,sourceY:c,sourceWidth:l,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight,o=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-o,c=Math.min(a,n+i+1)-s;return u<=0||c<=0?null:{x:o,y:s,width:u,height:c}}},{key:"callLayerPickingCallbacks",value:function(e,t){var n=[],i=this.pickingEvent;return e.forEach(function(e){if(e.layer){var r=!1;switch(t){case"hover":r=e.layer.onHover(e,i);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}}),n}}]),e}(),E=n(188),C=n(21),A=n(5),T=n(6),L=1,M=2,I=4,F={mousedown:L,mousemove:M,mouseup:I};var R,D,N=null;"undefined"!=typeof document&&(N=n(172),R=N.PointerEventInput,D=R.prototype.handler,R.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&M&&0===e.which&&(t=I),this.pressed&&(t&I&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var z=N;var B=z?[[z.Rotate,{enable:!1}],[z.Pinch,{enable:!1}],[z.Swipe,{enable:!1}],[z.Pan,{threshold:0,enable:!1}],[z.Press,{enable:!1}],[z.Tap,{event:"doubletap",taps:2,enable:!1}],[z.Tap,{event:"anytap",enable:!1}],[z.Tap,{enable:!1}]]:null,U={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},V={doubletap:["tap"]},G={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},W=["keydown","keyup"],H=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],X=["wheel","mousewheel","DOMMouseScroll"],q={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",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"},Z={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Y=n(79),K=-1!==Y.b.indexOf("firefox"),Q=X,J=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=Q.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!Y.a&&{passive:!1})})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;Y.c.WheelEvent&&(K&&e.deltaMode===Y.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=Y.c.devicePixelRatio),e.deltaMode===Y.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),$=H,ee=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=$.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),te=W,ne=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=te.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),ie=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(T.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),re=1,ae=2,oe=4,se={pointerdown:re,pointermove:ae,pointerup:oe,mousedown:re,mousemove:ae,mouseup:oe},ue=1,ce=2,le=3,fe=0,he=1,de=2,ve=1,ge=2,pe=4;var me=function(){function e(t){Object(A.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(T.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(A.a)(this,e),this.options=Object.assign({},ye,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(T.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||B}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(U).forEach(function(e){var n=t.manager.get(e);n&&U[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new J(e,this._onOtherEvent,{enable:!1}),this.moveInput=new ee(e,this._onOtherEvent,{enable:!1}),this.keyInput=new ne(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new ie(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(C.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=V[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=Z[e]||e,o=r.get(a);o||(o=new me(this),r.set(a,o),o.recognizerName=q[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=Z[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=G[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),_e=n(27);function xe(){}n.d(t,"a",function(){return Oe});var we={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:xe,onResize:xe,onViewStateChange:xe,onBeforeRender:xe,onAfterRender:xe,onLoad:xe,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Oe=function(){function e(t){r()(this,e),t=Object.assign({},we,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new E.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return o()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&h.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&h.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(u.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new _.AnimationLoop({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(_.createGLContext)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new g.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.callback=this.props.onHover,t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(_.trackContextState)(e,{enable:!0,copyState:!0})),Object(_.setParameters)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new be(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),_e.b)this.eventManager.on(t,this._onEvent);this.viewManager=new v({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(u.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new s.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new m,this.deckRenderer=new b.a(e),this.deckPicker=new j(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(_.setParameters)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),h.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=_e.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){this.stats.get("frameRate").timeEnd(),this.stats.get("frameRate").timeStart();var e=this.animationLoop.stats;this.stats.get("GPU Time").addTime(e.get("GPU Time").lastTiming),this.stats.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){this.metrics.fps=this.stats.get("frameRate").getHz(),this.metrics.setPropsTime=this.stats.get("setProps Time").time,this.metrics.updateAttributesTime=this.stats.get("Update Attributes").time,this.metrics.framesRedrawn=this.stats.get("Redraw Count").count,this.metrics.pickTime=this.stats.get("pickObject Time").time+this.stats.get("pickMultipleObjects Time").time+this.stats.get("pickObjects Time").time,this.metrics.pickCount=this.stats.get("Pick Count").count,this.metrics.gpuTime=this.stats.get("GPU Time").time,this.metrics.cpuTime=this.stats.get("CPU Time").time,this.metrics.gpuTimePerFrame=this.stats.get("GPU Time").getAverageTime(),this.metrics.cpuTimePerFrame=this.stats.get("CPU Time").getAverageTime();var e=_.lumaStats.get("Memory Usage");this.metrics.bufferMemory=e.get("Buffer Memory").count,this.metrics.textureMemory=e.get("Texture Memory").count,this.metrics.renderbufferMemory=e.get("Renderbuffer Memory").count,this.metrics.gpuMemory=e.get("GPU Memory").count}}]),e}();Oe.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(y.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Oe.defaultProps=we},function(e,t,n){"use strict";var i=n(0);t.a={enable:function(e,t){return e(Object(i.a)({},t,!0))},disable:function(e,t){return e(Object(i.a)({},t,!1))},pixelStorei:function(e,t,n){return e(Object(i.a)({},t,n))},hint:function(e,t,n){return e(Object(i.a)({},t,n))},bindFramebuffer:function(e,t,n){var r;switch(t){case 36160:return e((r={},Object(i.a)(r,36006,n),Object(i.a)(r,36010,n),r));case 36009:return e(Object(i.a)({},36006,n));case 36008:return e(Object(i.a)({},36010,n));default:return null}},blendColor:function(e,t,n,r,a){return e(Object(i.a)({},32773,new Float32Array([t,n,r,a])))},blendEquation:function(e,t){var n;return e((n={},Object(i.a)(n,32777,t),Object(i.a)(n,34877,t),n))},blendEquationSeparate:function(e,t,n){var r;return e((r={},Object(i.a)(r,32777,t),Object(i.a)(r,34877,n),r))},blendFunc:function(e,t,n){var r;return e((r={},Object(i.a)(r,32969,t),Object(i.a)(r,32968,n),Object(i.a)(r,32971,t),Object(i.a)(r,32970,n),r))},blendFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,32969,t),Object(i.a)(o,32968,n),Object(i.a)(o,32971,r),Object(i.a)(o,32970,a),o))},clearColor:function(e,t,n,r,a){return e(Object(i.a)({},3106,new Float32Array([t,n,r,a])))},clearDepth:function(e,t){return e(Object(i.a)({},2931,t))},clearStencil:function(e,t){return e(Object(i.a)({},2961,t))},colorMask:function(e,t,n,r,a){return e(Object(i.a)({},3107,[t,n,r,a]))},cullFace:function(e,t){return e(Object(i.a)({},2885,t))},depthFunc:function(e,t){return e(Object(i.a)({},2932,t))},depthRange:function(e,t,n){return e(Object(i.a)({},2928,new Float32Array([t,n])))},depthMask:function(e,t){return e(Object(i.a)({},2930,t))},frontFace:function(e,t){return e(Object(i.a)({},2886,t))},lineWidth:function(e,t){return e(Object(i.a)({},2849,t))},polygonOffset:function(e,t,n){var r;return e((r={},Object(i.a)(r,32824,t),Object(i.a)(r,10752,n),r))},sampleCoverage:function(e,t,n){var r;return e((r={},Object(i.a)(r,32938,t),Object(i.a)(r,32939,n),r))},scissor:function(e,t,n,r,a){return e(Object(i.a)({},3088,new Int32Array([t,n,r,a])))},stencilMask:function(e,t){var n;return e((n={},Object(i.a)(n,2968,t),Object(i.a)(n,36005,t),n))},stencilMaskSeparate:function(e,t,n){return e(Object(i.a)({},1028===t?2968:36005,n))},stencilFunc:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2962,t),Object(i.a)(a,2967,n),Object(i.a)(a,2963,r),Object(i.a)(a,34816,t),Object(i.a)(a,36003,n),Object(i.a)(a,36004,r),a))},stencilFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2962:34816,n),Object(i.a)(o,1028===t?2967:36003,r),Object(i.a)(o,1028===t?2963:36004,a),o))},stencilOp:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2964,t),Object(i.a)(a,2965,n),Object(i.a)(a,2966,r),Object(i.a)(a,34817,t),Object(i.a)(a,34818,n),Object(i.a)(a,34819,r),a))},stencilOpSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2964:34817,n),Object(i.a)(o,1028===t?2965:34818,r),Object(i.a)(o,1028===t?2966:34819,a),o))},viewport:function(e,t,n,r,a){return e(Object(i.a)({},2978,new Int32Array([t,n,r,a])))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(21),r=n(105),a=n(65);function o(e){var t=e.width,n=e.height,o=e.bounds,s=e.padding,u=void 0===s?0:s,c=e.offset,l=void 0===c?[0,0]:c,f=Object(i.a)(o,2),h=Object(i.a)(f[0],2),d=h[0],v=h[1],g=Object(i.a)(f[1],2),p=g[0],m=g[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else Object(a.a)(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var y=new r.a({width:t,height:n,longitude:0,latitude:0,zoom:0}),b=y.project([d,m]),_=y.project([p,v]),x=[Math.abs(_[0]-b[0]),Math.abs(_[1]-b[1])],w=[t-u.left-u.right-2*Math.abs(l[0]),n-u.top-u.bottom-2*Math.abs(l[1])];Object(a.a)(w[0]>0&&w[1]>0);var O=w[0]/x[0],P=w[1]/x[1],S=(u.right-u.left)/2/O,k=(u.bottom-u.top)/2/P,j=[(_[0]+b[0])/2+S,(_[1]+b[1])/2+k],E=y.unproject(j),C=y.zoom+Math.log2(Math.abs(Math.min(O,P)));return{longitude:E[0],latitude:E[1],zoom:C}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(21),r=n(5),a=n(6),o=n(20),s=n(30),u=n(35),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.g(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(42),v=n(39),g=n(138),p=n(81),m=n(114);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(3),r=n.n(i),a=n(2),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(42),v=n(39),g=n(81),p=n(84),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,O=e.zoom,P=void 0===O?0:O;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:P}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(3),r=n.n(i),a=n(4),o=n.n(a),s=n(2),u=n.n(s),c=n(7),l=n.n(c),f=n(8),h=n.n(f),d=n(42),v=n(39),g=n(81),p=n(115),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.CubeGeometry}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(117).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=n(53),g=n(134),p=n(86),m=n(75),y=n(94),b=n(93),_=new d.PhongMaterial,x={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags),i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(i&&Array.isArray(n.dataChanged)){var r=this.state.paths.slice(),a=n.dataChanged.map(function(e){return Object(b.a)({data:r,getIndex:function(e){return e.__source.index},dataRange:e,replace:t._getPaths(e)})});this.setState({paths:r,pathsDiff:a})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.data,i=t.getPolygon,r=[],a="XY"===t.positionFormat?2:3,o=e.startRow,s=e.endRow,u=Object(v.a)(n,o,s),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var g,p=c[Symbol.iterator]();!(f=(g=p.next()).done);f=!0){var m=g.value;l.index++;var b=y.c(i(m,l),a),_=b.positions,x=b.holeIndices;if(x)for(var w=0;w<=x.length;w++){var O=_.subarray(x[w-1]||0,x[w]||_.length);r.push(this.getSubLayerRow({path:O},m,l.index))}else r.push(this.getSubLayerRow({path:_},m,l.index))}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}return r}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e._dataDiff,i=e.stroked,r=e.filled,a=e.extruded,o=e.wireframe,s=e.elevationScale,u=e.transitions,c=e.positionFormat,l=this.props,f=l.lineWidthUnits,h=l.lineWidthScale,d=l.lineWidthMinPixels,v=l.lineWidthMaxPixels,g=l.lineJointRounded,y=l.lineMiterLimit,b=l.lineDashJustified,_=this.props,x=_.getFillColor,w=_.getLineColor,O=_.getLineWidth,P=_.getLineDashArray,S=_.getElevation,k=_.getPolygon,j=_.updateTriggers,E=_.material,C=this.state,A=C.paths,T=C.pathsDiff,L=this.getSubLayerClass("fill",p.a),M=this.getSubLayerClass("stroke",m.a),I=this.shouldRenderSubLayer("fill",A)&&new L({_dataDiff:n,extruded:a,elevationScale:s,filled:r,wireframe:o,getElevation:S,getFillColor:x,getLineColor:w,material:E,transitions:u},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:j.getPolygon,getElevation:j.getElevation,getFillColor:j.getFillColor,getLineColor:j.getLineColor}}),{data:t,positionFormat:c,getPolygon:k});return[!a&&I,!a&&i&&this.shouldRenderSubLayer("stroke",A)&&new M({_dataDiff:T&&function(){return T},widthUnits:f,widthScale:h,widthMinPixels:d,widthMaxPixels:v,rounded:g,miterLimit:y,dashJustified:b,transitions:u&&{getWidth:u.getLineWidth,getColor:u.getLineColor,getPath:u.getPolygon},getColor:this.getSubLayerAccessor(w),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:j.getLineWidth,getColor:j.getLineColor,getDashArray:j.getLineDashArray}}),{data:A,positionFormat:c,getPath:function(e){return e.path}}),a&&I]}}]),t}(g.a);w.layerName="PolygonLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(53),p=n(62),m=n(85),y=n(1);n.d(t,"a",function(){return _});var b={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},_=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.), target_commonspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},instanceColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new y.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new y.Geometry({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),O=u(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]),c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);_.layerName="LineLayer",_.defaultProps=b},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(53),p=n(62),m=n(85),y=n(1);n.d(t,"a",function(){return x});var b=[0,0,0,255],_={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:b},getTargetColor:{type:"accessor",value:b},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n vec2 source = project_position(geometry.worldPosition, instancePositions64Low.xy).xy;\n vec2 target = project_position(geometry.worldPositionAlt, instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getSourceColor",defaultValue:b},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getTargetColor",defaultValue:b},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new y.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new y.Geometry({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]);var O=u(x,d);c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);x.layerName="ArcLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(29),r=n(21),a={boolean:{validate:function(e,t){return!0}},number:{validateType:function(e,t){return"value"in t&&(!("max"in t)||Number.isFinite(t.max))&&(!("min"in t)||Number.isFinite(t.min))},validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}}};function o(e,t){switch(s(t)){case"object":return function(e){var t=e.type;(a[t]||{}).typeValidator;return e}(t=function(e,t){if(!("type"in t))return"value"in t?Object.assign({name:e,type:s(t.value)},t):{name:e,type:"object",value:t};return Object.assign({name:e},t)}(e,t));case"array":return function(e,t){if(/color/i.test(e)&&(3===t.length||4===t.length))return{name:e,type:"color",value:t};return{name:e,type:"array",value:t}}(e,t);case"boolean":return{name:e,type:"boolean",value:t};case"number":return function(e,t){var n=/radius|scale|width|height|pixel|size|miter/i.test(e)&&/^((?!scale).)*$/.test(e)?100:1;return{name:e,type:"number",max:Math.max(t,n),min:Math.min(t,0),value:t}}(e,t);case"function":return{name:e,type:"function",value:t};default:return{name:e,type:"unknown",value:t}}}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":null===e?"null":Object(i.a)(e)}function u(e){if(!e.normalized){if(e.normalized=!0,e.uniforms){var t=function(e){for(var t={},n={},i=0,a=Object.entries(e);i2&&void 0!==arguments[2]?arguments[2]:{},i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},r=n.startRow,a=void 0===r?0:r,o=n.endRow,s=void 0===o?e.length:o,u=a;u0;)t=t[0];return t&&Number.isFinite(t[0])}(a,o))switch(a){case"Point":s.push(n({geometry:e},i,r));break;case"MultiPoint":o.forEach(function(e){s.push(n({geometry:{type:"Point",coordinates:e}},i,r))});break;case"LineString":u.push(n({geometry:e},i,r));break;case"MultiLineString":o.forEach(function(e){u.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"Polygon":c.push(n({geometry:e},i,r)),o.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"MultiPolygon":o.forEach(function(e){c.push(n({geometry:{type:"Polygon",coordinates:e}},i,r)),e.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))})})}else b.a.warn("".concat(a," coordinates are malformed"))()}var w={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return k});var O=new p.PhongMaterial,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:O};function S(e){return e.geometry.coordinates}var k=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){var t=e.props,n=e.changeFlags;if(n.dataChanged){var i=function(e){if(Array.isArray(e))return e;switch(b.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return b.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data),r=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var a=this.state.features,o={},s={};for(var u in a)o[u]=a[u].slice(),s[u]=[];var c=!0,l=!1,f=void 0;try{for(var h,d=n.dataChanged[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value,g=_(i,r,v);for(var p in a)s[p].push(Object(y.a)({data:o[p],getIndex:function(e){return e.__source.index},dataRange:v,replace:g[p]}))}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}this.setState({features:o,featuresDiff:s})}else this.setState({features:_(i,r),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var e=this.state,t=e.features,n=e.featuresDiff,i=t.pointFeatures,r=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures,s=this.props,u=s.stroked,c=s.filled,l=s.extruded,f=s.wireframe,h=s.material,d=s.transitions,p=this.props,y=p.lineWidthUnits,b=p.lineWidthScale,_=p.lineWidthMinPixels,x=p.lineWidthMaxPixels,w=p.lineJointRounded,O=p.lineMiterLimit,P=p.pointRadiusScale,k=p.pointRadiusMinPixels,j=p.pointRadiusMaxPixels,E=p.elevationScale,C=p.lineDashJustified,A=this.props,T=A.getLineColor,L=A.getFillColor,M=A.getRadius,I=A.getLineWidth,F=A.getLineDashArray,R=A.getElevation,D=A.updateTriggers,N=this.getSubLayerClass("polygons-fill",m.a),z=this.getSubLayerClass("polygons-stroke",g.a),B=this.getSubLayerClass("line-strings",g.a),U=this.getSubLayerClass("points",v.a),V=this.shouldRenderSubLayer("polygons-fill",a)&&new N({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:l,elevationScale:E,filled:c,wireframe:f,material:h,getElevation:this.getSubLayerAccessor(R),getFillColor:this.getSubLayerAccessor(L),getLineColor:this.getSubLayerAccessor(T),transitions:d&&{getPolygon:d.geometry,getElevation:d.getElevation,getFillColor:d.getFillColor,getLineColor:d.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:D.getElevation,getFillColor:D.getFillColor,getLineColor:D.getLineColor}}),{data:a,getPolygon:S});return[!l&&V,!l&&u&&this.shouldRenderSubLayer("polygons-stroke",o)&&new z({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:C,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(F),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:o,getPath:S}),this.shouldRenderSubLayer("linestrings",r)&&new B({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:C,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(F),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:r,getPath:S}),this.shouldRenderSubLayer("points",i)&&new U({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:u,filled:c,radiusScale:P,radiusMinPixels:k,radiusMaxPixels:j,lineWidthUnits:y,lineWidthScale:b,lineWidthMinPixels:_,lineWidthMaxPixels:x,getFillColor:this.getSubLayerAccessor(L),getLineColor:this.getSubLayerAccessor(T),getRadius:this.getSubLayerAccessor(M),getLineWidth:this.getSubLayerAccessor(I),transitions:d&&{getPosition:d.geometry,getFillColor:d.getFillColor,getLineColor:d.getLineColor,getRadius:d.getRadius,getLineWidth:d.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:D.getFillColor,getLineColor:D.getLineColor,getRadius:D.getRadius,getLineWidth:D.getLineWidth}}),{data:i,getPosition:S}),l&&V]}}]),t}(d.a);k.layerName="GeoJsonLayer",k.defaultProps=P},function(e,t,n){"use strict";(function(e){var i=n(29);t.a="undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==Object(i.a)(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(66))},function(e,t,n){var i=n(171);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";(function(e,i){n.d(t,"a",function(){return a});var r=n(128),a="object"!==(void 0===e?"undefined":Object(r.a)(e))||"[object process]"!==String(e)||e.browser;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document}).call(this,n(66),n(56))},function(e,t){e.exports=function(e){var t;if("function"==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(33),a=n.n(r),o=n(80);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(66))},function(e,t){},function(e,t){},function(e,t,n){var i=n(9);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===S(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(O(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),O(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),O(i),O(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details - */r=[],void 0===(a="function"==typeof(i=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},i={};function r(e,t){var r,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=i[e])?a:(r=o(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(a=n[e])?a:(r=o(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:v;if(t){if(e<0)return g;if(e>=f)return _}else{if(e<=-h)return x;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,n,i){return new e(t,n,i)}e.fromInt=r,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(s(n,8)),o=v,c=0;c>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(p)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,v=0;return d+=(v+=a+(65535&e.low))>>>16,h+=(d+=r+l)>>>16,f+=(h+=i+u)>>>16,f+=n+s,o((d&=65535)<<16|(v&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(t(e)||(e=c(e)),e.isZero())return v;if(this.eq(x))return e.isOdd()?x:v;if(e.eq(x))return this.isOdd()?x:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,y=0;return m+=(y+=s*h)>>>16,p+=(m+=r*h)>>>16,m&=65535,p+=(m+=s*f)>>>16,g+=(p+=i*h)>>>16,p&=65535,g+=(p+=r*f)>>>16,p&=65535,g+=(p+=s*l)>>>16,g+=n*h+i*f+r*l+s*u,o((m&=65535)<<16|(y&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:v;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;r=g}else{if(this.eq(x))return e.eq(p)||e.eq(y)?x:e.eq(x)?p:(n=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?p:y:(i=this.sub(e.mul(n)),r=n.add(i.div(e)));if(e.eq(x))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=v}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(n),f=l.mul(e);f.isNegative()||f.gt(i);)f=(l=a(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=p),r=r.add(l),i=i.sub(f)}return r},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;return e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?i.apply(t,r):i)||(e.exports=a)},function(e,t){},function(e,t,n){const i=n(160);Object.assign(i,n(54),n(182),n(183),n(185),n(181),n(186),n(184)),e.exports=i},,function(e,t,n){(function(t){const i=n(1),r=n(20),a=n(177).default,o="undefined"==typeof window?t:window;o.deck=o.deck||{},o.luma=o.luma||{},Object.assign(o.deck,r,{DeckGL:a}),Object.assign(o.luma,i),e.exports=o.deck}).call(this,n(53))},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){var i=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(165),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=_;var f="suspendedStart",h="suspendedYield",d="executing",v="completed",g={},p={};p[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==i&&r.call(y,o)&&(p=y);var b=O.prototype=w.prototype=Object.create(p);P.prototype=b.constructor=O,O.constructor=P,O[u]=P.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===P||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},k(S.prototype),S.prototype[s]=function(){return this},l.AsyncIterator=S,l.async=function(e,t,n,i){var r=new S(_(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},k(b),b[u]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=T,A.prototype={constructor:A,reset:function(e){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(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:T(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function _(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new A(i||[]);return a._invoke=function(e,t,n){var i=f;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return M()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=j(o,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function P(){}function O(){}function k(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function S(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function j(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,j(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; + */r=[],void 0===(a="function"==typeof(i=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},i={};function r(e,t){var r,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=i[e])?a:(r=o(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(a=n[e])?a:(r=o(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:v;if(t){if(e<0)return g;if(e>=f)return _}else{if(e<=-h)return x;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,n,i){return new e(t,n,i)}e.fromInt=r,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(s(n,8)),o=v,c=0;c>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(p)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,v=0;return d+=(v+=a+(65535&e.low))>>>16,h+=(d+=r+l)>>>16,f+=(h+=i+u)>>>16,f+=n+s,o((d&=65535)<<16|(v&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(t(e)||(e=c(e)),e.isZero())return v;if(this.eq(x))return e.isOdd()?x:v;if(e.eq(x))return this.isOdd()?x:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,y=0;return m+=(y+=s*h)>>>16,p+=(m+=r*h)>>>16,m&=65535,p+=(m+=s*f)>>>16,g+=(p+=i*h)>>>16,p&=65535,g+=(p+=r*f)>>>16,p&=65535,g+=(p+=s*l)>>>16,g+=n*h+i*f+r*l+s*u,o((m&=65535)<<16|(y&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:v;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;r=g}else{if(this.eq(x))return e.eq(p)||e.eq(y)?x:e.eq(x)?p:(n=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?p:y:(i=this.sub(e.mul(n)),r=n.add(i.div(e)));if(e.eq(x))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=v}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(n),f=l.mul(e);f.isNegative()||f.gt(i);)f=(l=a(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=p),r=r.add(l),i=i.sub(f)}return r},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;return e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?i.apply(t,r):i)||(e.exports=a)},function(e,t,n){const i=n(162);Object.assign(i,n(57),n(181),n(183),n(185),n(182),n(186),n(184)),e.exports=i},,function(e,t,n){(function(t){const i=n(1),r=n(19),a=n(178).default,o="undefined"==typeof window?t:window;o.deck=o.deck||{},o.luma=o.luma||{},Object.assign(o.deck,r,{DeckGL:a}),Object.assign(o.luma,i),e.exports=o.deck}).call(this,n(56))},function(e,t){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var i=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(166),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=_;var f="suspendedStart",h="suspendedYield",d="executing",v="completed",g={},p={};p[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==i&&r.call(y,o)&&(p=y);var b=P.prototype=w.prototype=Object.create(p);O.prototype=b.constructor=P,P.constructor=O,P[u]=O.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===O||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,P):(e.__proto__=P,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},S(k.prototype),k.prototype[s]=function(){return this},l.AsyncIterator=k,l.async=function(e,t,n,i){var r=new k(_(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},S(b),b[u]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=T,A.prototype={constructor:A,reset:function(e){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(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;C(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:T(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function _(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new A(i||[]);return a._invoke=function(e,t,n){var i=f;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return L()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=j(o,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function O(){}function P(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function k(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function j(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,j(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; /*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * @@ -14,4 +14,4 @@ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ -!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),f="function",h=Math.round,d=Math.abs,v=Date.now;function g(e,t,n){return setTimeout(w(e,n),t)}function p(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function L(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==B&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(f=o.pointers,h=i,oe(h[0],h[1],$)/oe(f[0],f[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>z||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,f=re(u,c,l);i=f.x,r=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var f,h;var g=e.element;j(t.srcEvent.target,g)&&(g=t.srcEvent.target);t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?q:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(F(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(F(this.element),this.evWin,this.domHandler)}};var ue={mousedown:B,mousemove:U,mouseup:V},ce="mousedown",le="mousemove mouseup";function fe(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(fe,ee,{handler:function(e){var t=ue[e.type];t&B&&0===e.button&&(this.pressed=!0),t&U&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:B,pointermove:U,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",ge="pointermove pointerup pointercancel";function pe(){this.evEl=ve,this.evWin=ge,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",ge="MSPointerMove MSPointerUp MSPointerCancel"),x(pe,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=he[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=A(t,e.pointerId,"pointerId");r&B&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:B,touchmove:U,touchend:V,touchcancel:G},ye="touchstart",be="touchstart touchmove touchend touchcancel";function _e(){this.evTarget=ye,this.evWin=be,this.started=!1,ee.apply(this,arguments)}x(_e,ee,{handler:function(e){var t=me[e.type];if(t===B&&(this.started=!0),this.started){var n=function(e,t){var n=T(e.touches),i=T(e.changedTouches);t&(V|G)&&(n=M(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:B,touchmove:U,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Pe(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Pe,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=T(e.touches),i=this.targetIds;if(t&(B|U)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=T(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return j(e.target,u)}),t===B)for(r=0;r-1&&i.splice(e,1)},Oe)}}x(Se,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,je.call(this,t)):e&(V|G)&&je.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Be&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return qe.prototype.attrTest.call(this,e)&&(this.state&De||!(this.state&De)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ye,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&De)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Qe,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&B)this.reset(),this._timer=g(function(){this.state=Ue,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ue;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ue&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Ke,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&De)}}),x(Je,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|Q,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|Q)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&Q&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(179);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var i=function(e){"use strict";var t,n=Object.prototype,i=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function u(e,t,n,i){var r=t&&t.prototype instanceof g?t:g,a=Object.create(r.prototype),o=new j(i||[]);return a._invoke=function(e,t,n){var i=l;return function(r,a){if(i===h)throw new Error("Generator is already running");if(i===d){if("throw"===r)throw a;return E()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=O(o,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===l)throw i=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=h;var u=c(e,t,n);if("normal"===u.type){if(i=n.done?d:f,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=d,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",f="suspendedYield",h="executing",d="completed",v={};function g(){}function p(){}function m(){}var y={};y[a]=function(){return this};var b=Object.getPrototypeOf,_=b&&b(b(C([])));_&&_!==n&&i.call(_,a)&&(y=_);var x=m.prototype=g.prototype=Object.create(y);function w(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function P(e){var t;this._invoke=function(n,r){function a(){return new Promise(function(t,a){!function t(n,r,a,o){var s=c(e[n],e,r);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(l).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,r,t,a)})}return t=t?t.then(a,a):a()}}function O(e,n){var i=e.iterator[n.method];if(i===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=c(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,v;var a=r.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function C(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function n(){for(;++r=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;S(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:C(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(70),p=n(79),m=n(1),y=n(15),b=n.n(y);function _(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function x(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var a=e.apply(t,n);function o(e){_(a,i,r,o,s,"next",e)}function s(e){_(a,i,r,o,s,"throw",e)}o(void 0)})}}var w=n(89);function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{}),!X(t)){e.next=4;break}return e.abrupt("return",Promise.resolve(W(t)));case 4:if(!q(t)){e.next=6;break}return e.abrupt("return",new Promise(function(e,i){n=O({},new URL(t),n),(t.startsWith("https:")?L.a.request:T.a.request)(t,function(t){return G(t).then(e,i)})}));case 6:return i=F.a.promisify(E.a.readFile),e.next=9,i(t,n);case 9:return r=e.sent,e.abrupt("return",r instanceof Buffer?B(r):r);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ee(e,t){return te.apply(this,arguments)}function te(){return(te=x(b.a.mark(function e(t,n){return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!X(t)){e.next=2;break}return e.abrupt("return",W(t));case 2:if(q(t)){e.next=4;break}return e.abrupt("return",E.a.createReadStream(t,n));case 4:return e.abrupt("return",new Promise(function(e,i){n=O({},new URL(t),n),(t.startsWith("https:")?L.a.request:T.a.request)(t,function(t){return e(t)})}));case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e=Object.assign({},H,e)).responseType=e.responseType||e.dataType,E.a&&(e.encoding=e.encoding||("text"===e.dataType?"utf8":null)),e}function ie(e,t){return re.apply(this,arguments)}function re(){return(re=x(b.a.mark(function e(t,n){return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}var ae="",oe={};function se(e){for(var t in oe)if(e.startsWith(t)){var n=oe[t];return e.replace(t,n)}return e+=ae}function ue(e,t){return ce.apply(this,arguments)}function ce(){return(ce=x(b.a.mark(function e(t,n){var i;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=se(t),i=w.a?ie:Q,e.abrupt("return",i(t,n));case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function le(e){return!!e&&(Array.isArray(e)&&(e=e[0]),e.parseTextSync||e.parseSync||e.parse||e.loadAndParse||e.parseStream||e.parseInBatches||e.worker)}function fe(e){var t;return R(le(e)),Array.isArray(e)&&(t=(e=e[0])[1],e=O({},e,{options:O({},e.options,{options:t})})),e.extension&&(e.extensions=e.extensions||[e.extension],delete e.extension),Array.isArray(e.extensions)||(e.extensions=[e.extensions]),R(e.extensions&&e.extensions.length>0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}var he=/[^\.]+$/;function de(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=e.match(he);if(i&&i[0]){var r=function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;fe(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,i[0]);if(r)return r}var a=function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s.testText&&s.testText(t))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,t);return a||null}var ve=function(){function e(){k(this,e)}return j(e,[{key:"log",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}}]),e}(),ge={};function pe(){return Object.values(ge)}var me=new Map;function ye(e,t,n){var i=function(e){var t=me.get(e);if(!t){var n=new Blob([e],{type:"application/javascript"});t=URL.createObjectURL(n),me.set(e,t)}return new Worker(t)}(e);n=function(e){null!==(e=Object.assign({},e)).log&&delete e.log;return e}(n);var r=function(e,t){return new Promise(function(n,r){i.onmessage=function(e){switch(e.data.type){case"done":n(e.data.result),i.terminate();break;case"error":r(new Error(e.data.message))}};var a=B(e);i.postMessage({arraybuffer:a,opts:t},[a])})};return t?r(t,n):r}n(123);var be=function(e){return"undefined"!=typeof window&&e instanceof window.Response||e.arrayBuffer&&e.json&&e.body},_e="Cannot convert supplied data type";function xe(e){return be(e)?e.url:null}function we(e,t){if(t.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){var n=e.buffer||e;return t.text&&!t.binary?new N.TextDecoder("utf8").decode(n):n}throw new Error(_e)}function Pe(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=x(b.a.mark(function e(t,n){var i;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(t=e.sent,i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=6;break}return e.abrupt("return",we(t,n));case 6:if(!be(t)){e.next=15;break}if(!n.binary){e.next=13;break}return e.next=10,t.arrayBuffer();case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0=t.text();case 14:return e.abrupt("return",e.t0);case 15:throw new Error(_e);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ke(e,t){return Se.apply(this,arguments)}function Se(){return(Se=x(b.a.mark(function e(t,n){var i,r,a=arguments;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>2&&void 0!==a[2]?a[2]:{},r=(r=a.length>3?a[3]:void 0)||xe(t),e.next=5,Pe(t,n);case 5:if(t=e.sent,!n.parseTextSync||"string"!=typeof t){e.next=9;break}return i.dataType="text",e.abrupt("return",n.parseTextSync(t,i,r,n));case 9:if(!n.parseSync){e.next=11;break}return e.abrupt("return",n.parseSync(t,i,r,n));case 11:if(!n.parse){e.next=15;break}return e.next=14,n.parse(t,i,r,n);case 14:return e.abrupt("return",e.sent);case 15:if(!n.worker){e.next=19;break}return e.next=18,ye(n.worker,t,i);case 18:return e.abrupt("return",e.sent);case 19:return e.abrupt("return",R(!1));case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function je(e,t,n,i){return Ce.apply(this,arguments)}function Ce(){return(Ce=x(b.a.mark(function e(t,n,i,r){var a;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||le(n)||(r=i,i=n,n=null),n=n||pe(),a=Array.isArray(n)?de(r,t,n):n){e.next=5;break}return e.abrupt("return",null);case 5:return fe(a),i=Ee(i,a),e.next=9,ke(t,a,i,r);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ee(e,t){return null===(e=Object.assign({},t.DEFAULT_OPTIONS,t.options,e,{dataType:"arraybuffer"})).log&&(e.log=new ve),"log"in e||(e.log=console),e}function Ae(e,t,n){return Te.apply(this,arguments)}function Te(){return(Te=x(b.a.mark(function e(t,n,i){var r,a;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||le(n)||(i=n,n=null),n=n||pe(),!(r=Array.isArray(n)?de(t,null,n):n)||!r.loadAndParse){e.next=7;break}return e.next=6,r.loadAndParse(t,i);case 6:return e.abrupt("return",e.sent);case 7:return e.next=9,ue(t,i);case 9:return a=e.sent,e.abrupt("return",je(a,n,i,t));case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Me=n(189),Le=Math.PI/180,Ie=new Float32Array(16),Fe=new Float32Array(12);function Re(e,t,n){var i=t[0]*Le,r=t[1]*Le,a=t[2]*Le,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),f=Math.cos(r),h=n[0],d=n[1],v=n[2];e[0]=h*f*l,e[1]=h*u*l,e[2]=h*-s,e[3]=d*(-u*c+f*s*o),e[4]=d*(f*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+f*s*c),e[7]=v*(-f*o+u*s*c),e[8]=v*l*c}function Ne(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var De={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),f=l&&16===c.length,h=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),p=f||!l&&Boolean(c(a[0]));e.constant=p?f:d&&h&&v;var m=e.value;if(e.constant){var y;if(p)Ie.set(c),y=Ne(Ie);else Re(y=Fe,o,s),y.set(u,9);e.value=new Float32Array(y)}else{var b=n*e.size,_=Object(g.a)(a,n,i),x=_.iterable,w=_.objectInfo,P=!0,O=!1,k=void 0;try{for(var S,j=x[Symbol.iterator]();!(P=(S=j.next()).done);P=!0){var C=S.value;w.index++;var E=void 0;if(p)Ie.set(f?c:c(C,w)),E=Ne(Ie);else Re(E=Fe,d?o:o(C,w),h?s:s(C,w)),E.set(v?u:u(C,w),9);m[b++]=E[0],m[b++]=E[1],m[b++]=E[2],m[b++]=E[3],m[b++]=E[4],m[b++]=E[5],m[b++]=E[6],m[b++]=E[7],m[b++]=E[8],m[b++]=E[9],m[b++]=E[10],m[b++]=E[11]}}catch(e){O=!0,k=e}finally{try{P||null==j.return||j.return()}finally{if(O)throw k}}}}},ze=m.fp64.fp64LowPart;function Be(e,t,n){return t instanceof m.Texture2D?t:new m.Texture2D(e,Object.assign({data:t},n))}function Ue(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function Ve(e){if(e.attributes)return Ue(e.attributes),e instanceof m.Geometry?e:new m.Geometry(e);if(e.positions||e.POSITION)return Ue(e),new m.Geometry({attributes:e});throw Error("Invalid mesh")}var Ge=new m.PhongMaterial,We={fetch:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){return"mesh"===t.propName?Ae(e):fetch(e).then(function(e){return e.json()})}),mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},fp64:!1,wireframe:!1,material:Ge,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},He=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=this.use64bitProjection()?"project64":"project32",t=Object(m.isWebGL2)(this.context.gl);return{vs:t?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n\n picking_setPickingColor(instancePickingColors);\n}\n",fs:t?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor / 255., color.a);\n fragColor = picking_filterHighlightColor(fragColor);\n fragColor = picking_filterPickingColor(fragColor);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor / 255., color.a);\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n",modules:[e,"phong-lighting","picking"]}}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{transition:!0,size:4,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:De}),this.setState({emptyTexture:new m.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||n.fp64!==i.fp64){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new m.Model(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:Ve(e),isInstanced:!0,shaderCache:this.context.shaderCache}));return this.state.texture?t.setUniforms({sampler:this.state.texture,hasTexture:1}):t.setUniforms({sampler:this.state.emptyTexture,hasTexture:0}),t}},{key:"setTexture",value:function(e){var t=this,n=this.context.gl,i=this.state.emptyTexture;this.state.texture&&this.state.texture.delete(),e?function(e,t,n){return"string"==typeof t?Object(Me.a)(t).then(function(t){return Be(e,t,n)}).catch(function(e){throw new Error("Could not load texture from ".concat(t,": ").concat(e))}):new Promise(function(i){return i(Be(e,t,n))})}(n,e).then(function(e){t.setState({texture:e}),t.state.model&&t.state.model.setUniforms({sampler:t.state.texture,hasTexture:1})}):(this.setState({texture:null}),this.state.model&&this.state.model.setUniforms({sampler:i,hasTexture:0}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=s(b,h);u[c++]=ze(_[0]),u[c++]=ze(_[1])}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}else e.value=new Float32Array(2)}}]),t}(p.a);He.layerName="SimpleMeshLayer",He.defaultProps=We;var Xe=m.fp64.fp64LowPart,qe=[255,255,255,255],Ze={scenegraph:{type:"object",value:null,async:!0},fetch:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){var n=t.propName,i=t.layer;return"scenegraph"===n?Ae(e,i.getLoadOptions()):fetch(e).then(function(e){return e.json()})}),getScene:function(e){return e&&e.scenes?e.scenes[0]:e},getAnimator:function(e){return e&&e.animator},sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:qe},_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:[]}},Ye=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{size:4,accessor:"getColor",defaultValue:qe,transition:!0},instanceModelMatrix:De})}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=s(b,h);u[c++]=Xe(_[0]),u[c++]=Xe(_[1])}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}else e.value=new Float32Array(2)}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;if(n.scenegraph!==i.scenegraph){var r=n.getScene(n.scenegraph),a=n.getAnimator(n.scenegraph);r instanceof m.ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,a,n._animations),this.setState({scenegraph:r,animator:a})):null!==r&&m.log.warn("invalid scenegraph:",r)()}else n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){this._deleteScenegraph()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&re?t:e}function M(e,t){return t2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(j.isWebGL2)(t)&&Object(j.hasFeatures)(this.gl,j.FEATURES.BLEND_EQUATION_MINMAX,j.FEATURES.COLOR_ATTACHMENT_RGBA32F,j.FEATURES.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.info("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,q){var r=q[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},F,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,I)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||U,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},B,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,f=0;f=0&&O=0&&k0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new j.Model(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n pos = floor(pos / cellSize);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?["fp64","project64"]:["project32"],shaderCache:n,vertexCount:0,drawMode:0})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new j.Model(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:["fp64"],shaderCache:t,vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new j.Transform(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,h=a.weights,d=[o,s],v={blend:!0,depthTest:!1,blendFunc:[1,1]},g={viewport:n},p={windowSize:u,cellSize:t,gridSize:d,uProjectionMatrix:i,uProjectionMatrixFP64:H(i),projectPoints:r};for(var m in h){var y=h[m],b=y.needMin,_=y.needMax,x=b&&_&&h[m].combineMaxMin;this.renderToWeightsTexture({id:m,parameters:v,moduleSettings:g,uniforms:p,gridSize:d}),x?this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:D}),gridSize:d,minOrMaxFb:c[m],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:x}):(b&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:R}),gridSize:d,minOrMaxFb:l[m],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:x}),_&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:N}),gridSize:d,minOrMaxFb:f[m],combineMaxMin:x}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(j.withParameters)(c,s,function(){c.clear(16384)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,f=this.gl,h=this.gridAggregationModel,d=l[t].operation;s[t].bind(),f.viewport(0,0,a[0],a[1]);var v=d===E.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(j.withParameters)(f,{clearColor:v},function(){f.clear(16384)});var g={weights:c[t]};if(h.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:g}),s[t].unbind(),d===E.MEAN){var p=this.state,m=p.meanTextures,y=p.textures,b={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(b).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(O()({},36064,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,f=t.equations,h=t.weights,d={width:n,height:i};for(var v in h){var g=h[v],p=g.needMin,m=g.needMax,y=g.combineMaxMin,b=g.operation;r[v]=h[v].aggregationTexture||r[v]||V(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var _=r[v];b===E.MEAN&&(l[v]=l[v]||V(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),_=l[v]),a[v]?a[v].attach(O()({},36064,_)):a[v]=G(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:_}),a[v].resize(d),f[v]=z[b],(p||m)&&(p&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=V(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=G(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(p&&(s[v]||(c["".concat(v,"-min")]=V(this.gl,{id:"".concat(v,"-minTex")}),s[v]=G(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=V(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=G(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof j.Buffer?n[o].setData(u):(a["".concat(o,"-buffer")]=new j.Buffer(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof j.Buffer),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],e}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:E.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new Z(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&this._updateAggregation(n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||Q,o=this.props.maxColor||K,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,f=u.cellScale,h=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,g={minColor:a,maxColor:o,cellScale:f,colorRange:d,colorDomain:s,shouldUseMinMax:h};Object(j.isWebGL2)(n)?l.bind({target:35345}):g.maxWeight=v,t=Object.assign(g,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(j.isWebGL2)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=Z.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new j.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new j.Geometry({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new j.Buffer(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=Y(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(p.a)(t),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var m=v.value;l.index++;var y=n(m,l),b=i(m,l),_=l.index;a[2*_]=y[0],a[2*_+1]=y[1],Array.isArray(b)?(o[3*_]=b[0],o[3*_+1]=b[1],o[3*_+2]=b[2]):o[3*_]=b}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}s.color.values=o,this.setState({positions:a})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(j.isWebGL2)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager();(e.cellSizeChanged||e.viewportChanged)&&(this._updateGridParams(),t.invalidateAll());var n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=E[this.props.aggregation.toUpperCase()]||E.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var f=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),h=f.color.maxData&&Number.isFinite(f.color.maxData[0])?f.color.maxData[0]:0;this.setState({maxWeight:h}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if(J.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange,Float32Array,255)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,f=c>l?l:0;r.cellScale=new Float32Array([(c-f)/o*2,-(c-f)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new j.Buffer(r,{byteLength:u,accessor:{size:4,type:5126,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(b.a);ee.layerName="ScreenGridLayer",ee.defaultProps=$;var te=n(126),ne=n(140),ie=function(e){return e.length},re=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ie;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=S()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,O()({},t.i,t))},{})}}]),e}();function ae(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function oe(e,t){return function(n){return ae(e,t,n)}}function se(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var ue=6378e3;function ce(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(p.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,f=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}var g=function(e,t){var n=(o=e,o/ue*(180/Math.PI)),i=(r=t,a=e,a/ue*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(g.xOffset<=0||g.yOffset<=0)return{gridHash:{},gridOffset:g};var m={};u.index=-1;var y=!0,b=!1,_=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var P=x.value;u.index++;var O=i(P,u),k=S()(O,2),j=k[0],C=k[1];if(Number.isFinite(C)&&Number.isFinite(j)){var E=Math.floor((C+90)/g.yOffset),A=Math.floor((j+180)/g.xOffset),T="".concat(E,"-").concat(A);m[T]=m[T]||{count:0,points:[]},m[T].count+=1,m[T].points.push(P)}}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}return{gridHash:m,gridOffset:g}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function le(){}var fe={colorDomain:null,colorRange:_,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:le,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:le,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new j.PhongMaterial},he=["getColorValue","colorAggregation","getColorWeight"],de=["getElevationValue","elevationAggregation","getElevationWeight"],ve=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:le,elevationScaleFunc:le,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=ce(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new re(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new re(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=oe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=se(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.fp64,i=e.extruded,r=e.cellSize,a=e.coverage,o=e.material,s=e.transitions;return new(this.getSubLayerClass("grid-cell",ne.a))({fp64:n,cellSize:r,coverage:a,material:o,elevationScale:t,extruded:i,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:s&&{getFillColor:s.getColorValue||s.getColorWeight,getElevation:s.getElevationValue||s.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(te.a);ve.layerName="CPUGridLayer",ve.defaultProps=fe;var ge=n(107),pe=Math.PI/3,me=[0,pe,2*pe,3*pe,4*pe,5*pe];function ye(e){return e[0]}function be(e){return e[1]}var _e=function(){var e,t,n,i=0,r=0,a=1,o=1,s=ye,u=be;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var g=l-d,p=d+(ly*y+b*b&&(d=p+(1&h?1:-1)/2,h=m)}var _=d+"-"+h,x=r[_];x?x.push(c):(a.push(x=r[_]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return a}function l(e){var t=0,n=0;return me.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new re(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new re(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=oe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=se(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.fp64,o=e.transitions,s=this.state,u=s.angle,c=s.radius;return new(this.getSubLayerClass("hexagon-cell",ge.a))({fp64:a,radius:c,diskResolution:6,elevationScale:t,angle:u,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(te.a);ke.layerName="HexagonLayer",ke.defaultProps=we;var Se,je=n(22),Ce=n(143),Ee=n(80),Ae={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Te=[Ae.W,Ae.SW,Ae.S],Me=[Ae.S,Ae.SE,Ae.E],Le=[Ae.E,Ae.NE,Ae.N],Ie=[Ae.NW,Ae.W,Ae.N],Fe=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],Re=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Ne=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],De=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],ze=[Ae.W,Ae.SW,Ae.SE,Ae.E],Be=[Ae.S,Ae.SE,Ae.NE,Ae.N],Ue=[Ae.NW,Ae.W,Ae.E,Ae.NE],Ve=[Ae.NW,Ae.SW,Ae.S,Ae.N],Ge=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],We=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],He=[Ae.NW,Ae.SW,Ae.SE,Ae.NE],Xe=[Ae.NW,Ae.SW,Ae.SE,Ae.E,Ae.N],qe=[Ae.W,Ae.SW,Ae.SE,Ae.NE,Ae.N],Ze=[Ae.NW,Ae.W,Ae.S,Ae.SE,Ae.NE],Ye=[Ae.NW,Ae.SW,Ae.S,Ae.E,Ae.NE],Qe=[Ae.NW,Ae.W,[.5,-1/6],[.5,1/6],Ae.N],Ke=[[-1/6,-.5],[1/6,-.5],Ae.E,Ae.NE,Ae.N],Je=[[-.5,1/6],[-.5,-1/6],Ae.S,Ae.SE,Ae.E],$e=[Ae.W,Ae.SW,Ae.S,[1/6,.5],[-1/6,.5]],et=[Ae.NW,Ae.W,[-1/6,-.5],[1/6,-.5],Ae.N],tt=[[-.5,1/6],[-.5,-1/6],Ae.E,Ae.NE,Ae.N],nt=[Ae.S,Ae.SE,Ae.E,[1/6,.5],[-1/6,.5]],it=[Ae.W,Ae.SW,Ae.S,[.5,-1/6],[.5,1/6]],rt=[Ae.W,Ae.SW,Ae.SE,Ae.E,[1/6,.5],[-1/6,.5]],at=[[-.5,1/6],[-.5,-1/6],Ae.S,Ae.SE,Ae.NE,Ae.N],ot=[Ae.NW,Ae.W,[-1/6,-.5],[1/6,-.5],Ae.E,Ae.NE],st=[Ae.NW,Ae.SW,Ae.S,[.5,-1/6],[.5,1/6],Ae.N],ut=[Ae.W,Ae.SW,Ae.S,Ae.E,Ae.NE,Ae.N],ct=[Ae.NW,Ae.W,Ae.S,Ae.SE,Ae.E,Ae.N],lt=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],Ae.E,Ae.NE,Ae.N],ft=[Ae.W,Ae.SW,Ae.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],ht=[Ae.NW,Ae.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],Ae.N],dt=[[-.5,1/6],[-.5,-1/6],Ae.S,Ae.SE,Ae.E,[1/6,.5],[-1/6,.5]],vt=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],gt={0:[],1:[[Ae.W,Ae.S]],2:[[Ae.S,Ae.E]],3:[[Ae.W,Ae.E]],4:[[Ae.N,Ae.E]],5:{0:[[Ae.W,Ae.S],[Ae.N,Ae.E]],1:[[Ae.W,Ae.N],[Ae.S,Ae.E]]},6:[[Ae.N,Ae.S]],7:[[Ae.W,Ae.N]],8:[[Ae.W,Ae.N]],9:[[Ae.N,Ae.S]],10:{0:[[Ae.W,Ae.N],[Ae.S,Ae.E]],1:[[Ae.W,Ae.S],[Ae.N,Ae.E]]},11:[[Ae.N,Ae.E]],12:[[Ae.W,Ae.E]],13:[[Ae.S,Ae.E]],14:[[Ae.W,Ae.S]],15:[]};function pt(e){return parseInt(e,4)}var mt=(Se={},O()(Se,pt("0000"),[]),O()(Se,pt("2222"),[]),O()(Se,pt("2221"),[Te]),O()(Se,pt("2212"),[Me]),O()(Se,pt("2122"),[Le]),O()(Se,pt("1222"),[Ie]),O()(Se,pt("0001"),[Te]),O()(Se,pt("0010"),[Me]),O()(Se,pt("0100"),[Le]),O()(Se,pt("1000"),[Ie]),O()(Se,pt("2220"),[Fe]),O()(Se,pt("2202"),[Re]),O()(Se,pt("2022"),[Ne]),O()(Se,pt("0222"),[De]),O()(Se,pt("0002"),[Fe]),O()(Se,pt("0020"),[Re]),O()(Se,pt("0200"),[Ne]),O()(Se,pt("2000"),[De]),O()(Se,pt("0011"),[ze]),O()(Se,pt("0110"),[Be]),O()(Se,pt("1100"),[Ue]),O()(Se,pt("1001"),[Ve]),O()(Se,pt("2211"),[ze]),O()(Se,pt("2112"),[Be]),O()(Se,pt("1122"),[Ue]),O()(Se,pt("1221"),[Ve]),O()(Se,pt("2200"),[Ge]),O()(Se,pt("2002"),[We]),O()(Se,pt("0022"),[Ge]),O()(Se,pt("0220"),[We]),O()(Se,pt("1111"),[He]),O()(Se,pt("1211"),[Xe]),O()(Se,pt("2111"),[qe]),O()(Se,pt("1112"),[Ze]),O()(Se,pt("1121"),[Ye]),O()(Se,pt("1011"),[Xe]),O()(Se,pt("0111"),[qe]),O()(Se,pt("1110"),[Ze]),O()(Se,pt("1101"),[Ye]),O()(Se,pt("1200"),[Qe]),O()(Se,pt("0120"),[Ke]),O()(Se,pt("0012"),[Je]),O()(Se,pt("2001"),[$e]),O()(Se,pt("1022"),[Qe]),O()(Se,pt("2102"),[Ke]),O()(Se,pt("2210"),[Je]),O()(Se,pt("0221"),[$e]),O()(Se,pt("1002"),[et]),O()(Se,pt("2100"),[tt]),O()(Se,pt("0210"),[nt]),O()(Se,pt("0021"),[it]),O()(Se,pt("1220"),[et]),O()(Se,pt("0122"),[tt]),O()(Se,pt("2012"),[nt]),O()(Se,pt("2201"),[it]),O()(Se,pt("0211"),[rt]),O()(Se,pt("2110"),[at]),O()(Se,pt("1102"),[ot]),O()(Se,pt("1021"),[st]),O()(Se,pt("2011"),[rt]),O()(Se,pt("0112"),[at]),O()(Se,pt("1120"),[ot]),O()(Se,pt("1201"),[st]),O()(Se,pt("2101"),[ut]),O()(Se,pt("0121"),[ut]),O()(Se,pt("1012"),[ct]),O()(Se,pt("1210"),[ct]),O()(Se,pt("0101"),{0:[Te,Le],1:[ut],2:[ut]}),O()(Se,pt("1010"),{0:[Ie,Me],1:[ct],2:[ct]}),O()(Se,pt("2121"),{0:[ut],1:[ut],2:[Te,Le]}),O()(Se,pt("1212"),{0:[ct],1:[ct],2:[Ie,Me]}),O()(Se,pt("2120"),{0:[lt],1:[lt],2:[Fe,Le]}),O()(Se,pt("2021"),{0:[ft],1:[ft],2:[Te,Ne]}),O()(Se,pt("1202"),{0:[ht],1:[ht],2:[Ie,Re]}),O()(Se,pt("0212"),{0:[dt],1:[dt],2:[Me,De]}),O()(Se,pt("0102"),{0:[Fe,Le],1:[lt],2:[lt]}),O()(Se,pt("0201"),{0:[Te,Ne],1:[ft],2:[ft]}),O()(Se,pt("1020"),{0:[Ie,Re],1:[ht],2:[ht]}),O()(Se,pt("2010"),{0:[Me,De],1:[dt],2:[dt]}),O()(Se,pt("2020"),{0:[De,Re],1:[vt],2:[Fe,Ne]}),O()(Se,pt("0202"),{0:[Ne,Fe],1:[vt],2:[De,Re]}),Se),yt={ISO_LINES:1,ISO_BANDS:2},bt={zIndex:0,zOffset:.005};function _t(e,t){return Array.isArray(t)?e=t?1:0}function xt(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,f=s||u||c||l,h={},d={};s||l?d.top=0:(h.top=t[(i+1)*r+n],d.top=_t(h.top,o)),u||l?d.topRight=0:(h.topRight=t[(i+1)*r+n+1],d.topRight=_t(h.topRight,o)),u||c?d.right=0:(h.right=t[i*r+n+1],d.right=_t(h.right,o)),s||c?d.current=0:(h.current=t[i*r+n],d.current=_t(h.current,o));var v=d.top,g=d.topRight,p=d.right,y=d.current,b=-1;Number.isFinite(o)&&(b=v<<3|g<<2|p<<1|y),Array.isArray(o)&&(b=v<<6|g<<4|p<<2|y);var _=0;return f||(_=_t((h.top+h.topRight+h.right+h.current)/4,o)),{code:b,meanCode:_}}function wt(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?yt.ISO_LINES:s,c=Object.assign({},bt,e.thresholdData),l=u===yt.ISO_BANDS?mt[a]:gt[a];Array.isArray(l)||(l=l[o]);var f=c.zIndex*c.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+h,g=t[1]+d;if(u===yt.ISO_BANDS){var p=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=g+e[1]*n[1];t.push([i,r,f])}),p.push(t)}),p}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=g+e[1]*n[1];m.push([t,i,f])})}),m}var Pt=n(125),Ot=n(26),kt=g.experimental.count,St=j.fp64.fp64LowPart,jt=6378e3;function Ct(e){return Number.isFinite(e)?e:0}function Et(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,f=void 0===l?Ot.a.LNGLAT:l,h=e.viewport,d=void 0===h?null:h,v=e.boundingBox,g=void 0===v?null:v,y={};o.dataChanged&&(g=(y=function(e,t,n){var i,r,a=kt(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,f=-1/0,h={};for(var d in n)h[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(p.a)(e),g=v.iterable,m=v.objectInfo,y=!0,b=!1,_=void 0;try{for(var x,w=g[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var P=x.value;m.index++;var O=t(P,m),k=m.index;for(var S in r=O[0],i=O[1],o[2*k]=r,o[2*k+1]=i,s[2*k]=St(r),s[2*k+1]=St(i),n){var j=n[S].getWeight(P);Array.isArray(j)?(h[S].values[3*k]=j[0],h[S].values[3*k+1]=j[1],h[S].values[3*k+2]=j[2]):h[S].values[3*k]=j}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rf?r:f)}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var C={xMin:Ct(l),xMax:Ct(f),yMin:Ct(u),yMax:Ct(c)};return{positions:o,positions64xyLow:s,weights:h,boundingBox:C}}(t,n,s)).boundingBox);var b=[i,i],_=[0,0];switch(m.a.assert(f===Ot.a.LNGLAT||f===Ot.a.IDENTITY),f){case Ot.a.LNGLAT:case Ot.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/jt*(180/Math.PI)),i=(r=t,a=e,a/jt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(g,i);b=[x.xOffset,x.yOffset],_=[-180,-90];break;case Ot.a.IDENTITY:_=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=At(o-i[0],n[0])+i[0],c=At(r-i[1],n[1])+i[1],l=(new Pt.a).translate([-1*u,-1*c,0]),f=[u,c],h=s-o+n[0],d=a-r+n[1],v=[Math.ceil(h/n[0]),Math.ceil(d/n[1])];return{gridOrigin:f,gridSize:v,width:h,height:d,gridTransformMatrix:l}}({boundingBox:g,cellSize:b,worldOrigin:_});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:b,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:b,boundingBox:g}}function At(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Tt=[255,255,255,255],Mt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},Lt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new Z(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ce.a(this._getLineLayerProps()),r&&new Ee.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=Et({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:f,gridOrigin:h,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking","fp64"]}}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new j.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new j.CubeGeometry,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,f=n.gridOffset,h=n.colorRange,d=n.elevationRange,v=[It(l[0]),It(l[1])],g=[It(f[0]),It(f[1])],p=i.color.maxMinBuffer,m=i.elevation.maxMinBuffer;p.bind({target:35345,index:0}),m.bind({target:35345,index:1});var y=this.getDomainUniforms();this.state.model.setUniforms(Object.assign({},t,y,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:v,gridOffset:f,gridOffsetLow:g,colorRange:h,elevationRange:d})).draw(),p.unbind({target:35345,index:0}),m.unbind({target:35345,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(b.a);Nt.layerName="GPUGridCellLayer",Nt.defaultProps=Rt;var Dt={colorDomain:null,colorRange:_,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new j.PhongMaterial,gpuAggregation:!0},zt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=Z.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new Z(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=Z.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=Z.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,f=c.getPosition,h=this.state.gridHash;if(!h)h=ce(l,this.props.cellSize,f).gridHash,this.setState({gridHash:h});var d=h[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,f=Et({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:E[s]||E[Dt.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:E[c]||E[Dt.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),h=f.weights,d=f.gridSize,v=f.gridOrigin,g=f.cellSize,p=f.boundingBox;this.setState({weights:h,gridSize:d,gridOrigin:v,cellSize:g,boundingBox:p})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.fp64,i=e.extruded,r=e.cellSize,a=e.coverage,o=e.material,s=e.elevationRange,u=e.colorDomain,c=e.elevationDomain,l=this.state,f=l.weights,h=l.gridSize,d=l.gridOrigin,v=l.cellSize,g=x(this.props.colorRange,Float32Array,255);return new(this.getSubLayerClass("gpu-grid-cell",Nt))({gridSize:h,gridOrigin:d,gridOffset:v,colorRange:g,elevationRange:s,colorDomain:u,elevationDomain:c,fp64:n,cellSize:r,coverage:a,material:o,elevationScale:t,extruded:i},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:f,numInstances:h[0]*h[1]})}}]),t}(te.a);zt.layerName="GPUGridLayer",zt.defaultProps=Dt;var Bt=Object.assign({},zt.defaultProps,ve.defaultProps,{gpuAggregation:!1}),Ut=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",zt):this.getSubLayerClass("CPU",ve))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!Z.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(te.a);Ut.layerName="GridLayer",Ut.defaultProps=Bt,n.d(t,"experimental",function(){return Vt}),n.d(t,"ScreenGridLayer",function(){return ee}),n.d(t,"CPUGridLayer",function(){return ve}),n.d(t,"HexagonLayer",function(){return ke}),n.d(t,"ContourLayer",function(){return Lt}),n.d(t,"GridLayer",function(){return Ut}),n.d(t,"GPUGridLayer",function(){return zt}),n.d(t,"AGGREGATION_OPERATION",function(){return E}),n.d(t,"_GPUGridAggregator",function(){return Z});var Vt={BinSorter:re,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:se,quantizeScale:ae,getQuantizeScale:oe,defaultColorRange:_}},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),f=n(17),h=n.n(f),d=n(8),v=n.n(d),g=n(142),p=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return Object.assign({},h()(l()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME great-circle-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset_screenspace = dir_screenspace * offset_direction * width / 2.0;\n vec2 offset_clipspace = project_pixel_size_to_clipspace(offset_screenspace);\n\n return offset_clipspace;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) *\n sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\n if(abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n}\n\nvoid main(void) {\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n \n vec2 source = radians(instancePositions.xy);\n vec2 target = radians(instancePositions.zw);\n \n float angularDist = getAngularDist(source, target);\n\n vec3 currPos = vec3(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0);\n vec3 nextPos = vec3(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0);\n\n vec2 currPos64Low = mix(instancePositions64Low.xy, instancePositions64Low.zw, segmentRatio);\n vec2 nextPos64Low = mix(instancePositions64Low.xy, instancePositions64Low.zw, nextSegmentRatio);\n\n vec4 curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0));\n vec4 next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels);\n gl_Position = curr + vec4(offset, 0.0, 0.0);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.0;\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n}\n",modules:["picking","project32"]})}}]),t}(g.a);p.layerName="GreatCircleLayer";var m=n(126),y=n(141),b=n(19),_=n.n(b),x=n(90),w=n(156),P=n.n(w);var O=180/Math.PI,k=100;function S(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return P.a.fromString(t,16)}(e)}return x.S2.S2Cell.toHilbertQuadkey(e.toString())}function j(e){var t=S(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],f=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,k*Math.pow(2,-c)),d=0;d<4;d++)for(var v=f[d].slice(0),g=f[d+1],p=(g[0]-v[0])/h,m=(g[1]-v[1])/h,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(L.g)([r[0],r[3]],e.scale).map(F),o=_()(a,2),s=o[0],u=o[1],c=Object(L.g)([r[2],r[1]],e.scale).map(F),l=_()(c,2),f=l[0],h=l[1];s=Math.max(0,Math.floor(s)),f=Math.min(e.scale,Math.ceil(f)),u=Math.max(0,Math.floor(u)),h=Math.min(e.scale,Math.ceil(h));for(var d=[],v=s;vt?d.push(R({x:v,y:g,z:i},t)):d.push({x:v,y:g,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),D={renderSubLayers:{type:"function",value:function(e){return new A.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},z=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new N({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new N({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var f=i.viewport,h=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==f.id&&this.state.tileCache.update(f,function(e){var n=e.filter(function(e){return e.z===h}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","gl_FragColor = vColor;":"gl_FragColor.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){h()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),h()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),f=Object(U.a)(a,n,i),h=f.iterable,d=f.objectInfo,v=0,g=0;g180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function K(e,t,n){var i=e(t,n),r=Object(G.h3ToGeo)(i),a=_()(r,2),o=a[0];return[a[1],o]}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(G.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(G.h3ToGeo)(e),r=_()(i,2),a=r[0],o=r[1],s=t.length;Q(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(G.edgeLength)(i,G.UNITS.km):0,hasPentagon:r})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(G.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(G.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=J(a),u=Object(G.h3ToGeo)(a),c=_()(u,2),l=c[0],f=c[1],h=e.projectFlat([f,l]),d=_()(h,2),v=d[0],g=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-g)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.fp64,i=e.material,r=e.coverage,a=e.extruded,o=e.wireframe,s=e.stroked,u=e.filled,c=e.lineWidthUnits,l=e.lineWidthScale,f=e.lineWidthMinPixels,h=e.lineWidthMaxPixels,d=e.getColor,v=e.getFillColor,g=e.getElevation,p=e.getLineColor,m=e.getLineWidth,y=e.updateTriggers;return{elevationScale:t,fp64:n,extruded:a,coverage:r,wireframe:o,stroked:s,filled:u,lineWidthUnits:c,lineWidthScale:l,lineWidthMinPixels:f,lineWidthMaxPixels:h,material:i,getElevation:g,getFillColor:d||v,getLineColor:p,getLineWidth:m,updateTriggers:{getFillColor:y.getColor||y.getFillColor,getElevation:y.getElevation,getLineColor:y.getLineColor,getLineWidth:y.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===q()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return J(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",Y.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:K.bind(null,n)})}}]),t}(m.a);ee.defaultProps=$,ee.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return p}),n.d(t,"S2Layer",function(){return E}),n.d(t,"TileLayer",function(){return z}),n.d(t,"TripsLayer",function(){return V}),n.d(t,"H3ClusterLayer",function(){return H}),n.d(t,"H3HexagonLayer",function(){return ee})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(32),u=n.n(s);var c=n(101),l=n(137),f=n(138),h=n(139),d=n(7),v=n.n(d),g=n(5),p=n.n(g),m=n(8),y=n.n(m),b={fetch:function(e){return JSON.parse(e)},configuration:[]},_=function(e){function t(){return r()(this,t),v()(this,p()(t).apply(this,arguments))}return y()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layers:[]}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps;(e.changeFlags.dataChanged||t.configuration!==n.configuration)&&(this.state.layers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t){var n={};for(var i in e){var r=e[i];i.startsWith("get")?n[i]=N(r,t):n[i]=r}return n}(e,t);return r.fetch=D,i&&new i(r)})}(t.data,t.configuration))}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(126).a);function x(e,t){var n=function(e){if("string"==typeof e){var t=P[e];return t||(t=e.split("."),P[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=w(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function w(e){return null!==e&&"object"===u()(e)}_.layerName="JSONLayer",_.defaultProps=b;var P={};var O={},k={},S=34,j=10,C=13;function E(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var A=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return k;if(c)return c=!1,O;var t,i,r=o;if(e.charCodeAt(r)===S){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===j?c=!0:i===C&&(c=!0,e.charCodeAt(o)===j&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u]);Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var z=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=R(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return z}),n.d(t,"_JSONLayer",function(){return _})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(127);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},f=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":i=e._onPointerMove;break;case"mouseout":i=e._onPointerLeave;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv().firstChild,i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),f=new google.maps.Point(0,0),h=a.fromContainerPixelToLatLng(f),d=a.fromLatLngToDivPixel(h),v=(c.x-l.x)/i,g=Math.log2(v)+e.getZoom()-1,p=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(p),y=m.lat(),b=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:g,pitch:e.getTilt(),latitude:y,longitude:b}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,f=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:f?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return f})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(127),u=n(102);function c(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[770,771,1,771],blendEquation:32774},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:l(t)}),i=new s.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:l(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=h(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[f(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function l(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new u.a(Object.assign({x:0,y:0,width:e.width,height:e.height},l(t),n?{nearZMultiplier:e.height?1/e.height:1,farZMultiplier:1}:{nearZMultiplier:.1,farZMultiplier:10}))}function h(e,t){return e.layerManager.getLayers().filter(t)}function d(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function v(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var g=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=c({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),v(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),v(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&v(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=f(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:h(n,function(e){return d(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return g})},function(e,t,n){"use strict";var i=n(4),r=n(6),a=n(58),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()},,function(e,t,n){"use strict";var i=n(41),r=n.n(i),a=n(62),o=n(151),s=n.n(o),u=n(152),c=n.n(u),l=n(21);function f(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}var h=!1,d=!0,v=new Map([["image/png",function(e){var t=y(e);if(t.byteLength<24||2303741511!==t.getUint32(0,h))return null;return{width:t.getUint32(16,h),height:t.getUint32(20,h)}}],["image/jpeg",function(e){var t=y(e);if(t.byteLength<2||65496!==t.getUint16(0,h))return null;var n=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),i=n.tableMarkers,r=n.sofMarkers,a=2;for(;a1&&void 0!==arguments[1]?arguments[1]:null;if(t){var n=v.get(t);if(!n)throw new Error(g);var i=n(e);if(!i)throw new Error("invalid image data for type: ".concat(t));return i}var r=m(e,t);if(!r)throw new Error(g);return r}function m(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=v.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=Object(l.a)(a.value,2),u=s[0],c=(0,s[1])(e);if(c)return c.mimeType=u,c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function y(e){if(f&&(e=f(e)),e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}function b(e,t){return _.apply(this,arguments)}function _(){return(_=Object(a.a)(r.a.mark(function e(t,n){var i,a,o,u,l;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=c.a.promisify(s.a),a=p(t),o=a.mimeType,u=t instanceof Buffer?t:Buffer.from(t),e.next=5,i(u,o);case 5:return l=e.sent,e.abrupt("return",{width:l.shape[0],height:l.shape[1],data:l.data});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}n.d(t,"a",function(){return w});function x(e,t){return b?b(e,t):function(e){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var t=new Blob([new Uint8Array(e)]);return createImageBitmap(t)}(e)}function w(e,t){return P.apply(this,arguments)}function P(){return(P=Object(a.a)(r.a.mark(function e(t,n){var i,a;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof Image){e.next=8;break}return e.next=3,fetch(t,n);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return a=e.sent,e.abrupt("return",x(a));case 8:return e.next=10,O(t,n);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function O(e,t){return k.apply(this,arguments)}function k(){return(k=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}}])}); +!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),f="function",h=Math.round,d=Math.abs,v=Date.now;function g(e,t,n){return setTimeout(w(e,n),t)}function p(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function C(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function M(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==B&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(f=o.pointers,h=i,oe(h[0],h[1],$)/oe(f[0],f[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>z||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,f=re(u,c,l);i=f.x,r=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var f,h;var g=e.element;j(t.srcEvent.target,g)&&(g=t.srcEvent.target);t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?q:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(F(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(F(this.element),this.evWin,this.domHandler)}};var ue={mousedown:B,mousemove:U,mouseup:V},ce="mousedown",le="mousemove mouseup";function fe(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(fe,ee,{handler:function(e){var t=ue[e.type];t&B&&0===e.button&&(this.pressed=!0),t&U&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:B,pointermove:U,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",ge="pointermove pointerup pointercancel";function pe(){this.evEl=ve,this.evWin=ge,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",ge="MSPointerMove MSPointerUp MSPointerCancel"),x(pe,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=he[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=A(t,e.pointerId,"pointerId");r&B&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:B,touchmove:U,touchend:V,touchcancel:G},ye="touchstart",be="touchstart touchmove touchend touchcancel";function _e(){this.evTarget=ye,this.evWin=be,this.started=!1,ee.apply(this,arguments)}x(_e,ee,{handler:function(e){var t=me[e.type];if(t===B&&(this.started=!0),this.started){var n=function(e,t){var n=T(e.touches),i=T(e.changedTouches);t&(V|G)&&(n=L(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:B,touchmove:U,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Oe(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Oe,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=T(e.touches),i=this.targetIds;if(t&(B|U)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=T(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return j(e.target,u)}),t===B)for(r=0;r-1&&i.splice(e,1)},Pe)}}x(ke,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,je.call(this,t)):e&(V|G)&&je.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Be&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return qe.prototype.attrTest.call(this,e)&&(this.state&Ne||!(this.state&Ne)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ye,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Le]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ne)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Ke,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&B)this.reset(),this._timer=g(function(){this.state=Ue,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ue;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ue&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Qe,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Le]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ne)}}),x(Je,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|K)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;k(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:E(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){var i=n(4);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=i(e)););return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return o});var i=n(153),r=n(135);const a={position:"absolute",left:0,top:0,width:"100%",height:"100%"};class o extends r.a{constructor(e={}){if("undefined"==typeof document)throw Error("Deck can only be used in the browser");const{mapCanvas:t,deckCanvas:n}=function(e){let{container:t=document.body}=e;if("string"==typeof t&&(t=document.getElementById(t)),!t)throw Error("Deck: container not found");"static"===window.getComputedStyle(t).position&&(t.style.position="relative");const n=document.createElement("div");t.appendChild(n),Object.assign(n.style,a);const i=document.createElement("canvas");return t.appendChild(i),Object.assign(i.style,a),{container:t,mapCanvas:n,deckCanvas:i}}(e),r=e.initialViewState||function(e){if(!e.viewState&&"latitude"in e&&"longitude"in e&&"zoom"in e){const{latitude:t,longitude:n,zoom:i,pitch:r=0,bearing:a=0}=e;return{latitude:t,longitude:n,zoom:i,pitch:r,bearing:a}}return e.viewState}(e),o=Number.isFinite(r.latitude),{map:s=window.mapboxgl,controller:u=!0}=e;super(Object.assign({},e,{width:"100%",height:"100%",canvas:n,controller:u,initialViewState:r})),s&&s.Map?this._map=o&&new i.a(Object.assign({},e,{viewState:r,container:t,mapboxgl:s})):this._map=s,this._onBeforeRender=(e=>{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(180);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(19),p=n(53),m=n(14),y=n(112),b=n(85),_=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function x(e,t,n){if(Number.isFinite(e[0]))return e;var i=new t(4*e.length);return e.forEach(function(e,t){var r=4*t;i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=Number.isFinite(e[3])?e[3]:n}),i}var w,O=n(9),P=n.n(O),S=n(17),k=n.n(S),j=n(1),E=n(109),C=n(24),A={SUM:1,MEAN:2,MIN:3,MAX:4};function T(e,t){return e+t}function L(e,t){return t>e?t:e}function M(e,t){return t2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(j.isWebGL2)(t)&&Object(j.hasFeatures)(this.gl,j.FEATURES.BLEND_EQUATION_MINMAX,j.FEATURES.COLOR_ATTACHMENT_RGBA32F,j.FEATURES.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.info("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,Z){var r=Z[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},R,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,F)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||V,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},U,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,f=0;f=0&&P=0&&S0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new j.Model(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n pos = floor(pos / cellSize);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?[E.a]:["project32"],shaderCache:n,vertexCount:0,drawMode:0})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new j.Model(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:[j.fp64],shaderCache:t,vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new j.Transform(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,h=a.weights,d=[o,s],v={blend:!0,depthTest:!1,blendFunc:[1,1]},g={viewport:n},p={windowSize:u,cellSize:t,gridSize:d,uProjectionMatrix:i,uProjectionMatrixFP64:X(i),projectPoints:r};for(var m in h){var y=h[m],b=y.needMin,_=y.needMax,x=b&&_&&h[m].combineMaxMin;this.renderToWeightsTexture({id:m,parameters:v,moduleSettings:g,uniforms:p,gridSize:d}),x?this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:z}),gridSize:d,minOrMaxFb:c[m],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:x}):(b&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:D}),gridSize:d,minOrMaxFb:l[m],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:x}),_&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:N}),gridSize:d,minOrMaxFb:f[m],combineMaxMin:x}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(j.withParameters)(c,s,function(){c.clear(16384)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,f=this.gl,h=this.gridAggregationModel,d=l[t].operation;s[t].bind(),f.viewport(0,0,a[0],a[1]);var v=d===A.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(j.withParameters)(f,{clearColor:v},function(){f.clear(16384)});var g={weights:c[t]};if(h.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:g}),s[t].unbind(),d===A.MEAN){var p=this.state,m=p.meanTextures,y=p.textures,b={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(b).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(P()({},36064,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,f=t.equations,h=t.weights,d={width:n,height:i};for(var v in h){var g=h[v],p=g.needMin,m=g.needMax,y=g.combineMaxMin,b=g.operation;r[v]=h[v].aggregationTexture||r[v]||G(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var _=r[v];b===A.MEAN&&(l[v]=l[v]||G(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),_=l[v]),a[v]?a[v].attach(P()({},36064,_)):a[v]=W(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:_}),a[v].resize(d),f[v]=B[b],(p||m)&&(p&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=G(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=W(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(p&&(s[v]||(c["".concat(v,"-min")]=G(this.gl,{id:"".concat(v,"-minTex")}),s[v]=W(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=G(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=W(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof j.Buffer?n[o].setData(u):(a["".concat(o,"-buffer")]=new j.Buffer(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof j.Buffer),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],h()(l()(t.prototype),"getShaders",this).call(this,e)}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:A.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new Y(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&this._updateAggregation(n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||Q,o=this.props.maxColor||J,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,f=u.cellScale,h=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,g={minColor:a,maxColor:o,cellScale:f,colorRange:d,colorDomain:s,shouldUseMinMax:h};Object(j.isWebGL2)(n)?l.bind({target:35345}):g.maxWeight=v,t=Object.assign(g,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(j.isWebGL2)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=Y.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new j.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new j.Geometry({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new j.Buffer(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=K(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(p.a)(t),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var m=v.value;l.index++;var y=n(m,l),b=i(m,l),_=l.index;a[2*_]=y[0],a[2*_+1]=y[1],Array.isArray(b)?(o[3*_]=b[0],o[3*_+1]=b[1],o[3*_+2]=b[2]):o[3*_]=b}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}s.color.values=o,this.setState({positions:a})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(j.isWebGL2)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager();(e.cellSizeChanged||e.viewportChanged)&&(this._updateGridParams(),t.invalidateAll());var n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=A[this.props.aggregation.toUpperCase()]||A.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var f=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),h=f.color.maxData&&Number.isFinite(f.color.maxData[0])?f.color.maxData[0]:0;this.setState({maxWeight:h}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if($.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange,Float32Array,255)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,f=c>l?l:0;r.cellScale=new Float32Array([(c-f)/o*2,-(c-f)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new j.Buffer(r,{byteLength:u,accessor:{size:4,type:5126,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(b.a);te.layerName="ScreenGridLayer",te.defaultProps=ee;var ne=n(134),ie=n(143),re=function(e){return e.length},ae=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:re;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=k()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,P()({},t.i,t))},{})}}]),e}();function oe(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function se(e,t){return function(n){return oe(e,t,n)}}function ue(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var ce=6378e3;function le(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(p.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,f=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}var g=function(e,t){var n=(o=e,o/ce*(180/Math.PI)),i=(r=t,a=e,a/ce*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(g.xOffset<=0||g.yOffset<=0)return{gridHash:{},gridOffset:g};var m={};u.index=-1;var y=!0,b=!1,_=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;u.index++;var P=i(O,u),S=k()(P,2),j=S[0],E=S[1];if(Number.isFinite(E)&&Number.isFinite(j)){var C=Math.floor((E+90)/g.yOffset),A=Math.floor((j+180)/g.xOffset),T="".concat(C,"-").concat(A);m[T]=m[T]||{count:0,points:[]},m[T].count+=1,m[T].points.push(O)}}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}return{gridHash:m,gridOffset:g}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function fe(){}var he={colorDomain:null,colorRange:_,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:fe,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:fe,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,material:new j.PhongMaterial},de=["getColorValue","colorAggregation","getColorWeight"],ve=["getElevationValue","elevationAggregation","getElevationWeight"],ge=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:fe,elevationScaleFunc:fe,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=le(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new ae(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new ae(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=se(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=ue(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.transitions;return new(this.getSubLayerClass("grid-cell",ie.a))({cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(ne.a);ge.layerName="CPUGridLayer",ge.defaultProps=he;var pe=n(117),me=Math.PI/3,ye=[0,me,2*me,3*me,4*me,5*me];function be(e){return e[0]}function _e(e){return e[1]}var xe=function(){var e,t,n,i=0,r=0,a=1,o=1,s=be,u=_e;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var g=l-d,p=d+(ly*y+b*b&&(d=p+(1&h?1:-1)/2,h=m)}var _=d+"-"+h,x=r[_];x?x.push(c):(a.push(x=r[_]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return a}function l(e){var t=0,n=0;return ye.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new ae(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new ae(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=se(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=ue(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.transitions,o=this.state,s=o.angle,u=o.radius;return new(this.getSubLayerClass("hexagon-cell",pe.a))({radius:u,diskResolution:6,elevationScale:t,angle:s,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(ne.a);ke.layerName="HexagonLayer",ke.defaultProps=Oe;var je,Ee=n(20),Ce=n(145),Ae=n(86),Te={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Le=[Te.W,Te.SW,Te.S],Me=[Te.S,Te.SE,Te.E],Ie=[Te.E,Te.NE,Te.N],Fe=[Te.NW,Te.W,Te.N],Re=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],De=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Ne=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],ze=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],Be=[Te.W,Te.SW,Te.SE,Te.E],Ue=[Te.S,Te.SE,Te.NE,Te.N],Ve=[Te.NW,Te.W,Te.E,Te.NE],Ge=[Te.NW,Te.SW,Te.S,Te.N],We=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],He=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],Xe=[Te.NW,Te.SW,Te.SE,Te.NE],qe=[Te.NW,Te.SW,Te.SE,Te.E,Te.N],Ze=[Te.W,Te.SW,Te.SE,Te.NE,Te.N],Ye=[Te.NW,Te.W,Te.S,Te.SE,Te.NE],Ke=[Te.NW,Te.SW,Te.S,Te.E,Te.NE],Qe=[Te.NW,Te.W,[.5,-1/6],[.5,1/6],Te.N],Je=[[-1/6,-.5],[1/6,-.5],Te.E,Te.NE,Te.N],$e=[[-.5,1/6],[-.5,-1/6],Te.S,Te.SE,Te.E],et=[Te.W,Te.SW,Te.S,[1/6,.5],[-1/6,.5]],tt=[Te.NW,Te.W,[-1/6,-.5],[1/6,-.5],Te.N],nt=[[-.5,1/6],[-.5,-1/6],Te.E,Te.NE,Te.N],it=[Te.S,Te.SE,Te.E,[1/6,.5],[-1/6,.5]],rt=[Te.W,Te.SW,Te.S,[.5,-1/6],[.5,1/6]],at=[Te.W,Te.SW,Te.SE,Te.E,[1/6,.5],[-1/6,.5]],ot=[[-.5,1/6],[-.5,-1/6],Te.S,Te.SE,Te.NE,Te.N],st=[Te.NW,Te.W,[-1/6,-.5],[1/6,-.5],Te.E,Te.NE],ut=[Te.NW,Te.SW,Te.S,[.5,-1/6],[.5,1/6],Te.N],ct=[Te.W,Te.SW,Te.S,Te.E,Te.NE,Te.N],lt=[Te.NW,Te.W,Te.S,Te.SE,Te.E,Te.N],ft=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],Te.E,Te.NE,Te.N],ht=[Te.W,Te.SW,Te.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],dt=[Te.NW,Te.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],Te.N],vt=[[-.5,1/6],[-.5,-1/6],Te.S,Te.SE,Te.E,[1/6,.5],[-1/6,.5]],gt=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],pt={0:[],1:[[Te.W,Te.S]],2:[[Te.S,Te.E]],3:[[Te.W,Te.E]],4:[[Te.N,Te.E]],5:{0:[[Te.W,Te.S],[Te.N,Te.E]],1:[[Te.W,Te.N],[Te.S,Te.E]]},6:[[Te.N,Te.S]],7:[[Te.W,Te.N]],8:[[Te.W,Te.N]],9:[[Te.N,Te.S]],10:{0:[[Te.W,Te.N],[Te.S,Te.E]],1:[[Te.W,Te.S],[Te.N,Te.E]]},11:[[Te.N,Te.E]],12:[[Te.W,Te.E]],13:[[Te.S,Te.E]],14:[[Te.W,Te.S]],15:[]};function mt(e){return parseInt(e,4)}var yt=(je={},P()(je,mt("0000"),[]),P()(je,mt("2222"),[]),P()(je,mt("2221"),[Le]),P()(je,mt("2212"),[Me]),P()(je,mt("2122"),[Ie]),P()(je,mt("1222"),[Fe]),P()(je,mt("0001"),[Le]),P()(je,mt("0010"),[Me]),P()(je,mt("0100"),[Ie]),P()(je,mt("1000"),[Fe]),P()(je,mt("2220"),[Re]),P()(je,mt("2202"),[De]),P()(je,mt("2022"),[Ne]),P()(je,mt("0222"),[ze]),P()(je,mt("0002"),[Re]),P()(je,mt("0020"),[De]),P()(je,mt("0200"),[Ne]),P()(je,mt("2000"),[ze]),P()(je,mt("0011"),[Be]),P()(je,mt("0110"),[Ue]),P()(je,mt("1100"),[Ve]),P()(je,mt("1001"),[Ge]),P()(je,mt("2211"),[Be]),P()(je,mt("2112"),[Ue]),P()(je,mt("1122"),[Ve]),P()(je,mt("1221"),[Ge]),P()(je,mt("2200"),[We]),P()(je,mt("2002"),[He]),P()(je,mt("0022"),[We]),P()(je,mt("0220"),[He]),P()(je,mt("1111"),[Xe]),P()(je,mt("1211"),[qe]),P()(je,mt("2111"),[Ze]),P()(je,mt("1112"),[Ye]),P()(je,mt("1121"),[Ke]),P()(je,mt("1011"),[qe]),P()(je,mt("0111"),[Ze]),P()(je,mt("1110"),[Ye]),P()(je,mt("1101"),[Ke]),P()(je,mt("1200"),[Qe]),P()(je,mt("0120"),[Je]),P()(je,mt("0012"),[$e]),P()(je,mt("2001"),[et]),P()(je,mt("1022"),[Qe]),P()(je,mt("2102"),[Je]),P()(je,mt("2210"),[$e]),P()(je,mt("0221"),[et]),P()(je,mt("1002"),[tt]),P()(je,mt("2100"),[nt]),P()(je,mt("0210"),[it]),P()(je,mt("0021"),[rt]),P()(je,mt("1220"),[tt]),P()(je,mt("0122"),[nt]),P()(je,mt("2012"),[it]),P()(je,mt("2201"),[rt]),P()(je,mt("0211"),[at]),P()(je,mt("2110"),[ot]),P()(je,mt("1102"),[st]),P()(je,mt("1021"),[ut]),P()(je,mt("2011"),[at]),P()(je,mt("0112"),[ot]),P()(je,mt("1120"),[st]),P()(je,mt("1201"),[ut]),P()(je,mt("2101"),[ct]),P()(je,mt("0121"),[ct]),P()(je,mt("1012"),[lt]),P()(je,mt("1210"),[lt]),P()(je,mt("0101"),{0:[Le,Ie],1:[ct],2:[ct]}),P()(je,mt("1010"),{0:[Fe,Me],1:[lt],2:[lt]}),P()(je,mt("2121"),{0:[ct],1:[ct],2:[Le,Ie]}),P()(je,mt("1212"),{0:[lt],1:[lt],2:[Fe,Me]}),P()(je,mt("2120"),{0:[ft],1:[ft],2:[Re,Ie]}),P()(je,mt("2021"),{0:[ht],1:[ht],2:[Le,Ne]}),P()(je,mt("1202"),{0:[dt],1:[dt],2:[Fe,De]}),P()(je,mt("0212"),{0:[vt],1:[vt],2:[Me,ze]}),P()(je,mt("0102"),{0:[Re,Ie],1:[ft],2:[ft]}),P()(je,mt("0201"),{0:[Le,Ne],1:[ht],2:[ht]}),P()(je,mt("1020"),{0:[Fe,De],1:[dt],2:[dt]}),P()(je,mt("2010"),{0:[Me,ze],1:[vt],2:[vt]}),P()(je,mt("2020"),{0:[ze,De],1:[gt],2:[Re,Ne]}),P()(je,mt("0202"),{0:[Ne,Re],1:[gt],2:[ze,De]}),je),bt={ISO_LINES:1,ISO_BANDS:2},_t={zIndex:0,zOffset:.005};function xt(e,t){return Array.isArray(t)?e=t?1:0}function wt(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,f=s||u||c||l,h={},d={};s||l?d.top=0:(h.top=t[(i+1)*r+n],d.top=xt(h.top,o)),u||l?d.topRight=0:(h.topRight=t[(i+1)*r+n+1],d.topRight=xt(h.topRight,o)),u||c?d.right=0:(h.right=t[i*r+n+1],d.right=xt(h.right,o)),s||c?d.current=0:(h.current=t[i*r+n],d.current=xt(h.current,o));var v=d.top,g=d.topRight,p=d.right,y=d.current,b=-1;Number.isFinite(o)&&(b=v<<3|g<<2|p<<1|y),Array.isArray(o)&&(b=v<<6|g<<4|p<<2|y);var _=0;return f||(_=xt((h.top+h.topRight+h.right+h.current)/4,o)),{code:b,meanCode:_}}function Ot(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?bt.ISO_LINES:s,c=Object.assign({},_t,e.thresholdData),l=u===bt.ISO_BANDS?yt[a]:pt[a];Array.isArray(l)||(l=l[o]);var f=c.zIndex*c.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+h,g=t[1]+d;if(u===bt.ISO_BANDS){var p=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=g+e[1]*n[1];t.push([i,r,f])}),p.push(t)}),p}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=g+e[1]*n[1];m.push([t,i,f])})}),m}var Pt=n(81),St=n(27),kt=g.experimental.count,jt=j.fp64.fp64LowPart,Et=6378e3;function Ct(e){return Number.isFinite(e)?e:0}function At(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,f=void 0===l?St.a.LNGLAT:l,h=e.viewport,d=void 0===h?null:h,v=e.boundingBox,g=void 0===v?null:v,y={};o.dataChanged&&(g=(y=function(e,t,n){var i,r,a=kt(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,f=-1/0,h={};for(var d in n)h[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(p.a)(e),g=v.iterable,m=v.objectInfo,y=!0,b=!1,_=void 0;try{for(var x,w=g[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;m.index++;var P=t(O,m),S=m.index;for(var k in r=P[0],i=P[1],o[2*S]=r,o[2*S+1]=i,s[2*S]=jt(r),s[2*S+1]=jt(i),n){var j=n[k].getWeight(O);Array.isArray(j)?(h[k].values[3*S]=j[0],h[k].values[3*S+1]=j[1],h[k].values[3*S+2]=j[2]):h[k].values[3*S]=j}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rf?r:f)}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var E={xMin:Ct(l),xMax:Ct(f),yMin:Ct(u),yMax:Ct(c)};return{positions:o,positions64xyLow:s,weights:h,boundingBox:E}}(t,n,s)).boundingBox);var b=[i,i],_=[0,0];switch(m.a.assert(f===St.a.LNGLAT||f===St.a.IDENTITY),f){case St.a.LNGLAT:case St.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/Et*(180/Math.PI)),i=(r=t,a=e,a/Et*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(g,i);b=[x.xOffset,x.yOffset],_=[-180,-90];break;case St.a.IDENTITY:_=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=Tt(o-i[0],n[0])+i[0],c=Tt(r-i[1],n[1])+i[1],l=(new Pt.a).translate([-1*u,-1*c,0]),f=[u,c],h=s-o+n[0],d=a-r+n[1],v=[Math.ceil(h/n[0]),Math.ceil(d/n[1])];return{gridOrigin:f,gridSize:v,width:h,height:d,gridTransformMatrix:l}}({boundingBox:g,cellSize:b,worldOrigin:_});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:b,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:b,boundingBox:g}}function Tt(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Lt=[255,255,255,255],Mt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},It=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new Y(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ce.a(this._getLineLayerProps()),r&&new Ae.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=At({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:f,gridOrigin:h,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking",j.fp64]})}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new j.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new j.CubeGeometry,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,f=n.gridOffset,h=n.elevationRange,d=[Object(Ft.c)(l[0]),Object(Ft.c)(l[1])],v=[Object(Ft.c)(f[0]),Object(Ft.c)(f[1])],g=this.getDomainUniforms(),p={colorMaxMinBuffer:i.color.maxMinBuffer,elevationMaxMinBuffer:i.elevation.maxMinBuffer},m=x(this.props.colorRange,Float32Array,255);this.bindUniformBuffers(p),this.state.model.setUniforms(Object.assign({},t,g,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:d,gridOffset:f,gridOffsetLow:v,colorRange:m,elevationRange:h})).draw(),this.unbindUniformBuffers(p)}},{key:"bindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.bind({target:35345,index:0}),n.bind({target:35345,index:1})}},{key:"unbindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.unbind({target:35345,index:0}),n.unbind({target:35345,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(b.a);Nt.layerName="GPUGridCellLayer",Nt.defaultProps=Dt;var zt={colorDomain:null,colorRange:_,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new j.PhongMaterial,gpuAggregation:!0},Bt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=Y.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new Y(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=Y.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=Y.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,f=c.getPosition,h=this.state.gridHash;if(!h)h=le(l,this.props.cellSize,f).gridHash,this.setState({gridHash:h});var d=h[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,f=At({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:A[s]||A[zt.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:A[c]||A[zt.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),h=f.weights,d=f.gridSize,v=f.gridOrigin,g=f.cellSize,p=f.boundingBox;this.setState({weights:h,gridSize:d,gridOrigin:v,cellSize:g,boundingBox:p})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.elevationRange,s=e.colorDomain,u=e.elevationDomain,c=this.state,l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=x(this.props.colorRange,Float32Array,255);return new(this.getSubLayerClass("gpu-grid-cell",Nt))({gridSize:f,gridOrigin:h,gridOffset:d,colorRange:v,elevationRange:o,colorDomain:s,elevationDomain:u,cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:l,numInstances:f[0]*f[1]})}}]),t}(ne.a);Bt.layerName="GPUGridLayer",Bt.defaultProps=zt;var Ut=Object.assign({},Bt.defaultProps,ge.defaultProps,{gpuAggregation:!1}),Vt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",Bt):this.getSubLayerClass("CPU",ge))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!Y.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(ne.a);Vt.layerName="GridLayer",Vt.defaultProps=Ut,n.d(t,"experimental",function(){return Gt}),n.d(t,"ScreenGridLayer",function(){return te}),n.d(t,"CPUGridLayer",function(){return ge}),n.d(t,"HexagonLayer",function(){return ke}),n.d(t,"ContourLayer",function(){return It}),n.d(t,"GridLayer",function(){return Vt}),n.d(t,"GPUGridLayer",function(){return Bt}),n.d(t,"AGGREGATION_OPERATION",function(){return A}),n.d(t,"_GPUGridAggregator",function(){return Y});var Gt={BinSorter:ae,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:ue,quantizeScale:oe,getQuantizeScale:se,defaultColorRange:_}},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(53),p=n(62),m=n(85),y=n(1),b=Math.PI/180,_=new Float32Array(16),x=new Float32Array(12);function w(e,t,n){var i=t[0]*b,r=t[1]*b,a=t[2]*b,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),f=Math.cos(r),h=n[0],d=n[1],v=n[2];e[0]=h*f*l,e[1]=h*u*l,e[2]=h*-s,e[3]=d*(-u*c+f*s*o),e[4]=d*(f*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+f*s*c),e[7]=v*(-f*o+u*s*c),e[8]=v*l*c}function O(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var P={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),f=l&&16===c.length,h=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),p=f||!l&&Boolean(c(a[0]));e.constant=p?f:d&&h&&v;var m=e.value;if(e.constant){var y;if(p)_.set(c),y=O(_);else w(y=x,o,s),y.set(u,9);e.value=new Float32Array(y)}else{var b=n*e.size,P=Object(g.a)(a,n,i),S=P.iterable,k=P.objectInfo,j=!0,E=!1,C=void 0;try{for(var A,T=S[Symbol.iterator]();!(j=(A=T.next()).done);j=!0){var L=A.value;k.index++;var M=void 0;if(p)_.set(f?c:c(L,k)),M=O(_);else w(M=x,d?o:o(L,k),h?s:s(L,k)),M.set(v?u:u(L,k),9);m[b++]=M[0],m[b++]=M[1],m[b++]=M[2],m[b++]=M[3],m[b++]=M[4],m[b++]=M[5],m[b++]=M[6],m[b++]=M[7],m[b++]=M[8],m[b++]=M[9],m[b++]=M[10],m[b++]=M[11]}}catch(e){E=!0,C=e}finally{try{j||null==T.return||T.return()}finally{if(E)throw C}}}}};function S(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function k(e){if(e.attributes)return S(e.attributes),e instanceof y.Geometry?e:new y.Geometry(e);if(e.positions||e.POSITION)return S(e),new y.Geometry({attributes:e});throw Error("Invalid mesh")}var j={mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},wireframe:!1,material:new y.PhongMaterial,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},E=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=Object(y.isWebGL2)(this.context.gl),n=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n",i=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor / 255., color.a);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor / 255., color.a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";return h()(l()(t.prototype),"getShaders",this).call(this,{vs:n,fs:i,modules:["project32","phong-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{transition:!0,size:this.props.colorFormat.length,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:P}),this.setState({emptyTexture:new y.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||r.extensionsChanged){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new y.Model(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:k(e),isInstanced:!0,shaderCache:this.context.shaderCache})),n=this.state,i=n.texture,r=n.emptyTexture;return t.setUniforms({sampler:i||r,hasTexture:Boolean(i)}),t}},{key:"setTexture",value:function(e){var t=this.context.gl,n=this.state,i=n.emptyTexture,r=n.model;this.state.texture&&this.state.texture.delete();var a=e?function(e,t,n){return t instanceof y.Texture2D?t:new y.Texture2D(e,Object.assign({data:t},n))}(t,e):null;this.setState({texture:a}),r&&r.setUniforms({sampler:a||i,hasTexture:Boolean(a)})}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);E.layerName="SimpleMeshLayer",E.defaultProps=j;var C=n(34),A=n.n(C),T=n(5),L=n(6),M=n(81),I=n(11),F=n(10),R=n(12),D=n(89),N=n(20),z=n(13);var B=n(35),U=n(32);function V(){var e=new z.a(4);return z.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function G(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function W(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=i*l+o*s+r*c-a*u,e[1]=r*l+o*u+a*s-i*c,e[2]=a*l+o*c+i*u-r*s,e[3]=o*l-i*s-r*u-a*c,e}function H(e,t,n,i){var r,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=n[0],v=n[1],g=n[2],p=n[3];return(a=c*d+l*v+f*g+h*p)<0&&(a=-a,d=-d,v=-v,g=-g,p=-p),1-a>z.b?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,u=Math.sin(i*r)/o):(s=1-i,u=i),e[0]=s*c+u*d,e[1]=s*l+u*v,e[2]=s*f+u*g,e[3]=s*h+u*p,e}function X(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*n,n=.5/n,e[3]=(t[3*a+o]-t[3*o+a])*n,e[a]=(t[3*a+r]+t[3*r+a])*n,e[o]=(t[3*o+r]+t[3*r+o])*n}return e}U.b,U.g,U.c;var q,Z,Y,K,Q,J,$,ee=U.l,te=U.a,ne=U.k,ie=U.d,re=U.i,ae=U.h,oe=U.m,se=U.j,ue=(U.f,U.e,q=B.b(),Z=B.e(1,0,0),Y=B.e(0,1,0),function(e,t,n){var i=B.d(t,n);return i<-.999999?(B.c(q,Z,t),B.f(q)<1e-6&&B.c(q,Y,t),B.i(q,q),G(e,q,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(B.c(q,t,n),e[0]=q[0],e[1]=q[1],e[2]=q[2],e[3]=1+i,se(e,e))}),ce=(K=V(),Q=V(),J=new z.a(9),z.a!=Float32Array&&(J[1]=0,J[2]=0,J[3]=0,J[5]=0,J[6]=0,J[7]=0),J[0]=1,J[4]=1,J[8]=1,$=J,[0,0,0,1]);var le=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(T.a)(this,t),e=Object(I.a)(this,Object(F.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,a),e}return Object(R.a)(t,e),Object(L.a)(t,[{key:"fromMatrix3",value:function(e){return X(this,e),this.check()}},{key:"fromValues",value:function(e,t,n,i){return this.set(e,t,n,i)}},{key:"identity",value:function(){var e;return(e=this)[0]=0,e[1]=0,e[2]=0,e[3]=1,this.check()}},{key:"length",value:function(){return ae(this)}},{key:"squaredLength",value:function(e){return oe(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ie(this,e)}},{key:"rotationTo",value:function(e,t){return ue(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return te(this,e),this.check()}},{key:"calculateW",value:function(){var e,t,n,i,r;return e=this,n=(t=this)[0],i=t[1],r=t[2],e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),this.check()}},{key:"conjugate",value:function(){var e,t;return t=this,(e=this)[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],this.check()}},{key:"invert",value:function(){var e,t,n,i,r,a,o,s;return e=this,n=(t=this)[0],i=t[1],r=t[2],a=t[3],s=(o=n*n+i*i+r*r+a*a)?1/o:0,e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=a*s,this.check()}},{key:"lerp",value:function(e,t,n){return re(this,e,t,n),this.check()}},{key:"multiply",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.multiply only takes one argument");return W(this,this,e),this.check()}},{key:"normalize",value:function(){return se(this,this),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+o*s,e[1]=r*u+a*s,e[2]=a*u-r*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u-a*s,e[1]=r*u+o*s,e[2]=a*u+i*s,e[3]=o*u-r*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return ne(this,this,e),this.check()}},{key:"set",value:function(e,t,n,i){return ee(this,e,t,n,i),this.check()}},{key:"setAxisAngle",value:function(e,t){return G(this,e,t),this.check()}},{key:"slerp",value:function(e){var t=e.start;return H(this,void 0===t?ce:t,e.target,e.ratio),this.check()}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=Object(N.a)(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=Object(N.a)(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(N.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(N.a)(e)}}]),t}(D.a),fe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},he={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function de(e){if(!e._animation){var t=he[e.componentType],n=fe[e.type],i=n*e.count,r=e.bufferView.data,a=new t(r.buffer,r.byteOffset+(e.byteOffset||0),i);if(1===n)e._animation=Array.from(a);else{for(var o=[],s=0;s=s}),c=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:y.log.warn("Bad animation path ".concat(i))()}Object(y.assert)(n[i].length===o[c].length);var l=r[c],f=r[u];switch(a){case"STEP":!function(e,t,n){for(var i=0;il){var h=(s-l)/(f-l);!function(e,t,n,i,r){if("rotation"===t){ge.slerp({start:n,target:i,ratio:r});for(var a=0;al){var d=(s-l)/(f-l),v=f-l;!function(e,t,n){for(var i=n.p0,r=n.outTangent0,a=n.inTangent1,o=n.p1,s=n.tDiff,u=n.ratio,c=0;c2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},r=new y.Texture2D(this.gl,{id:e.name||e.id,parameters:i,pixelStore:Object(_e.a)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1),data:e.texture.source.getImageAsync()});this.uniforms[t]=r,this.defineIfPresent(n,n),this.generatedTextures.push(r)}},{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 t=e.metallicFactor,n=void 0===t?1:t,i=e.roughnessFactor,r=void 0===i?1:i;this.uniforms.u_MetallicRoughnessValues=[n,r]}},{key:"parseMaterial",value:function(e){if(e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,n=void 0===t?1:t;this.uniforms.u_NormalScale=n}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,r=void 0===i?1:i;this.uniforms.u_OcclusionStrength=r}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(y.log.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]}))}}]),e}(),we="\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n",Oe="\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n";function Pe(e,t){return Object(y.isWebGL2)(e)?"#version 300 es\n".concat(t):t}var Se={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ke={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},je=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(T.a)(this,e),this.gl=t,this.options=Object.assign({},ke,n)}return Object(L.a)(e,[{key:"instantiate",value:function(e){var t=this;return this.gltf=e,(e.scenes||[]).map(function(e){return t.createScene(e)})}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new ye(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new y.GroupNode({id:e.name||e.id,children:n})}},{key:"createNode",value:function(e){var t=this;if(!e._node){var n=(e.children||[]).map(function(e){return t.createNode(e)});e.mesh&&n.push(this.createMesh(e.mesh));var i=new y.GroupNode({id:e.name||e.id,children:n});if(e.matrix)i.setMatrix(e.matrix);else{if(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation){var r=(new M.a).fromQuaternion(e.rotation);i.matrix.multiplyRight(r)}e.scale&&i.matrix.scale(e.scale)}e._node=i}return e._node}},{key:"createMesh",value:function(e){var t=this;if(!e._mesh){var n=(e.primitives||[]).map(function(n,i){return t.createPrimitive(n,i,e)}),i=new y.GroupNode({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){y.log.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,t,n){return function(e,t){var n=t.id,i=t.drawMode,r=t.vertexCount,a=t.attributes,o=t.modelOptions,s=new xe(e,t);y.log.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,Object(be.a)(s.generatedTextures)),u.push.apply(u,Object(be.a)(Object.values(a).map(function(e){return e.buffer})));var c=new y.ModelNode(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[y.pbr],defines:s.defines,parameters:s.parameters,vs:Pe(e,we),fs:Pe(e,Oe),managedResources:u},o));return c.setProps({attributes:a}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:e.name||"".concat(n.name||n.id,"-primitive-").concat(t),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))}},{key:"createAttributes",value:function(e,t){var n=this,i={};return Object.keys(e).forEach(function(t){i[t]=n.createAccessor(e[t],n.createBuffer(e[t],n.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),y.log.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}},{key:"createBuffer",value:function(e,t){e.bufferView||(e.bufferView={});var n=e.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new y.Buffer(this.gl,{id:"from-".concat(n.id),data:n.data||e.value,target:t})),n.lumaBuffers[t]}},{key:"createAccessor",value:function(e,t){return new y._Accessor({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Se[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();var Ee=n(31),Ce=n.n(Ee),Ae=n(104),Te=n.n(Ae);function Le(){return(Le=Te()(Ce.a.mark(function e(t){var n;return Ce.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach(function(e){e.traverse(function(e){Object.values(e.model.program.uniforms).forEach(function(e){!1===e.loaded&&n.push(e)})})}),e.next=4,Me(function(){return n.some(function(e){return!e.loaded})});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function Me(e){return Ie.apply(this,arguments)}function Ie(){return(Ie=Te()(Ce.a.mark(function e(t){return Ce.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise(function(e){return requestAnimationFrame(e)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}var Fe=[255,255,255,255],Re={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"===A()(e.scene)?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:Fe},_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:[]}},De=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{size:this.props.colorFormat.length,accessor:"getColor",defaultValue:Fe,transition:!0},instanceModelMatrix:P})}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;n.scenegraph!==i.scenegraph?this._updateScenegraph(n):n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t,n=this,i=this.context.gl;if(e.scenegraph instanceof y.ScenegraphNode)t={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,a=function(e,t,n){var i=new je(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(i,r,this.getLoadOptions());t=Object.assign({gltf:r},a),function(e){return Le.apply(this,arguments)}(a).then(function(){return n.setNeedsRedraw()})}else y.log.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader"),t=e.scenegraph;var o={layer:this,gl:i},s=e.getScene(t,o),u=e.getAnimator(t,o);s instanceof y.ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&y.log.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).sort().forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r0)return e;e=function(e){var t=e.padEnd(16,"0");return O.a.fromString(t,16)}(e)}return x.S2.S2Cell.toHilbertQuadkey(e.toString())}function j(e){var t=k(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],f=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,S*Math.pow(2,-c)),d=0;d<4;d++)for(var v=f[d].slice(0),g=f[d+1],p=(g[0]-v[0])/h,m=(g[1]-v[1])/h,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(M.g)([r[0],r[3]],e.scale).map(F),o=_()(a,2),s=o[0],u=o[1],c=Object(M.g)([r[2],r[1]],e.scale).map(F),l=_()(c,2),f=l[0],h=l[1];s=Math.max(0,Math.floor(s)),f=Math.min(e.scale,Math.ceil(f)),u=Math.max(0,Math.floor(u)),h=Math.min(e.scale,Math.ceil(h));for(var d=[],v=s;vt?d.push(R({x:v,y:g,z:i},t)):d.push({x:v,y:g,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),N={renderSubLayers:{type:"function",value:function(e){return new A.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},z=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new D({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new D({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var f=i.viewport,h=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==f.id&&this.state.tileCache.update(f,function(e){var n=e.filter(function(e){return e.z===h}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"color.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){h()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),h()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),f=Object(U.a)(a,n,i),h=f.iterable,d=f.objectInfo,v=0,g=0;g180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function Q(e,t,n){var i=e(t,n),r=Object(G.h3ToGeo)(i),a=_()(r,2),o=a[0];return[a[1],o]}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(G.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(G.h3ToGeo)(e),r=_()(i,2),a=r[0],o=r[1],s=t.length;K(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(G.edgeLength)(i,G.UNITS.km):0,hasPentagon:r})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(G.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(G.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=J(a),u=Object(G.h3ToGeo)(a),c=_()(u,2),l=c[0],f=c[1],h=e.projectFlat([f,l]),d=_()(h,2),v=d[0],g=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-g)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.material,i=e.coverage,r=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getColor,d=e.getFillColor,v=e.getElevation,g=e.getLineColor,p=e.getLineWidth,m=e.updateTriggers;return{elevationScale:t,extruded:r,coverage:i,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:n,getElevation:v,getFillColor:h||d,getLineColor:g,getLineWidth:p,updateTriggers:{getFillColor:m.getColor||m.getFillColor,getElevation:m.getElevation,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===q()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return J(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",Y.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Q.bind(null,n)})}}]),t}(m.a);ee.defaultProps=$,ee.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return p}),n.d(t,"S2Layer",function(){return C}),n.d(t,"TileLayer",function(){return z}),n.d(t,"TripsLayer",function(){return V}),n.d(t,"H3ClusterLayer",function(){return H}),n.d(t,"H3HexagonLayer",function(){return ee})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(34),u=n.n(s);var c=n(111),l=n(140),f=n(141),h=n(142),d=n(7),v=n.n(d),g=n(4),p=n.n(g),m=n(8),y=n.n(m),b={fetch:function(e){return JSON.parse(e)},configuration:[]},_=function(e){function t(){return r()(this,t),v()(this,p()(t).apply(this,arguments))}return y()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layers:[]}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps;(e.changeFlags.dataChanged||t.configuration!==n.configuration)&&(this.state.layers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t){var n={};for(var i in e){var r=e[i];i.startsWith("get")?n[i]=D(r,t):n[i]=r}return n}(e,t);return r.fetch=N,i&&new i(r)})}(t.data,t.configuration))}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(134).a);function x(e,t){var n=function(e){if("string"==typeof e){var t=O[e];return t||(t=e.split("."),O[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=w(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function w(e){return null!==e&&"object"===u()(e)}_.layerName="JSONLayer",_.defaultProps=b;var O={};var P={},S={},k=34,j=10,E=13;function C(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var A=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return S;if(c)return c=!1,P;var t,i,r=o;if(e.charCodeAt(r)===k){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===j?c=!0:i===E&&(c=!0,e.charCodeAt(o)===j&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u]);Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var z=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=R(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return z}),n.d(t,"_JSONLayer",function(){return _})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(135);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},f=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":t="pointermove",i=e._onPointerMove;break;case"mouseout":t="pointerleave",i=e._onPointerMove;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv().firstChild,i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),f=new google.maps.Point(0,0),h=a.fromContainerPixelToLatLng(f),d=a.fromLatLngToDivPixel(h),v=(c.x-l.x)/i,g=Math.log2(v)+e.getZoom()-1,p=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(p),y=m.lat(),b=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:g,pitch:e.getTilt(),latitude:y,longitude:b}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,f=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:f?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return f})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(135),u=n(112);function c(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[770,771,1,771],blendEquation:32774},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:l(t)}),i=new s.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:l(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=h(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[f(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function l(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new u.a(Object.assign({x:0,y:0,width:e.width,height:e.height},l(t),n?{nearZMultiplier:e.height?1/e.height:1,farZMultiplier:1}:{nearZMultiplier:.1,farZMultiplier:10}))}function h(e,t){return e.layerManager.getLayers().filter(t)}function d(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function v(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var g=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=c({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),v(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),v(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&v(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=f(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:h(n,function(e){return d(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return g})},function(e,t,n){"use strict";var i=n(29),r=n(23),a=n(0),o=n(5),s=n(6),u=n(68);var c=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var f={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(e){return"string"==typeof e?f[e.toUpperCase()]||f.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(63);n.d(t,"a",function(){return b});var g={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!1,priority:0};function m(){}var y={};var b=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(163)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var f=new Image;return f.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(f,i,o)))},f.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=h(a),r="[".concat(a,"m").concat(r,"")),o&&(a=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();b.VERSION=u.a},function(e,t,n){"use strict";var i=n(5),r=n(6),a=n(63),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()}])}); From 5023007801b1aec5929e1015a613e33767cf0fa8 Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 27 Jul 2019 20:55:51 +1000 Subject: [PATCH 04/24] setup structure for #201 --- NAMESPACE | 2 + R/RcppExports.R | 12 ++ R/map_layer_heatmap.R | 148 ++++++++++++++++++++++++ R/map_layer_screengrid.R | 2 +- R/mapdeck_map_utilities.R | 2 +- inst/htmlwidgets/lib/heatmap/heatmap.js | 55 +++++++++ man/add_heatmap.Rd | 88 ++++++++++++++ man/add_screengrid.Rd | 2 +- man/clear.Rd | 12 +- src/RcppExports.cpp | 44 +++++++ src/heatmap.cpp | 96 +++++++++++++++ 11 files changed, 456 insertions(+), 7 deletions(-) create mode 100644 R/map_layer_heatmap.R create mode 100644 inst/htmlwidgets/lib/heatmap/heatmap.js create mode 100644 man/add_heatmap.Rd create mode 100644 src/heatmap.cpp diff --git a/NAMESPACE b/NAMESPACE index bf0e528a..65d966bd 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -49,6 +49,7 @@ export(add_dependencies) export(add_geojson) export(add_greatcircle) export(add_grid) +export(add_heatmap) export(add_hexagon) export(add_line) export(add_mesh) @@ -68,6 +69,7 @@ export(clear_column) export(clear_geojson) export(clear_greatcircle) export(clear_grid) +export(clear_heatmap) export(clear_hexagon) export(clear_legend) export(clear_line) diff --git a/R/RcppExports.R b/R/RcppExports.R index 340cc689..4e0b879a 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -53,6 +53,18 @@ rcpp_grid_polyline <- function(data, params, geometry_columns) { .Call(`_mapdeck_rcpp_grid_polyline`, data, params, geometry_columns) } +rcpp_heatmap_geojson <- function(data, params, geometry_columns, digits) { + .Call(`_mapdeck_rcpp_heatmap_geojson`, data, params, geometry_columns, digits) +} + +rcpp_heatmap_geojson_df <- function(data, params, geometry_columns, digits) { + .Call(`_mapdeck_rcpp_heatmap_geojson_df`, data, params, geometry_columns, digits) +} + +rcpp_heatmap_polyline <- function(data, params, geometry_columns) { + .Call(`_mapdeck_rcpp_heatmap_polyline`, data, params, geometry_columns) +} + rcpp_hexagon_geojson <- function(data, params, geometry_columns, digits) { .Call(`_mapdeck_rcpp_hexagon_geojson`, data, params, geometry_columns, digits) } diff --git a/R/map_layer_heatmap.R b/R/map_layer_heatmap.R new file mode 100644 index 00000000..5fab4c6f --- /dev/null +++ b/R/map_layer_heatmap.R @@ -0,0 +1,148 @@ +mapdeckHeatmapDependency <- function() { + list( + createHtmlDependency( + name = "heatmap", + version = "1.0.0", + src = system.file("htmlwidgets/lib/heatmap", package = "mapdeck"), + script = c("heatmap.js"), + all_files = FALSE + ) + ) +} + + +#' Add Heatmap +#' +#' The Screen Grid Layer takes in an array of latitude and longitude coordinated points, +#' aggregates them into histogram bins and renders as a grid +#' +#' @inheritParams add_polygon +#' @param lon column containing longitude values +#' @param lat column containing latitude values +#' @param weight the weight of each value. Default 1 +#' @param colour_range vector of 6 hex colours +#' +#' @inheritSection add_polygon data +#' +#' @examples +#' \donttest{ +#' +#' ## You need a valid access token from Mapbox +#' key <- 'abc' +#' set_token( key ) +#' +#' df <- read.csv(paste0( +#' 'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/', +#' 'examples/3d-heatmap/heatmap-data.csv' +#' )) +#' +#' df <- df[ !is.na(df$lng), ] +#' df$weight <- sample(1:10, size = nrow(df), replace = T) +#' +#' mapdeck( style = mapdeck_style('dark'), pitch = 45 ) %>% +#' add_heatmap( +#' data = df[1:1000, ] +#' , lat = "lat" +#' , lon = "lng" +#' , weight = "weight", +#' , layer_id = "heatmap_layer" +#' ) +#' +#' ## as an sf object +#' library(sf) +#' sf <- sf::st_as_sf( df, coords = c("lng", "lat")) +#' mapdeck( token = key, style = mapdeck_style('dark'), pitch = 45 ) %>% +#' add_heatmap( +#' data = sf +#' , weight = "weight", +#' , layer_id = "heatmap_layer" +#' ) +#' +#' } +#' +#' @details +#' +#' \code{add_heatmap} supports POINT and MULTIPOINT sf objects +#' +#' @export +add_heatmap <- function( + map, + data = get_map_data(map), + lon = NULL, + lat = NULL, + polyline = NULL, + weight = NULL, + colour_range = NULL, + layer_id = NULL, + update_view = TRUE, + focus_layer = FALSE, + digits = 6 +) { + l <- list() + l[["polyline"]] <- force( polyline ) + l[["weight"]] <- force( weight ) + l[["lon"]] <- force( lon ) + l[["lat"]] <- force( lat ) + + l <- resolve_data( data, l, c("POINT","MULTIPOINT") ) + + bbox <- init_bbox() + update_view <- force( update_view ) + focus_layer <- force( focus_layer ) + + if ( !is.null(l[["data"]]) ) { + data <- l[["data"]] + l[["data"]] <- NULL + } + + if( !is.null(l[["bbox"]] ) ) { + bbox <- l[["bbox"]] + l[["bbox"]] <- NULL + } + + ## parmater checks + #usePolyline <- isUsingPolyline(polyline) + layer_id <- layerId(layer_id, "heatmap") + + if( is.null( colour_range ) ) { + colour_range <- colourvalues::colour_values(1:6, palette = "viridis") + } + + if(length(colour_range) != 6) + stop("mapdeck - colour_range must have 6 hex colours") + ## end parameter checks + + checkHex(colour_range) + + map <- addDependency(map, mapdeckHeatmapDependency()) + + tp <- l[["data_type"]] + l[["data_type"]] <- NULL + + jsfunc <- "add_heatmap_geo" + if( tp == "sf" ) { + geometry_column <- c( "geometry" ) + shape <- rcpp_heatmap_geojson( data, l, geometry_column, digits ) + } else if ( tp == "df" ) { + geometry_column <- list( geometry = c("lon", "lat") ) + shape <- rcpp_heatmap_geojson_df( data, l, geometry_column, digits ) + } else if ( tp == "sfencoded" ) { + geometry_column <- "polyline" + shape <- rcpp_heatmap_polyline( data, l, geometry_column ) + jsfunc <- "add_heatmap_polyline" + } + + invoke_method( + map, jsfunc, map_type( map ), shape[["data"]], layer_id, colour_range, + bbox, update_view, focus_layer + ) +} + + +#' @rdname clear +#' @export +clear_heatmap <- function( map, layer_id = NULL) { + layer_id <- layerId(layer_id, "heatmap") + invoke_method(map, "md_layer_clear", map_type( map ), layer_id, "heatmap" ) +} + diff --git a/R/map_layer_screengrid.R b/R/map_layer_screengrid.R index 7a57f6dd..b59e493a 100644 --- a/R/map_layer_screengrid.R +++ b/R/map_layer_screengrid.R @@ -45,7 +45,7 @@ mapdeckScreengridDependency <- function() { #' #' mapdeck( style = mapdeck_style('dark'), pitch = 45 ) %>% #' add_screengrid( -#' data = df[1:1000, ] +#' data = df #' , lat = "lat" #' , lon = "lng" #' , weight = "weight", diff --git a/R/mapdeck_map_utilities.R b/R/mapdeck_map_utilities.R index 1f8b54cc..cdb9b1a7 100644 --- a/R/mapdeck_map_utilities.R +++ b/R/mapdeck_map_utilities.R @@ -137,7 +137,7 @@ layerId <- function( } mapdeck_layers <- function() { - c("arc", "bitmap", "column", "geojson", "greatcircle","grid","hexagon", + c("arc", "bitmap", "column", "geojson", "greatcircle","grid","heatmap","hexagon", "line", "mesh", "path","pointcloud", "polygon","scatterplot", "screengrid", "text", "title","trips") } diff --git a/inst/htmlwidgets/lib/heatmap/heatmap.js b/inst/htmlwidgets/lib/heatmap/heatmap.js new file mode 100644 index 00000000..711e9d08 --- /dev/null +++ b/inst/htmlwidgets/lib/heatmap/heatmap.js @@ -0,0 +1,55 @@ +function add_heatmap_geo( map_id, map_type, heatmap_data, layer_id, colour_range, bbox, update_view, focus_layer ) { + + const heatmapLayer = new deck.HeatmapLayer({ + map_id: map_id, + id: 'screengrid-'+layer_id, + data: heatmap_data, + pickable: true, + + radiusPixels: 30, + intensity: 1, + enhanceFactor: 20, + colorRange: md_to_rgba( colour_range ), + + getPosition: d => md_get_point_coordinates( d ), + getWeight: d => d.properties.weight, + + onClick: info => md_layer_click( map_id, "heatmap", info ), + + }); + + console.log( heatmapLayer ); + + if( map_type == "google_map") { + md_update_overlay( map_id, 'heatmap-'+layer_id, heatmapLayer ); + } else { + md_update_layer( map_id, 'heatmap-'+layer_id, heatmapLayer ); + } + md_layer_view( map_id, map_type, layer_id, focus_layer, bbox, update_view ); +} + +function add_heatmap_polyline( map_id, map_type, heatmap_data, layer_id, colour_range, bbox, update_view, focus_layer ) { + + const heatmapLayer = new deck.HeatmapLayer({ + map_id: map_id, + id: 'screengrid-'+layer_id, + data: heatmap_data, + pickable: true, + + radiusPixels: 30, + intensity: 1, + enhanceFactor: 20, + colorRange: md_to_rgba( colour_range ), + + getPosition: d => md_get_point_coordinates( d ), + getWeight: d => d.properties.weight, + + onClick: info => md_layer_click( map_id, "heatmap", info ), + }); + if( map_type == "google_map") { + md_update_overlay( map_id, 'heatmap-'+layer_id, heatmapLayer ); + } else { + md_update_layer( map_id, 'heatmap-'+layer_id, heatmapLayer ); + } + md_layer_view( map_id, map_type, layer_id, focus_layer, bbox, update_view ); +} diff --git a/man/add_heatmap.Rd b/man/add_heatmap.Rd new file mode 100644 index 00000000..e5ef1d4b --- /dev/null +++ b/man/add_heatmap.Rd @@ -0,0 +1,88 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/map_layer_heatmap.R +\name{add_heatmap} +\alias{add_heatmap} +\title{Add Heatmap} +\usage{ +add_heatmap(map, data = get_map_data(map), lon = NULL, lat = NULL, + polyline = NULL, weight = NULL, colour_range = NULL, + layer_id = NULL, update_view = TRUE, focus_layer = FALSE, + digits = 6) +} +\arguments{ +\item{map}{a mapdeck map object} + +\item{data}{data to be used in the layer. All coordinates are expected to be +EPSG:4326 (WGS 84) coordinate system} + +\item{lon}{column containing longitude values} + +\item{lat}{column containing latitude values} + +\item{polyline}{optional column of \code{data} containing the polylines, if using encoded polylines} + +\item{weight}{the weight of each value. Default 1} + +\item{colour_range}{vector of 6 hex colours} + +\item{layer_id}{single value specifying an id for the layer. Use this value to +distinguish between shape layers of the same type. Layers with the same id are likely +to conflict and not plot correctly} + +\item{update_view}{logical indicating if the map should update the bounds to include this layer} + +\item{focus_layer}{logical indicating if the map should update the bounds to only include this layer} +} +\description{ +The Screen Grid Layer takes in an array of latitude and longitude coordinated points, +aggregates them into histogram bins and renders as a grid +} +\details{ +\code{add_heatmap} supports POINT and MULTIPOINT sf objects +} +\section{data}{ + + +If the \code{data} is a simple feature object, the geometry column is automatically +detected. If the sf object contains more than one geometry column and you want to use a specific one, +you'll need to set the active geometry using \code{sf::st_geometry( x ) <- "your_column" }, +where \code{"your_column"} is the name of the column you're activating. See \code{?sf::st_geometry} +} + +\examples{ +\donttest{ + +## You need a valid access token from Mapbox +key <- 'abc' +set_token( key ) + +df <- read.csv(paste0( +'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/', +'examples/3d-heatmap/heatmap-data.csv' +)) + +df <- df[ !is.na(df$lng), ] +df$weight <- sample(1:10, size = nrow(df), replace = T) + +mapdeck( style = mapdeck_style('dark'), pitch = 45 ) \%>\% +add_heatmap( + data = df[1:1000, ] + , lat = "lat" + , lon = "lng" + , weight = "weight", + , layer_id = "heatmap_layer" +) + +## as an sf object +library(sf) +sf <- sf::st_as_sf( df, coords = c("lng", "lat")) +mapdeck( token = key, style = mapdeck_style('dark'), pitch = 45 ) \%>\% +add_heatmap( + data = sf + , weight = "weight", + , layer_id = "heatmap_layer" +) + +} + +} diff --git a/man/add_screengrid.Rd b/man/add_screengrid.Rd index 3b7879f5..cf11bf96 100644 --- a/man/add_screengrid.Rd +++ b/man/add_screengrid.Rd @@ -74,7 +74,7 @@ df$weight <- sample(1:10, size = nrow(df), replace = T) mapdeck( style = mapdeck_style('dark'), pitch = 45 ) \%>\% add_screengrid( - data = df[1:1000, ] + data = df , lat = "lat" , lon = "lng" , weight = "weight", diff --git a/man/clear.Rd b/man/clear.Rd index 80c899c5..e1e3c140 100644 --- a/man/clear.Rd +++ b/man/clear.Rd @@ -1,10 +1,11 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/map_layer_arc.R, R/map_layer_bitmap.R, % R/map_layer_column.R, R/map_layer_geojson.R, R/map_layer_greatcircle.R, -% R/map_layer_grid.R, R/map_layer_hexagon.R, R/map_layer_line.R, -% R/map_layer_mesh.R, R/map_layer_path.R, R/map_layer_pointcloud.R, -% R/map_layer_polygon.R, R/map_layer_scatterplot.R, R/map_layer_screengrid.R, -% R/map_layer_text.R, R/map_layer_title.R, R/map_layer_trips.R +% R/map_layer_grid.R, R/map_layer_heatmap.R, R/map_layer_hexagon.R, +% R/map_layer_line.R, R/map_layer_mesh.R, R/map_layer_path.R, +% R/map_layer_pointcloud.R, R/map_layer_polygon.R, R/map_layer_scatterplot.R, +% R/map_layer_screengrid.R, R/map_layer_text.R, R/map_layer_title.R, +% R/map_layer_trips.R \name{clear_arc} \alias{clear_arc} \alias{clear_bitmap} @@ -12,6 +13,7 @@ \alias{clear_geojson} \alias{clear_greatcircle} \alias{clear_grid} +\alias{clear_heatmap} \alias{clear_hexagon} \alias{clear_line} \alias{clear_mesh} @@ -37,6 +39,8 @@ clear_greatcircle(map, layer_id = NULL) clear_grid(map, layer_id = NULL) +clear_heatmap(map, layer_id = NULL) + clear_hexagon(map, layer_id = NULL) clear_line(map, layer_id = NULL) diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 2b34018d..e659a50d 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -183,6 +183,47 @@ BEGIN_RCPP return rcpp_result_gen; END_RCPP } +// rcpp_heatmap_geojson +Rcpp::List rcpp_heatmap_geojson(Rcpp::DataFrame data, Rcpp::List params, std::string geometry_columns, int digits); +RcppExport SEXP _mapdeck_rcpp_heatmap_geojson(SEXP dataSEXP, SEXP paramsSEXP, SEXP geometry_columnsSEXP, SEXP digitsSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::DataFrame >::type data(dataSEXP); + Rcpp::traits::input_parameter< Rcpp::List >::type params(paramsSEXP); + Rcpp::traits::input_parameter< std::string >::type geometry_columns(geometry_columnsSEXP); + Rcpp::traits::input_parameter< int >::type digits(digitsSEXP); + rcpp_result_gen = Rcpp::wrap(rcpp_heatmap_geojson(data, params, geometry_columns, digits)); + return rcpp_result_gen; +END_RCPP +} +// rcpp_heatmap_geojson_df +Rcpp::List rcpp_heatmap_geojson_df(Rcpp::DataFrame data, Rcpp::List params, Rcpp::List geometry_columns, int digits); +RcppExport SEXP _mapdeck_rcpp_heatmap_geojson_df(SEXP dataSEXP, SEXP paramsSEXP, SEXP geometry_columnsSEXP, SEXP digitsSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::DataFrame >::type data(dataSEXP); + Rcpp::traits::input_parameter< Rcpp::List >::type params(paramsSEXP); + Rcpp::traits::input_parameter< Rcpp::List >::type geometry_columns(geometry_columnsSEXP); + Rcpp::traits::input_parameter< int >::type digits(digitsSEXP); + rcpp_result_gen = Rcpp::wrap(rcpp_heatmap_geojson_df(data, params, geometry_columns, digits)); + return rcpp_result_gen; +END_RCPP +} +// rcpp_heatmap_polyline +Rcpp::List rcpp_heatmap_polyline(Rcpp::DataFrame data, Rcpp::List params, Rcpp::StringVector geometry_columns); +RcppExport SEXP _mapdeck_rcpp_heatmap_polyline(SEXP dataSEXP, SEXP paramsSEXP, SEXP geometry_columnsSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::DataFrame >::type data(dataSEXP); + Rcpp::traits::input_parameter< Rcpp::List >::type params(paramsSEXP); + Rcpp::traits::input_parameter< Rcpp::StringVector >::type geometry_columns(geometry_columnsSEXP); + rcpp_result_gen = Rcpp::wrap(rcpp_heatmap_polyline(data, params, geometry_columns)); + return rcpp_result_gen; +END_RCPP +} // rcpp_hexagon_geojson Rcpp::List rcpp_hexagon_geojson(Rcpp::DataFrame data, Rcpp::List params, std::string geometry_columns, int digits); RcppExport SEXP _mapdeck_rcpp_hexagon_geojson(SEXP dataSEXP, SEXP paramsSEXP, SEXP geometry_columnsSEXP, SEXP digitsSEXP) { @@ -536,6 +577,9 @@ static const R_CallMethodDef CallEntries[] = { {"_mapdeck_rcpp_grid_geojson", (DL_FUNC) &_mapdeck_rcpp_grid_geojson, 4}, {"_mapdeck_rcpp_grid_geojson_df", (DL_FUNC) &_mapdeck_rcpp_grid_geojson_df, 4}, {"_mapdeck_rcpp_grid_polyline", (DL_FUNC) &_mapdeck_rcpp_grid_polyline, 3}, + {"_mapdeck_rcpp_heatmap_geojson", (DL_FUNC) &_mapdeck_rcpp_heatmap_geojson, 4}, + {"_mapdeck_rcpp_heatmap_geojson_df", (DL_FUNC) &_mapdeck_rcpp_heatmap_geojson_df, 4}, + {"_mapdeck_rcpp_heatmap_polyline", (DL_FUNC) &_mapdeck_rcpp_heatmap_polyline, 3}, {"_mapdeck_rcpp_hexagon_geojson", (DL_FUNC) &_mapdeck_rcpp_hexagon_geojson, 4}, {"_mapdeck_rcpp_hexagon_geojson_df", (DL_FUNC) &_mapdeck_rcpp_hexagon_geojson_df, 4}, {"_mapdeck_rcpp_hexagon_polyline", (DL_FUNC) &_mapdeck_rcpp_hexagon_polyline, 3}, diff --git a/src/heatmap.cpp b/src/heatmap.cpp new file mode 100644 index 00000000..52e3c697 --- /dev/null +++ b/src/heatmap.cpp @@ -0,0 +1,96 @@ +#include + +#include "mapdeck_defaults.hpp" +#include "layers/layer_colours.hpp" +#include "spatialwidget/spatialwidget.hpp" + +Rcpp::List heatmap_defaults(int n) { + return Rcpp::List::create( + _["weight"] = mapdeck::defaults::default_weight(n) + ); +} + + +// [[Rcpp::export]] +Rcpp::List rcpp_heatmap_geojson( + Rcpp::DataFrame data, Rcpp::List params, + std::string geometry_columns, int digits +) { + + int data_rows = data.nrows(); + + Rcpp::List lst_defaults = heatmap_defaults( data_rows ); // initialise with defaults + + std::unordered_map< std::string, std::string > heatmap_colours = mapdeck::layer_colours::no_colours; + Rcpp::StringVector heatmap_legend = mapdeck::layer_colours::no_legend; + Rcpp::StringVector parameter_exclusions = Rcpp::StringVector::create("legend","legend_options","palette","na_colour"); + + return spatialwidget::api::create_geojson_downcast( + data, + params, + lst_defaults, + heatmap_colours, + heatmap_legend, + data_rows, + parameter_exclusions, + geometry_columns, + true, // jsonify legend + digits + ); +} + + +// [[Rcpp::export]] +Rcpp::List rcpp_heatmap_geojson_df( + Rcpp::DataFrame data, Rcpp::List params, + Rcpp::List geometry_columns, int digits +) { + + int data_rows = data.nrows(); + + Rcpp::List lst_defaults = heatmap_defaults( data_rows ); // initialise with defaults + + std::unordered_map< std::string, std::string > heatmap_colours = mapdeck::layer_colours::no_colours; + Rcpp::StringVector heatmap_legend = mapdeck::layer_colours::no_legend; + Rcpp::StringVector parameter_exclusions = Rcpp::StringVector::create("legend","legend_options","palette","na_colour"); + + return spatialwidget::api::create_geojson( + data, + params, + lst_defaults, + heatmap_colours, + heatmap_legend, + data_rows, + parameter_exclusions, + geometry_columns, + true, // jsonify legend + digits + ); +} + +// [[Rcpp::export]] +Rcpp::List rcpp_heatmap_polyline( + Rcpp::DataFrame data, Rcpp::List params, + Rcpp::StringVector geometry_columns +) { + + int data_rows = data.nrows(); + + Rcpp::List lst_defaults = heatmap_defaults( data_rows ); // initialise with defaults + + std::unordered_map< std::string, std::string > heatmap_colours = mapdeck::layer_colours::no_colours; + Rcpp::StringVector heatmap_legend = mapdeck::layer_colours::no_legend; + Rcpp::StringVector parameter_exclusions = Rcpp::StringVector::create("legend","legend_options","palette","na_colour"); + + return spatialwidget::api::create_polyline( + data, + params, + lst_defaults, + heatmap_colours, + heatmap_legend, + data_rows, + parameter_exclusions, + geometry_columns, + true // jsonify legend + ); +} From 970795151acee3e0426ebf7de278540911ff6369 Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 27 Jul 2019 21:01:32 +1000 Subject: [PATCH 05/24] experimental layer --- R/map_layer_heatmap.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/map_layer_heatmap.R b/R/map_layer_heatmap.R index 5fab4c6f..4dc2c520 100644 --- a/R/map_layer_heatmap.R +++ b/R/map_layer_heatmap.R @@ -78,6 +78,9 @@ add_heatmap <- function( focus_layer = FALSE, digits = 6 ) { + + experimental_layer("heatmap") + l <- list() l[["polyline"]] <- force( polyline ) l[["weight"]] <- force( weight ) From e17eac5e02b30d7ff06116febd6616fc4a3acece Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Wed, 31 Jul 2019 09:19:48 +1000 Subject: [PATCH 06/24] trips documentation --- R/map_layer_trips.R | 2 +- man/add_trips.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/map_layer_trips.R b/R/map_layer_trips.R index 370d3503..37234cab 100644 --- a/R/map_layer_trips.R +++ b/R/map_layer_trips.R @@ -15,7 +15,7 @@ mapdeckTripsDependency <- function() { #' The Trips Layer takes an sf object with Z and M attributes and renders #' it as animated trips #' -#' @inheritParams add_polygon +#' @inheritParams add_path #' @param data sf object with XYZM dimensions. #' @param trail_length length in metres of the trail #' @param opacity single value in [0,1] diff --git a/man/add_trips.Rd b/man/add_trips.Rd index 5ada0c63..c39b2d31 100644 --- a/man/add_trips.Rd +++ b/man/add_trips.Rd @@ -19,7 +19,7 @@ add_trips(map, data = get_map_data(map), stroke_colour = NULL, \item{stroke_colour}{variable of \code{data} or hex colour for the stroke. If used, \code{elevation} is ignored.} -\item{stroke_width}{width of the stroke in meters. If used, \code{elevation} is ignored. Default 1.} +\item{stroke_width}{width of the stroke in meters. Default 1.} \item{opacity}{single value in [0,1]} From 98311d2f2c63b0512a161e1da86400402a1262ac Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Wed, 31 Jul 2019 09:20:55 +1000 Subject: [PATCH 07/24] trips documentation --- R/map_layer_trips.R | 1 + man/add_trips.Rd | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/map_layer_trips.R b/R/map_layer_trips.R index 37234cab..320f5a04 100644 --- a/R/map_layer_trips.R +++ b/R/map_layer_trips.R @@ -17,6 +17,7 @@ mapdeckTripsDependency <- function() { #' #' @inheritParams add_path #' @param data sf object with XYZM dimensions. +#' @param stroke_colour variable of data or hex colour for the stroke. #' @param trail_length length in metres of the trail #' @param opacity single value in [0,1] #' @param start_time the minimum timestamp diff --git a/man/add_trips.Rd b/man/add_trips.Rd index c39b2d31..8d119ad1 100644 --- a/man/add_trips.Rd +++ b/man/add_trips.Rd @@ -16,8 +16,7 @@ add_trips(map, data = get_map_data(map), stroke_colour = NULL, \item{data}{sf object with XYZM dimensions.} -\item{stroke_colour}{variable of \code{data} or hex colour for the stroke. If used, -\code{elevation} is ignored.} +\item{stroke_colour}{variable of data or hex colour for the stroke.} \item{stroke_width}{width of the stroke in meters. Default 1.} From c1a3ab5bf7fbc78ed2bcd4e9be058e89f8e980b7 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Wed, 7 Aug 2019 07:59:25 +1000 Subject: [PATCH 08/24] 7.2.0-beta.2 --- inst/htmlwidgets/lib/deckgl.min.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/htmlwidgets/lib/deckgl.min.js b/inst/htmlwidgets/lib/deckgl.min.js index 9c7cf510..ea307ef5 100644 --- a/inst/htmlwidgets/lib/deckgl.min.js +++ b/inst/htmlwidgets/lib/deckgl.min.js @@ -1,9 +1,9 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("h3"),require("S2"));else if("function"==typeof define&&define.amd)define(["h3","S2"],t);else{var n="object"==typeof exports?t(require("h3"),require("S2")):t(e.h3,e.S2);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=160)}([function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.r(t);var i=n(5),r=n(6),a=n(71),o=n(37),s=new(n(187).a)({id:"luma"}).enable(),u=n(188),c=(n(107),"7.2.0-alpha.1"),l=new(function(){function e(){Object(i.a)(this,e),this.stats=new Map}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new u.a({id:e})),this.stats.get(e)}}]),e}());if(o.b.luma&&o.b.luma.VERSION!==c)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(o.b.luma.VERSION," vs ").concat(c));o.b.luma||(a.a&&s.log(1,"luma.gl ".concat(c," - ").concat("set luma.log.priority=1 (or higher) to trace rendering"))(),o.b.luma=o.b.luma||{VERSION:c,version:c,log:s,stats:l,globals:{modules:{},nodeIO:{}}});o.b.luma;var f=n(52),h=n(21),d=n(23);function v(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var g={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(d.a)(t))},blendEquation:function(e,t){t=v(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(d.a)(t))},blendFunc:function(e,t){t=v(t)&&2===t.length?[].concat(Object(d.a)(t),Object(d.a)(t)):t,e.blendFuncSeparate.apply(e,Object(d.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(d.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(d.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(d.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(d.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(d.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(d.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=v(t)?t:[t,t],i=Object(h.a)(n,2),r=i[0],a=i[1];e.stencilMaskSeparate(1028,r),e.stencilMaskSeparate(1029,a)},stencilFunc:function(e,t){var n=t=v(t)&&3===t.length?[].concat(Object(d.a)(t),Object(d.a)(t)):t,i=Object(h.a)(n,6),r=i[0],a=i[1],o=i[2],s=i[3],u=i[4],c=i[5];e.stencilFuncSeparate(1028,r,a,o),e.stencilFuncSeparate(1029,s,u,c)},stencilOp:function(e,t){var n=t=v(t)&&3===t.length?[].concat(Object(d.a)(t),Object(d.a)(t)):t,i=Object(h.a)(n,6),r=i[0],a=i[1],o=i[2],s=i[3],u=i[4],c=i[5];e.stencilOpSeparate(1028,r,a,o),e.stencilOpSeparate(1029,s,u,c)},viewport:function(e,t){return e.viewport.apply(e,Object(d.a)(t))}};function p(e,t){for(var n in Object(f.f)(e,t),t){var i=g[n];i&&i(e,t[n],n)}}var m=n(67),y=n(49);function b(e,t,n){if(Object(y.b)(t))return n(e);var i,r=t.nocatch,a=void 0===r||r;if(Object(y.a)(!t.frameBuffer),Object(m.c)(e),p(e,t),a)i=n(e),Object(m.b)(e);else try{i=n(e)}finally{Object(m.b)(e)}return i}var _=n(26),x=n(0);function w(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"id";k[e]=k[e]||1;var t=k[e]++;return"".concat(e,"-").concat(t)}function E(e){return S("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function C(e){var t=!0;for(var n in e){t=!1;break}return t}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,i=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,i=void 0===n?16:n,r=t.size,a=void 0===r?1:r,o="[",s=0;s0&&(o+=",".concat(s%a==0?" ":"")),o+=A(e[s],t);var u=e.length>i?"...":"]";return"".concat(o).concat(u)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return i?"0":"0.";if(i)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var r=e.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function T(e,t,n,i){var r="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),a=Object.getPrototypeOf(e);i.forEach(function(e){a.methodName||(a[e]=function(){throw s.removed("Calling removed method ".concat(t,".").concat(e,": "),r)(),new Error(e)})})}function L(e,t,n){var i=n.removedProps,r=void 0===i?{}:i,a=n.deprecatedProps,o=void 0===a?{}:a,u=n.replacedProps,c=void 0===u?{}:u;for(var l in r)if(l in t){var f=r[l]?"".concat(e,".").concat(r[l]):"N/A";s.removed("".concat(e,".").concat(l),f)()}for(var h in o)if(h in t){var d=o[h];s.deprecated("".concat(e,".").concat(h),"".concat(e,".").concat(d))()}var v=null;for(var g in c)if(g in t){var p=c[g];s.deprecated("".concat(e,".").concat(g),"".concat(e,".").concat(p))(),(v=v||Object.assign({},t))[p]=t[g],delete v[g]}return v||t}var M,I=a.a&&"undefined"!=typeof document,F=I&&"complete"===document.readyState;function R(){return M||(M=I?new Promise(function(e,t){if(I&&"complete"===document.readyState)return F=!0,void e(document);window.onload=function(){F=!0,e(document)}}):Promise.resolve({})),M}function D(e){var t,n=e.canvas,i=e.width,r=e.height,a=e.onError,o=void 0===a?function(){}:a;return"string"==typeof n?(F||o("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:o}),t}function N(e){var t=e.getParameter(7936),n=e.getParameter(7937),i=e.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&e.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||t,renderer:i&&e.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}var z="Invalid WebGLRenderingContext",B="Requires WebGL2";function U(e){return Boolean(e&&Number.isFinite(e._version))}function V(e){return Boolean(e&&2===e._version)}function G(e){S(U(e),z)}function W(e){S(V(e),B)}function H(e){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function X(e){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var q="Failed to deduce GL constant from typed array";function Z(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(q)}}function Y(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function K(e){for(var t=e.data,n=e.width,i=e.height,r=Math.round(n/2),a=Math.round(i/2),o=new Uint8Array(r*a*4),s=0;s1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),G(t);var r=n.id,a=n.userData,o=void 0===a?{}:a;this.gl=t,this.id=r||j(this.constructor.name),this.userData=o,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S(e=Q(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=V(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=V(this.gl),o={},s=n||Object.keys(r),u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value,v=r[d];if(v&&(!("webgl2"in v)||a)&&(!("extension"in v)||this.gl.getExtension(v.extension))){var g=i?J(this.gl,d):d;o[g]=this.getParameter(d,e),i&&"GLenum"===v.type&&(o[g]=J(this.gl,o[g]))}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return o}},{key:"setParameter",value:function(e,t){S(e=Q(this.gl,e));var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=V(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Q(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return T(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(ie)}},{key:"_deleteHandle",value:function(){throw new Error(ie)}},{key:"_bindHandle",value:function(){throw new Error(ie)}},{key:"_getOptsFromHandle",value:function(){throw new Error(ie)}},{key:"_getParameter",value:function(e,t){throw new Error(ie)}},{key:"_setParameter",value:function(e,t){throw new Error(ie)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=l.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;l.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=l.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=l.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}(),ae=n(123);function oe(e,t,n){return(oe=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&Object(ae.a)(r,n.prototype),r}).apply(null,arguments)}var se,ue,ce,le={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},fe={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},he=function(){function e(){var t=this;Object(i.a)(this,e);for(var n=arguments.length,r=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=L("Accessor",e,fe)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}(),de={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"},ve={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:de},ge={removedProps:de},pe=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/he.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/he.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=L("Buffer",e,ve),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=L("Buffer",e,ge))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new he(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;S(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(W(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return W(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;W(this.gl);var c,l,f=Y(this.accessor.type||5126,{clamped:!1}),h=this._getAvailableElementCount(r),d=o;n?c=(l=n.length)-d:l=d+(c=Math.min(h,u||h));var v=Math.min(h,c);return S((u=u||v)<=v),n=n||new f(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(S(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;S(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=Z(e);return S(i),this.setAccessor(new he(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;S(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/Y(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new he(this.accessor,{type:Z(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return s.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return s.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new he(this.accessor,e),this}},{key:"type",get:function(){return s.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return s.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(re),me=(se={},Object(x.a)(se,6407,{dataFormat:6407,types:[5121,33635]}),Object(x.a)(se,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(x.a)(se,6406,{dataFormat:6406,types:[5121]}),Object(x.a)(se,6409,{dataFormat:6409,types:[5121]}),Object(x.a)(se,6410,{dataFormat:6410,types:[5121]}),Object(x.a)(se,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(x.a)(se,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(x.a)(se,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(x.a)(se,34836,{dataFormat:6408,types:[5126],gl2:!0}),se),ye=(ue={},Object(x.a)(ue,6403,1),Object(x.a)(ue,36244,1),Object(x.a)(ue,33319,2),Object(x.a)(ue,33320,2),Object(x.a)(ue,6407,3),Object(x.a)(ue,36248,3),Object(x.a)(ue,6408,4),Object(x.a)(ue,36249,4),Object(x.a)(ue,6402,1),Object(x.a)(ue,34041,1),Object(x.a)(ue,6406,1),Object(x.a)(ue,6409,1),Object(x.a)(ue,6410,2),ue),be=(ce={},Object(x.a)(ce,5126,4),Object(x.a)(ce,5125,4),Object(x.a)(ce,5124,4),Object(x.a)(ce,5123,2),Object(x.a)(ce,5122,2),Object(x.a)(ce,5131,2),Object(x.a)(ce,5120,1),Object(x.a)(ce,5121,1),ce);var _e=[9729,9728],xe=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=n.id,o=void 0===a?j("texture"):a,s=n.handle,u=n.target;return(r=Object($.a)(this,Object(ee.a)(t).call(this,e,{id:o,handle:s}))).target=u,r.hasFloatTexture=e.getExtension("OES_texture_float"),r.textureUnit=void 0,r.loaded=!1,r.width=void 0,r.height=void 0,r.depth=void 0,r.format=void 0,r.type=void 0,r.dataFormat=void 0,r.border=void 0,r.textureUnit=void 0,r.mipmaps=void 0,r}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&function(e,t){var n=me[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=V(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}(e,n))&&(!i||function(e,t){var n=me[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}(e,n))),r}}]),Object(r.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var i=t.pixels,r=void 0===i?null:i,a=t.format,o=void 0===a?6408:a,u=t.type,c=void 0===u?5121:u,l=t.border,f=void 0===l?0:l,h=t.recreate,d=void 0!==h&&h,v=t.parameters,g=void 0===v?{}:v,p=t.pixelStore,m=void 0===p?{}:p,y=t.textureUnit,b=void 0===y?void 0:y,_=t.unpackFlipY,w=void 0===_||_,O=t.mipmaps,P=void 0===O||O;n||(n=r);var S=t.width,k=t.height,j=t.dataFormat,E=t.depth,C=void 0===E?0:E,A=this._deduceParameters({format:o,type:c,dataFormat:j,compressed:!1,data:n,width:S,height:k});S=A.width,k=A.height,j=A.dataFormat,this.width=S,this.height=k,this.depth=C,this.format=o,this.type=c,this.dataFormat=j,this.border=f,this.textureUnit=b,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var T=Object(x.a)({},37440,w),L=Object.assign({},T,m);return P&&this._isNPOT()&&(s.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),P=!1,this._updateForNPOT(g)),this.mipmaps=P,this.setImageData({data:n,width:S,height:k,depth:C,format:o,type:c,dataFormat:j,border:f,mipmaps:P,parameters:L}),P&&this.generateMipmap(),this.setParameters(g),d&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.height,n=e.width,i=e.mipmaps,r=void 0!==i&&i;return n!==this.width||t!==this.height?this.initialize({width:n,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(s.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),b(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,f=e.offset,h=void 0===f?0:f,d=e.parameters,v=void 0===d?{}:d,g=e.data,p=void 0===g?null:g,m=e.type,y=void 0===m?this.type:m,_=e.width,x=void 0===_?this.width:_,w=e.height,O=void 0===w?this.height:w,P=e.dataFormat,k=void 0===P?this.dataFormat:P,j=e.compressed,E=void 0!==j&&j;p||(p=r);var C=this._deduceParameters({format:u,type:y,dataFormat:k,compressed:E,data:p,width:x,height:O});y=C.type,k=C.dataFormat,E=C.compressed,x=C.width,O=C.height;var A=this.gl;A.bindTexture(this.target,this.handle);var T,L=this._getDataType({data:p,compressed:E});if(p=L.data,T=L.dataType,b(this.gl,v,function(){switch(T){case"null":A.texImage2D(n,o,u,x,O,l,k,y,p);break;case"typed-array":A.texImage2D(n,o,u,x,O,l,k,y,p,h);break;case"buffer":W(A),A.bindBuffer(35052,p.handle||p),A.texImage2D(n,o,u,x,O,l,k,y,h),A.bindBuffer(35052,null);break;case"browser-object":V(A)?A.texImage2D(n,o,u,x,O,l,k,y,p):A.texImage2D(n,o,u,k,y,p);break;case"compressed":A.compressedTexImage2D(n,o,u,x,O,l,p);break;default:S(!1,"Unknown image data type")}}),p&&p.byteLength)this._trackAllocatedMemory(p.byteLength,"Texture");else{var M=ye[this.dataFormat]||4,I=be[this.type]||1;this._trackAllocatedMemory(this.width*this.height*M*I,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,l=e.y,f=void 0===l?0:l,h=e.width,d=void 0===h?this.width:h,v=e.height,g=void 0===v?this.height:v,p=e.level,m=void 0===p?0:p,y=e.format,x=void 0===y?this.format:y,w=e.type,O=void 0===w?this.type:w,P=e.dataFormat,k=void 0===P?this.dataFormat:P,j=e.compressed,E=void 0!==j&&j,C=e.offset,A=void 0===C?0:C,T=e.border,L=(void 0===T&&this.border,e.parameters),M=void 0===L?{}:L,I=this._deduceParameters({format:x,type:O,dataFormat:k,compressed:E,data:s,width:d,height:g});if(O=I.type,k=I.dataFormat,E=I.compressed,d=I.width,g=I.height,S(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var F=s;s=F.data,d=F.shape[0],g=F.shape[1]}s instanceof pe&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),b(this.gl,M,function(){E?t.gl.compressedTexSubImage2D(i,m,c,f,d,g,x,s):null===s?t.gl.texSubImage2D(i,m,c,f,d,g,k,O,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,m,c,f,d,g,k,O,s,A):s instanceof _.b?(W(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,m,c,f,d,g,k,O,A),t.gl.bindBuffer(35052,null)):V(t.gl)?t.gl.texSubImage2D(i,m,c,f,d,g,k,O,s):t.gl.texSubImage2D(i,m,c,f,k,O,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof pe?{data:t.handle,dataType:"buffer"}:t instanceof _.b?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=me[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return S(i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},"Could not deduced texture size"),S(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),S(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:S(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!V(this.gl)&&(!(!this.width||!this.height)&&(!E(this.width)||!E(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===_e.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(re),we="";function Oe(e){we=e}function Pe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S("string"==typeof e),e=we+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function Se(e,t){return S("string"==typeof e),e=we+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}var ke=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),G(e),(r instanceof Promise||"string"==typeof r)&&(r={data:r}),"string"==typeof r.data&&(r=Object.assign({},r,{data:Se(r.data)})),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},r,{target:3553})))).initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e,t){return xe.isSupported(e,t)}}]),t}(xe),je=n(31),Ee=n.n(je),Ce=n(48),Ae=[34069,34070,34071,34072,34073,34074],Te=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),G(e),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},r,{target:34067})))).initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(Ce.a)(Ee.a.mark(function e(t){var n,i,r,a,o,u,c,l,f,h,d,v,g,p=this;return Ee.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,r=t.pixels,a=t.data,o=t.border,u=void 0===o?0:o,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,v=r||a,e.next=5,Promise.all(Ae.map(function(e){var t=v[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:g=e.sent,this.bind(),Ae.forEach(function(e,t){g[t].length>1&&!1!==p.opts.mipmaps&&s.warn("".concat(p.id," has mipmap and multiple LODs."))(),g[t].forEach(function(t,r){n&&i?d.texImage2D(e,r,l,n,i,u,l,h,t):d.texImage2D(e,r,l,l,h,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(xe);Te.FACES=Ae;var Le,Me=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),W(e),r=Object.assign({depth:1},r,{target:32879,unpackFlipY:!1}),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return V(e)}}]),Object(r.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,c=void 0===u?1:u,l=e.border,f=void 0===l?0:l,h=e.format,d=e.type,v=void 0===d?5121:d,g=e.offset,p=void 0===g?0:g,m=e.data,y=e.parameters,_=void 0===y?{}:y;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),b(this.gl,_,function(){ArrayBuffer.isView(m)&&t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,m),m instanceof pe&&(t.gl.bindBuffer(35052,m.handle),t.gl.texImage3D(t.target,i,a,o,s,c,f,h,v,p))}),m&&m.byteLength)this._trackAllocatedMemory(m.byteLength,"Texture");else{var x=ye[this.dataFormat]||4,w=be[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*x*w,"Texture")}return this.loaded=!0,this}}]),t}(xe),Ie="EXT_color_buffer_float",Fe=(Le={},Object(x.a)(Le,33189,{bpp:2}),Object(x.a)(Le,33190,{gl2:!0,bpp:3}),Object(x.a)(Le,36012,{gl2:!0,bpp:4}),Object(x.a)(Le,36168,{bpp:1}),Object(x.a)(Le,34041,{bpp:4}),Object(x.a)(Le,35056,{gl2:!0,bpp:4}),Object(x.a)(Le,36013,{gl2:!0,bpp:5}),Object(x.a)(Le,32854,{bpp:2}),Object(x.a)(Le,36194,{bpp:2}),Object(x.a)(Le,32855,{bpp:2}),Object(x.a)(Le,33321,{gl2:!0,bpp:1}),Object(x.a)(Le,33330,{gl2:!0,bpp:1}),Object(x.a)(Le,33329,{gl2:!0,bpp:1}),Object(x.a)(Le,33332,{gl2:!0,bpp:2}),Object(x.a)(Le,33331,{gl2:!0,bpp:2}),Object(x.a)(Le,33334,{gl2:!0,bpp:4}),Object(x.a)(Le,33333,{gl2:!0,bpp:4}),Object(x.a)(Le,33323,{gl2:!0,bpp:2}),Object(x.a)(Le,33336,{gl2:!0,bpp:2}),Object(x.a)(Le,33335,{gl2:!0,bpp:2}),Object(x.a)(Le,33338,{gl2:!0,bpp:4}),Object(x.a)(Le,33337,{gl2:!0,bpp:4}),Object(x.a)(Le,33340,{gl2:!0,bpp:8}),Object(x.a)(Le,33339,{gl2:!0,bpp:8}),Object(x.a)(Le,32849,{gl2:!0,bpp:3}),Object(x.a)(Le,32856,{gl2:!0,bpp:4}),Object(x.a)(Le,32857,{gl2:!0,bpp:4}),Object(x.a)(Le,36220,{gl2:!0,bpp:4}),Object(x.a)(Le,36238,{gl2:!0,bpp:4}),Object(x.a)(Le,36975,{gl2:!0,bpp:4}),Object(x.a)(Le,36214,{gl2:!0,bpp:8}),Object(x.a)(Le,36232,{gl2:!0,bpp:8}),Object(x.a)(Le,36226,{gl2:!0,bpp:16}),Object(x.a)(Le,36208,{gl2:!0,bpp:16}),Object(x.a)(Le,33325,{gl2:Ie,bpp:2}),Object(x.a)(Le,33327,{gl2:Ie,bpp:4}),Object(x.a)(Le,34842,{gl2:Ie,bpp:8}),Object(x.a)(Le,33326,{gl2:Ie,bpp:4}),Object(x.a)(Le,33328,{gl2:Ie,bpp:8}),Object(x.a)(Le,34836,{gl2:Ie,bpp:16}),Object(x.a)(Le,35898,{gl2:Ie,bpp:4}),Le);var Re,De=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=V(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,Fe)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return S(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&V(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Fe[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(re),Ne=256,ze=1024,Be=16384,Ue=6144,Ve=6145,Ge=6146,We=34041,He="clear: bad arguments";function Xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.color,a=void 0===r?null:r,o=t.depth,s=void 0===o?null:o,u=t.stencil,c=void 0===u?null:u,l={};i&&(l.framebuffer=i);var f=0;a&&(f|=Be,!0!==a&&(l.clearColor=a)),s&&(f|=Ne,!0!==s&&(l.clearDepth=s)),c&&(f|=ze,!0!==s&&(l.clearStencil=s)),S(0!==f,He),b(e,l,function(){e.clear(f)})}function qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,r=t.buffer,a=void 0===r?Ue:r,o=t.drawBuffer,s=void 0===o?0:o,u=t.value,c=void 0===u?[0,0,0,0]:u;W(e),b(e,{framebuffer:i},function(){switch(a){case Ue:switch(c.constructor){case Int32Array:e.clearBufferiv(a,s,c);break;case Uint32Array:e.clearBufferuiv(a,s,c);break;case Float32Array:default:e.clearBufferfv(a,s,c)}break;case Ve:e.clearBufferfv(Ve,0,[c]);break;case Ge:e.clearBufferiv(Ge,0,[c]);break;case We:var t=Object(h.a)(c,2),n=t[0],i=t[1];e.clearBufferfi(We,0,n,i);break;default:S(!1,He)}})}function Ze(e){switch(e){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 S(!1),0}}function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.sourceAttachment,c=void 0===u?36064:u,l=t.target,f=void 0===l?null:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,g=tt(e),p=g.framebuffer,m=g.deleteFramebuffer;S(p);var y=p.gl,b=p.handle,_=p.attachments;h=h||p.width,d=d||p.height,36064===c&&null===b&&(c=1028),S(_[c]),f=function(e,t,n,i,r){if(e)return e;var a=Y(t=t||5121,{clamped:!1}),o=Ze(n);return new a(i*r*o)}(f,v=v||_[c].type,s,h,d),v=v||Z(f);var x=y.bindFramebuffer(36160,b);return y.readPixels(i,a,h,d,s,v,f),y.bindFramebuffer(36160,x||null),m&&p.delete(),f}function Ke(e,t){var n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,u=t.target,c=void 0===u?null:u,l=t.targetByteOffset,f=void 0===l?0:l,h=t.sourceWidth,d=t.sourceHeight,v=t.sourceType,g=tt(e),p=g.framebuffer,m=g.deleteFramebuffer;S(p);var y=p.gl;if(h=h||p.width,d=d||p.height,W(y),v=v||(c?c.type:5121),!c){var _=Ze(s),x=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return S(!1),0}}(v);c=new pe(y,{byteLength:f+h*d*_*x,accessor:{type:v,size:_}})}return c.bind({target:35051}),b(y,{framebuffer:p},function(){y.readPixels(i,a,h,d,s,v,f)}),c.unbind({target:35051}),m&&p.delete(),c}function Qe(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=Ye(e,{sourceAttachment:i}),s=e.width,u=e.height;u>a;){var c=K({data:o,width:s,height:u});o=c.data,s=c.width,u=c.height}!function(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=Qe(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function $e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,a=n.sourceY,o=void 0===a?0:a,s=n.targetX,u=n.targetY,c=n.targetZ,l=n.targetMipmaplevel,f=void 0===l?0:l,h=n.targetInternalFormat,d=void 0===h?6408:h,v=n.width,g=n.height,p=tt(e),m=p.framebuffer,y=p.deleteFramebuffer;S(m);var b=m.gl,_=m.handle,x=void 0!==s||void 0!==u||void 0!==c;s=s||0,u=u||0,c=c||0;var w=b.bindFramebuffer(36160,_);S(t);var O=null;if(t instanceof xe&&(O=t,v=Number.isFinite(v)?v:O.width,g=Number.isFinite(g)?g:O.height,O.bind(0),t=O.target),x)switch(t){case 3553:case 34067:b.copyTexSubImage2D(t,f,s,u,r,o,v,g);break;case 35866:case 32879:b.copyTexSubImage3D(t,f,s,u,c,r,o,v,g)}else b.copyTexImage2D(t,f,d,r,o,v,g,0);return O&&O.unbind(),b.bindFramebuffer(36160,w||null),y&&m.delete(),O}function et(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,u=n.sourceY0,c=void 0===u?0:u,l=n.sourceX1,f=n.sourceY1,h=n.targetX0,d=void 0===h?0:h,v=n.targetY0,g=void 0===v?0:v,p=n.targetX1,m=n.targetY1,y=n.color,b=void 0===y||y,_=n.depth,x=void 0!==_&&_,w=n.stencil,O=void 0!==w&&w,P=n.mask,k=void 0===P?0:P,j=n.filter,E=void 0===j?9728:j,C=tt(e),A=C.framebuffer,T=C.deleteFramebuffer,L=tt(t),M=L.framebuffer,I=L.deleteFramebuffer;S(A),S(M);var F=M.gl,R=M.handle,D=M.width,N=M.height,z=M.readBuffer;W(F),A.handle||36064!==r||(r=1028),b&&(k|=16384),x&&(k|=256),O&&(k|=1024),(T||I)&&1280&k&&(k=16384,s.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),S(k),l=void 0===l?A.width:l,f=void 0===f?A.height:f,p=void 0===p?D:p,m=void 0===m?N:m;var B=F.bindFramebuffer(36009,R),U=F.bindFramebuffer(36008,A.handle);return F.readBuffer(r),F.blitFramebuffer(o,c,l,f,d,g,p,m,k,E),F.readBuffer(z),F.bindFramebuffer(36008,U||null),F.bindFramebuffer(36009,B||null),T&&A.delete(),I&&M.delete(),M}function tt(e){return e instanceof gt?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:(t=e,i=t.gl,r=t.width,a=t.height,o=t.id,s=new gt(i,Object.assign({},n,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(x.a)({},36064,t)})),s),deleteFramebuffer:!0};var t,n,i,r,a,o,s}var nt,it=(Re={},Object(x.a)(Re,33902,{gl1:new Float32Array([1,1])}),Object(x.a)(Re,33901,{gl1:new Float32Array([1,1])}),Object(x.a)(Re,3379,{gl1:64,gl2:2048}),Object(x.a)(Re,34076,{gl1:16}),Object(x.a)(Re,34930,{gl1:8}),Object(x.a)(Re,35661,{gl1:8}),Object(x.a)(Re,35660,{gl1:0}),Object(x.a)(Re,34024,{gl1:1}),Object(x.a)(Re,36348,{gl1:8}),Object(x.a)(Re,34921,{gl1:8}),Object(x.a)(Re,36347,{gl1:128}),Object(x.a)(Re,36349,{gl1:16}),Object(x.a)(Re,3386,{gl1:new Int32Array([0,0])}),Object(x.a)(Re,32883,{gl1:0,gl2:256}),Object(x.a)(Re,35071,{gl1:0,gl2:256}),Object(x.a)(Re,37447,{gl1:0,gl2:0}),Object(x.a)(Re,36063,{gl1:0,gl2:4}),Object(x.a)(Re,35379,{gl1:0,gl2:0}),Object(x.a)(Re,35374,{gl1:0,gl2:0}),Object(x.a)(Re,35377,{gl1:0,gl2:0}),Object(x.a)(Re,34852,{gl1:0,gl2:4}),Object(x.a)(Re,36203,{gl1:0,gl2:0}),Object(x.a)(Re,33001,{gl1:0,gl2:0}),Object(x.a)(Re,33e3,{gl1:0,gl2:0}),Object(x.a)(Re,37157,{gl1:0,gl2:0}),Object(x.a)(Re,35373,{gl1:0,gl2:0}),Object(x.a)(Re,35657,{gl1:0,gl2:0}),Object(x.a)(Re,36183,{gl1:0,gl2:0}),Object(x.a)(Re,37137,{gl1:0,gl2:0}),Object(x.a)(Re,34045,{gl1:0,gl2:0}),Object(x.a)(Re,35978,{gl1:0,gl2:0}),Object(x.a)(Re,35979,{gl1:0,gl2:0}),Object(x.a)(Re,35968,{gl1:0,gl2:0}),Object(x.a)(Re,35376,{gl1:0,gl2:0}),Object(x.a)(Re,35375,{gl1:0,gl2:0}),Object(x.a)(Re,35659,{gl1:0,gl2:0}),Object(x.a)(Re,37154,{gl1:0,gl2:0}),Object(x.a)(Re,35371,{gl1:0,gl2:0}),Object(x.a)(Re,35658,{gl1:0,gl2:0}),Object(x.a)(Re,35076,{gl1:0,gl2:-8,negative:!0}),Object(x.a)(Re,35077,{gl1:0,gl2:7}),Object(x.a)(Re,35380,{gl1:0,gl2:0}),Re);function rt(e){if(e.luma=e.luma||{},!e.luma.limits){e.luma.limits={},e.luma.webgl1MinLimits={},e.luma.webgl2MinLimits={};var t=V(e);for(var n in it){var i=it[n],r=i.gl1,a="gl2"in i?i.gl2:i.gl1,o=t?a:r,s="gl2"in i&&!t||"extension"in i&&!e.getExtension(i.extension)?o:e.getParameter(n);e.luma.limits[n]=s,e.luma.webgl1MinLimits[n]=r,e.luma.webgl2MinLimits[n]=a}}return e.luma.limits}function at(e){e.luma=e.luma||{};var t,n=N(e);e.luma.info||(e.luma.info=(t={},Object(x.a)(t,37445,n.vendor),Object(x.a)(t,37446,n.renderer),Object(x.a)(t,7936,n.vendorMasked),Object(x.a)(t,7937,n.rendererMasked),Object(x.a)(t,7938,n.version),Object(x.a)(t,35724,n.shadingLanguageVersion),t));return e.luma.info}function ot(e){return Object.assign(N(e),{limits:rt(e),info:at(e),webgl1MinLimits:e.luma.webgl1MinLimits,webgl2MinLimits:e.luma.webgl2MinLimits})}var st={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",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"},ut=(nt={},Object(x.a)(nt,st.WEBGL2,[function(e){return V(e)}]),Object(x.a)(nt,st.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(x.a)(nt,st.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(x.a)(nt,st.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(x.a)(nt,st.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(x.a)(nt,st.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(x.a)(nt,st.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(x.a)(nt,st.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(x.a)(nt,st.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(x.a)(nt,st.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(x.a)(nt,st.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(x.a)(nt,st.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(x.a)(nt,st.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(x.a)(nt,st.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(x.a)(nt,st.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(x.a)(nt,st.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(x.a)(nt,st.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(x.a)(nt,st.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(x.a)(nt,st.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(x.a)(nt,st.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(x.a)(nt,st.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),nt);function ct(e,t){return lt(e,t)}function lt(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return ht(e,t)})}function ft(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=V(e),ut)e.luma.caps[t]=ht(e,t);return e.luma.caps}function ht(e,t){var n=ut[t];S(n,t);var i,r=V(e)&&n[1]||n[0];if("function"==typeof r)i=r(e);else if(Array.isArray(r)){i=!0;var a=!0,o=!1,s=void 0;try{for(var u,c=r[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i=i&&Boolean(e.getExtension(l))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}else"string"==typeof r?i=Boolean(e.getExtension(r)):"boolean"==typeof r?i=r:S(!1);return i}var dt={};function vt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=ut[t];if(S(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in dt)return dt[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),dt[t]=s,s}var gt=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(V(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(V(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(S(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return S(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&s.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,r=void 0!==i&&i,a=n.resizeAttachments,o=void 0===a||a,s={};r&&Object.keys(this.attachments).forEach(function(e){s[e]=null}),Object.assign(s,e);var u=this.gl.bindFramebuffer(36160,this.handle);for(var c in s){S(void 0!==c,"Misspelled framebuffer binding point?");var l=Number(c),f=s[l],d=f;if(d)if(d instanceof De)this._attachRenderbuffer({attachment:l,renderbuffer:d});else if(Array.isArray(f)){var v=Object(h.a)(f,3),g=v[0],p=v[1],m=void 0===p?0:p,y=v[2],b=void 0===y?0:y;d=g,this._attachTexture({attachment:l,texture:g,layer:m,level:b})}else this._attachTexture({attachment:l,texture:d,layer:0,level:0});else this._unattach(l);o&&d&&d.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,u||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(function(e){return(gt.STATUS||{})[e]||"Framebuffer error ".concat(e)}(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&Xe(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){qe({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;W(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=J(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?J(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>s.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Qe(this,{maxHeight:100});return s.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,i,r){var a,o=null;e&&((o=o||{})[36064]=new ke(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:r,mipmaps:!1,parameters:(a={},Object(x.a)(a,10241,9728),Object(x.a)(a,10240,9728),Object(x.a)(a,10242,33071),Object(x.a)(a,10243,33071),a)}));return t&&n?(o=o||{})[33306]=new De(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}):t?(o=o||{})[36096]=new De(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:r}):n&&S(!1),o}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof De?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:S(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;V(t)?t.readBuffer(e):S(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(V(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):S(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=ft(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(re);function pt(e,t){S(e instanceof ke||e instanceof Te||e instanceof Me);var n=e.constructor,i=e.gl,r=e.width,a=e.height,o=e.format,s=e.type,u=e.dataFormat,c=e.border,l=e.mipmaps;return new n(i,Object.assign({width:r,height:a,format:o,type:s,dataFormat:u,border:c,mipmaps:l},t))}gt.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];function mt(e){return Boolean(e&&2===e._version)}var yt={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function bt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(yt,{width:1,height:1},e)}function _t(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},yt,t),i=n.width,r=n.height;function o(e){if(t.throwOnError)throw new Error(e);return null}a.a?e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(D({canvas:t.canvas,width:i,height:r,onError:o}),t):e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,a=e.onError;if(r&&!i)return a("headless-gl does not support WebGL2");if(!_.c)return a(O);var o=Object(_.c)(t,n,e);return o||a(P)}(w({},t,{width:i,height:r,onError:o}));return e?(function(e){var t=mt(e)?"WebGL2":"WebGL1",n=N(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";s.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=xt(e,t)),e):null}function xt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==_.a&&e instanceof _.a)return 2;return 1}(e);var n=t=Object.assign({},yt,t),i=n.manageState,r=n.debug;return i&&Object(m.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}function Pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}var St=35632,kt=35633;function jt(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Pt(t)||"(unnamed)",u="".concat(function(e){switch(e){case St:return"fragment";case kt:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=Ct(a,r-o);return s+n+e})}(t);return{shaderName:u,errors:Et(a,v),warnings:Et(o,v)}}function Et(e,t){for(var n="",i=0;i=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}var Tt,Lt="Shader: GLSL source code must be a JavaScript string",Mt=function(e){function t(e,n){var r;Object(i.a)(this,t),G(e),S("string"==typeof n.source,Lt);var a=Pt(n.source,null)||n.id||j("unnamed ".concat(t.getTypeName(n.shaderType)));return(r=Object($.a)(this,Object(ee.a)(t).call(this,e,{id:a}))).shaderType=n.shaderType,r.source=n.source,r.initialize(n),r}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"getTypeName",value:function(e){switch(e){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return S(!1),"unknown"}}}]),Object(r.a)(t,[{key:"initialize",value:function(e){var t=e.source,n=Pt(t,null);n&&(this.id=j(n)),this._compile(t)}},{key:"getParameter",value:function(e){return this.gl.getShaderParameter(this.handle,e)}},{key:"toString",value:function(){return"".concat(t.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return Pt(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var e=this.gl.getExtension("WEBGL.debug_shaders");return e?e.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL.debug_shaders not implemented"}},{key:"_compile",value:function(){if(this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){var e=jt(this.gl.getShaderInfoLog(this.handle),this.source,this.shaderType,this.id),t=e.shaderName,n=e.errors,i=e.warnings;throw s.error("GLSL compilation errors in ".concat(t,"\n").concat(n))(),s.warn("GLSL compilation warnings in ".concat(t,"\n").concat(i))(),new Error("GLSL compilation errors in ".concat(t))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}]),t}(re),It=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},n,{shaderType:35633})))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),t}(Mt),Ft=function(e){function t(e,n){return Object(i.a)(this,t),"string"==typeof n&&(n={source:n}),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},n,{shaderType:35632})))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),t}(Mt);function Rt(e,t,n){return(Rt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(ee.a)(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}var Dt,Nt=(Tt={},Object(x.a)(Tt,5126,function(e,t,n){return e.uniform1fv(t,Wt(n,1))}),Object(x.a)(Tt,35664,function(e,t,n){return e.uniform2fv(t,Wt(n,2))}),Object(x.a)(Tt,35665,function(e,t,n){return e.uniform3fv(t,Wt(n,3))}),Object(x.a)(Tt,35666,function(e,t,n){return e.uniform4fv(t,Wt(n,4))}),Object(x.a)(Tt,5124,function(e,t,n){return e.uniform1iv(t,Ht(n,1))}),Object(x.a)(Tt,35667,function(e,t,n){return e.uniform2iv(t,Ht(n,2))}),Object(x.a)(Tt,35668,function(e,t,n){return e.uniform3iv(t,Ht(n,3))}),Object(x.a)(Tt,35669,function(e,t,n){return e.uniform4iv(t,Ht(n,4))}),Object(x.a)(Tt,35670,function(e,t,n){return e.uniform1iv(t,Ht(n,1))}),Object(x.a)(Tt,35671,function(e,t,n){return e.uniform2iv(t,Ht(n,2))}),Object(x.a)(Tt,35672,function(e,t,n){return e.uniform3iv(t,Ht(n,3))}),Object(x.a)(Tt,35673,function(e,t,n){return e.uniform4iv(t,Ht(n,4))}),Object(x.a)(Tt,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,Wt(n,4))}),Object(x.a)(Tt,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,Wt(n,9))}),Object(x.a)(Tt,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,Wt(n,16))}),Object(x.a)(Tt,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,5125,function(e,t,n){return e.uniform1uiv(t,Xt(n,1))}),Object(x.a)(Tt,36294,function(e,t,n){return e.uniform2uiv(t,Xt(n,2))}),Object(x.a)(Tt,36295,function(e,t,n){return e.uniform3uiv(t,Xt(n,3))}),Object(x.a)(Tt,36296,function(e,t,n){return e.uniform4uiv(t,Xt(n,4))}),Object(x.a)(Tt,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,Wt(n,6))}),Object(x.a)(Tt,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,Wt(n,8))}),Object(x.a)(Tt,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,Wt(n,6))}),Object(x.a)(Tt,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,Wt(n,12))}),Object(x.a)(Tt,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,Wt(n,8))}),Object(x.a)(Tt,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,Wt(n,12))}),Object(x.a)(Tt,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(x.a)(Tt,36311,function(e,t,n){return e.uniform1i(t,n)}),Tt),zt={},Bt={},Ut={},Vt=[0];function Gt(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(Vt[0]=e,e=Vt);var r=e.length;if(r%t&&s.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(V(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",gn),n._isCached=!1,n.initialize(r),Object.seal(Object(te.a)(n)),n._setId(r.id),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new It(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new Ft(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,S(this.vs instanceof It),S(this.fs instanceof Ft),this.uniforms={},i&&(W(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new vn(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Rt(Object(ee.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,u=void 0===o?0:o,c=e.start,l=e.end,f=e.isIndexed,h=void 0!==f&&f,d=e.indexType,v=void 0===d?5123:d,g=e.isInstanced,p=void 0!==g&&g,m=e.instanceCount,y=void 0===m?0:m,_=e.vertexArray,x=void 0===_?null:_,w=e.transformFeedback,O=e.framebuffer,P=e.parameters,k=void 0===P?{}:P,j=e.uniforms,E=e.samplers;if((j||E)&&(s.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(j||{})),void 0!==n){var C=O?O.id:"default",A="mode=".concat(J(this.gl,r)," verts=").concat(a," ")+"instances=".concat(y," indexType=").concat(J(this.gl,v)," ")+"isInstanced=".concat(p," isIndexed=").concat(h," ")+"Framebuffer=".concat(C);s.log(n,A)()}return S(x),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(x.bindForDraw(a,y,function(){if(void 0!==O&&(k=Object.assign({},k,{framebuffer:O})),w){var e=fn(r);w.begin(e)}t._bindTextures(),b(t.gl,k,function(){h&&p?t.gl.drawElementsInstanced(r,a,v,u,y):h&&V(t.gl)&&!isNaN(c)&&!isNaN(l)?t.gl.drawRangeElements(r,c,l,a,v,u):h?t.gl.drawElements(r,a,v,u):p?t.gl.drawArraysInstanced(r,u,a,y):t.gl.drawArrays(r,u,a)}),w&&w.end()}),!0)}},{key:"setUniforms",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=!1,r={};for(var a in t)Kt(this.uniforms[a],t[a])||(i=!0,r[a]=t[a],this.uniforms[a]=(e=t[a],Array.isArray(e)||ArrayBuffer.isView(e)?e.slice():e));return i&&(n(),function(e,t,n){for(var i in e){var r=e[i];if((!n||Boolean(n[i]))&&!Yt(r))throw t=t?"".concat(t," "):"",console.error("".concat(t," Bad uniform ").concat(i),r),new Error("".concat(t," Bad uniform ").concat(i))}}(r,this.id,this._uniformSetters),this._setUniforms(r)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof gt)i=i.texture;if(i instanceof xe)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof gt&&(n=n.texture),n instanceof xe)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof gt&&(n=n.texture),n instanceof xe){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new It({handle:u});break;case 35632:n.fs=new Ft({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=j(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),s.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),s.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||s.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=V(e),i=lt(e,st.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:S(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(r.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(re),yn=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),W(e),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,r))).initialize(r),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return V(e)}}]),Object(r.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,C(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,u=r.byteOffset;return i<0?(this.unused[e]=a,s.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,u,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof pe==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(re),bn=null;function _n(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!bn||bn.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var a=r.id||r.program&&r.program.id;return(n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},r,{id:a})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(r),Object.seal(Object(te.a)(n)),n}return Object(ne.a)(t,e),Object(r.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?V(e)||"Chrome"===function(e){if(!e&&!Object(wn.a)())return"Node";if(Object(On.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":xn.b.chrome?"Chrome":xn.b.safari?"Safari":xn.b.mozInnerScreenX?"Firefox":"Unknown"}():V(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:S(!1)}}}]),Object(r.a)(t,[{key:"delete",value:function(){Rt(Object(ee.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return S(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(S(V(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new pe(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=_n(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=Pn.isSupported(t)?new Pn(t):Pn.getDefaultArray(t),T(this,"VertexArray","v6.0",kn),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new pe(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof pe){var a=n;if(r){var o=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,o)}else{var s=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,s)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}(),En=5126,Cn=5124,An=5125,Tn=function(){function e(t){var n;for(var r in Object(i.a)(this,e),this.layout={},this.size=0,t)this._addUniform(r,t[r]);this.size+=(4-this.size%4)%4;var a=new Float32Array(this.size);this.typedArray=(n={},Object(x.a)(n,En,a),Object(x.a)(n,Cn,new Int32Array(a.buffer)),Object(x.a)(n,An,new Uint32Array(a.buffer)),n)}return Object(r.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[En]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];S(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=hn(t);S(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}();function Ln(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,i=e.program,r=e.uniforms,a=e.undefinedOnly,o=void 0!==a&&a;S(i);var s=i._uniformSetters,u={},c=Object.keys(s).sort(),l=0,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;p.match(".*_.*")||p.match(".*Matrix")||Mn({table:u,header:n,uniforms:r,uniformName:p,undefinedOnly:o})&&l++}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}var m=!0,y=!1,b=void 0;try{for(var _,w=c[Symbol.iterator]();!(m=(_=w.next()).done);m=!0){var O=_.value;O.match(".*Matrix")&&Mn({table:u,header:n,uniforms:r,uniformName:O,undefinedOnly:o})&&l++}}catch(e){y=!0,b=e}finally{try{m||null==w.return||w.return()}finally{if(y)throw b}}var P=!0,k=!1,j=void 0;try{for(var E,C=c[Symbol.iterator]();!(P=(E=C.next()).done);P=!0){var T=E.value;u[T]||Mn({table:u,header:n,uniforms:r,uniformName:T,undefinedOnly:o})&&l++}}catch(e){k=!0,j=e}finally{try{P||null==C.return||C.return()}finally{if(k)throw j}}var L=0,M={};if(!o)for(var I in r){var F=r[I];u[I]||(L++,M[I]=Object(x.a)({Type:"NOT USED: ".concat(F)},n,A(F)))}return{table:u,count:l,unusedTable:M,unusedCount:L}}function Mn(e){var t,n=e.table,i=e.header,r=e.uniforms,a=e.uniformName,o=e.undefinedOnly,s=r[a],u=function(e){return null!=e}(s);return(!o||!u)&&(n[a]=(t={},Object(x.a)(t,i,u?A(s):"N/A"),Object(x.a)(t,"Uniform Type",u?s:"NOT PROVIDED"),t),!0)}function In(e,t,n,i){var r,a,o,s,u=e.gl,c="NOT PROVIDED",l="N/A",f="N/A",h="N/A";if(n&&(c=n.type,l=n.size,a=-1!==(c=String(c).replace("Array","")).indexOf("nt")),t instanceof pe){var d,v,g=t,p=g.getDebugData(),m=p.data;if(o=p.modified?"*":"",s=m,f=(h=g.byteLength)/m.BYTES_PER_ELEMENT/l,n){var y=n.divisor>0;v="".concat(y?"I ":"P "," ").concat(f," (x").concat(l,"=").concat(h," bytes ").concat(J(u,c),")")}else a=!0,v="".concat(h," bytes");return d={},Object(x.a)(d,i,"".concat(o).concat(A(s,{size:l,isInteger:a}))),Object(x.a)(d,"Format ",v),d}return s=t,l=t.length,a=-1!==(c=String(t.constructor.name).replace("Array","")).indexOf("nt"),r={},Object(x.a)(r,i,"".concat(A(s,{size:l,isInteger:a})," (constant)")),Object(x.a)(r,"Format ","".concat(l,"x").concat(c," (constant)")),r}function Fn(e,t){var n=dn(t.type,t.size);return n?"".concat(e," (").concat(n.name,")"):e}function Rn(e){var t=e.accessor,n=dn(t.type,t.size);return n?"".concat(n.name," ").concat(e.name):e.name}var Dn={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Nn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id,r=void 0===n?j("geometry"):n,a=t.drawMode,o=void 0===a?Dn.TRIANGLES:a,s=t.mode,u=t.attributes,c=void 0===u?{}:u,l=t.indices,f=void 0===l?null:l,h=t.vertexCount,d=void 0===h?null:h;this.id=r,this.drawMode=0|o||0|s,this.attributes={},this.userData={},this._setAttributes(c,f),this.vertexCount=d||this._calculateVertexCount(this.attributes,this.indices)}return Object(r.a)(e,null,[{key:"DRAW_MODE",get:function(){return Dn}}]),Object(r.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?w({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,S(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"indices"===n?(S(!this.indices),this.indices=i,void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed)):this.attributes[n]=i}return this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}if(!Number.isFinite(n)){var s=e.POSITION||e.positions;s&&(n=s.value&&s.value.length/(s.size||3))}return S(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}(),zn=function e(){Object(i.a)(this,e)},Bn=n(30),Un=[255,255,255],Vn=[0,0,1],Gn=[0,0,-1],Wn=[0,0,1],Hn=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e),this.id=t.id||j("light");var n=t.color,r=void 0===n?Un:n;this.color=r;var a=t.intensity,o=void 0===a?1:a;this.intensity=o},Xn=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).type="ambient",e}return Object(ne.a)(t,e),t}(Hn),qn=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).type="directional";var r=n.direction,a=void 0===r?Gn:r;return e.direction=new Bn.a(a).normalize().toArray(),e}return Object(ne.a)(t,e),t}(Hn),Zn=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).type="point";var r=n.position,a=void 0===r?Wn:r;return e.position=a,e.attenuation=e._getAttenuation(n),e}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:Vn}}]),t}(Hn),Yn=n(29),Kn=0,Qn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.onCreateContext,r=void 0===n?function(e){return _t(e)}:n,a=t.onAddHTML,o=void 0===a?null:a,u=t.onInitialize,c=void 0===u?function(){}:u,f=t.onRender,h=void 0===f?function(){}:f,d=t.onFinalize,v=void 0===d?function(){}:d,g=t.gl,p=void 0===g?null:g,m=t.glOptions,y=void 0===m?{}:m,b=t.debug,_=void 0!==b&&b,x=t.createFramebuffer,w=void 0!==x&&x,O=t.autoResizeViewport,P=void 0===O||O,S=t.autoResizeDrawingBuffer,k=void 0===S||S,j=t.stats,E=void 0===j?l.get("animation-loop-".concat(Kn++)):j,C=t.useDevicePixels,A=void 0===C||C;"useDevicePixelRatio"in t&&(s.deprecated("useDevicePixelRatio","useDevicePixels")(),A=t.useDevicePixelRatio),this.props={onCreateContext:r,onAddHTML:o,onInitialize:c,onRender:h,onFinalize:v,gl:p,glOptions:y,debug:_,createFramebuffer:w},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=E,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:P,autoResizeDrawingBuffer:k,useDevicePixels:A}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return S("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,R().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=mn.isSupported(e.gl,["timers"])?new mn(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),X(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(Ce.a)(Ee.a.mark(function e(){return Ee.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return s.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;X(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||H(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(Yn.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?xt(this.props.gl,e):this.onCreateContext(e),!U(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(f.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas,r=i.clientWidth,a=i.clientHeight;return r>0&&a>0?n=r/a:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Ot(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new gt(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()&&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(){this.gl.canvas.addEventListener("mousemove",this._onMousemove),this.gl.canvas.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}}]),e}(),Jn=new Uint8Array([0,0,0]);function $n(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function ei(e){var t=Object(h.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function ti(){return Jn}var ni={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function ii(e,t){var n=(t||{}).attributeMap,i=void 0===n?ni:n;return i&&i[e]||e}function ri(e,t){var n;switch(e){case"indices":n=n||"indices";break;case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2;break;case"indices":t.size=t.size||1,t.isIndexed=void 0===t.isIndexed||t.isIndexed,S(t.value instanceof Uint16Array||t.value instanceof Uint32Array,'attribute array for "indices" must be of integer type')}S(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var ai=n(25),oi=n(108),si=n(36),ui=n.n(si),ci={},li=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},fi=new Map;ui.a.listenFor("luma.gl",function(e){var t=ci[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){o.d.__SEER_INITIALIZED__&&(fi.has(e)||fi.set(e,new Map),fi.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();li(i,n,e.value),t.setUniforms(i)}});var hi,di=["renderPickingBuffer","pickingEnabled"],vi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),S(U(t));var r=n.id,a=void 0===r?j("base-model"):r;this.id=a,this.gl=t,this.id=n.id||j("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(r.a)(e,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props={},this.program=this._createProgram(e),this.vertexArray=new jn(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete ci[t],ui.a.deleteItem("luma.gl",t)}},{key:"destroy",value:function(){this.delete()}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.getUniforms()}},{key:"setUniforms",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),function(e,t){if(o.d.__SEER_INITIALIZED__&&e){var n=fi.get(e);n&&n.forEach(function(e,n){li(t,n,e)})}}(this.id,t),t=this._extractAnimatedUniforms(t),this.program.setUniforms(t,function(){e._checkForDeprecatedUniforms(t)}),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return Xe(this.program.gl,e),this}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,u=t.attributes,c=void 0===u?{}:u,l=t.transformFeedback,f=void 0===l?this.transformFeedback:l,h=t.parameters,d=void 0===h?{}:h,v=t.vertexArray,g=void 0===v?this.vertexArray:v,p=t.animationProps;ci[(e=this).id]||(ci[e.id]=e,ui.a.listItem("luma.gl",e.id)),this.setAttributes(c),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(p);var m=this._logDrawCallStart(2),y=this.vertexArray.getDrawParams(this.props);y.isInstanced&&!this.isInstanced&&s.warn("Found instanced attributes on non-instanced model",this.id)();var b=y.isIndexed,_=y.indexType,x=y.indexOffset,w=this.isInstanced,O=this.instanceCount,P=function(){},S=this.props,k=S.onBeforeRender,j=void 0===k?P:k,E=S.onAfterRender,C=void 0===E?P:E;j(),this._timerQueryStart();var A=this.program.draw(Object.assign({},t,{logPriority:m,uniforms:null,framebuffer:r,parameters:d,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:g,transformFeedback:f,isIndexed:b,indexType:_,isInstanced:w,instanceCount:O,offset:b?x:0}));return this._timerQueryEnd(),C(),this._logDrawCallEnd(m,g,r),A}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(x.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&mn.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&s.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,u=e.defines,c=void 0===u?{}:u,l=e.inject,f=void 0===l?{}:l,h=e.shaderCache,d=void 0===h?null:h,v=e.varyings,g=void 0===v?null:v,p=e.bufferMode,m=void 0===p?35981:p,y=e.program,b=void 0===y?null:y;this.getModuleUniforms=function(e){};var _=this.id;if(!b){n=n||ai.a.vs,r=r||ai.a.fs;var x=Object(oi.a)(this.gl,{vs:n,fs:r,modules:o,inject:f,defines:c,log:s});n=x.vs,r=x.fs,b=d?d.getProgram(this.gl,{id:_,vs:n,fs:r}):new pn(this.gl,{id:_,vs:n,fs:r,varyings:g,bufferMode:m}),this.getModuleUniforms=x.getUniforms||function(e){}}return S(b instanceof pn,"Model needs a program"),b}},{key:"_checkForDeprecatedUniforms",value:function(e){di.forEach(function(t){t in e&&s.deprecated(t,"use picking shader module and Model class updateModuleSettings()")()})}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!C(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new mn(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,s.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(s.priority>> DRAWING MODEL ".concat(this.id),{collapsed:s.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=In(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),c=t.accessors[s.location];c&&(u="".concat(o,": ").concat(Fn(s.name,c))),r[u]=In(t,a[o],c,i)}}return r}({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=Ln({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,u=a.unusedTable,c=a.unusedCount,l=Ln({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),f=l.table;l.count>0&&s.log("MISSING UNIFORMS",Object.keys(f))(),c>0&&s.log("UNUSED UNIFORMS",Object.keys(u))();var h=function(e){var t={},n="Accessors for ".concat(e.id),i=!0,r=!1,a=void 0;try{for(var o,s=e.attributeInfos[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(u){var c=Rn(u);t["in ".concat(c)]=Object(x.a)({},n,JSON.stringify(u.accessor))}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}var l=!0,f=!1,h=void 0;try{for(var d,v=e.varyingInfos[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;if(g){var p=Rn(g);t["out ".concat(p)]=Object(x.a)({},n,JSON.stringify(g.accessor))}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return t}(this.vertexArray.configuration);s.table(e,r)(),s.table(e,o)(),s.table(e+1,h)(),function(e,t){if(ui.a.isReady()&&!ui.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);ui.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),s.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}(),gi=function(e){function t(e,n){Object(i.a)(this,t);var r=n.id,a=void 0===r?j("model"):r;return Object($.a)(this,Object(ee.a)(t).call(this,e,w({},n,{id:a})))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Rt(Object(ee.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},S(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){Rt(Object(ee.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){Rt(Object(ee.a)(t.prototype),"delete",this).call(this),this._deleteGeometryBuffers()}},{key:"destroy",value:function(){this.delete()}},{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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return S(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return S(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=function(e,t,n){var i={};for(var r in t.attributes){var a=t.attributes[r],o=ii(r,n);if(a.constant)i[o]=a.value;else{var s=a.value,u=w({},a);delete u.value,i[o]=[new pe(e,s),u],ri(r,u)}}return t.indices&&(i.indices=new pe(e,{data:t.indices.value||t.indices,target:34963})),i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(C(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,i=e.feedbackBuffers,r=e.unbindModels,a=void 0===r?[]:r,o=e.parameters;i&&this._setFeedbackBuffers(i),n&&(o=Object.assign({},o,Object(x.a)({},35977,n))),a.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:o}))}finally{a.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof pe&&t.delete()}}},{key:"_setAnimationProps",value:function(e){var t=this;if(this.animated){S(e,"Model.draw(): animated uniforms but no animationProps");var n=this._evaluateAnimateUniforms(e);this.program.setUniforms(n,function(){t._checkForDeprecatedUniforms(n)})}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(C(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new yn(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new mn(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,s.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}}]),t}(vi),pi=n(100),mi=n(82),yi=n(139),bi="transform_uSampler_",_i="transform_uSize_",xi="transform_position";function wi(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,s={},u=t,c={};if(a>0||i){var l=u.split("\n"),f=l.slice();if(l.forEach(function(e,t,r){if(a>0){var u=function(e,t){var n={},i=function(e){return Object(mi.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(bi).concat(e),n="".concat(_i).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),u=s.samplerName,c=s.sizeName,l=s.uniformDeclerations,f=Object(mi.e)(r),h=" ".concat(r," ").concat(a," = transform_getInput(").concat(u,", ").concat(c,").").concat(f,";\n");n[u]=a;var d={"vs:#decl":l,"vs:#main-start":h};return{updatedLine:o,inject:d,samplerTextureMap:n}}return null}(e,n);if(u){var l=u.updatedLine,h=u.inject;f[t]=l,c=Object(pi.b)([c,h]),Object.assign(s,u.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(mi.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){S(r);var h="".concat(_i).concat(i),d={"vs:#decl":"uniform vec2 ".concat(h,";\n"),"vs:#main-start":" vec2 ".concat(xi," = transform_getPos(").concat(h,");\n gl_Position = vec4(").concat(xi,", 0, 1.);\n")};c=Object(pi.b)([c,d])}u=f.join("\n")}return{vs:u,targetTextureType:o,inject:c,samplerTextureMap:s}}var Oi=(hi={},Object(x.a)(hi,10241,9728),Object(x.a)(hi,10240,9728),Object(x.a)(hi,10242,33071),Object(x.a)(hi,10243,33071),hi),Pi=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),S(V(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this._createdBuffers={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(r.a)(e,null,[{key:"isSupported",value:function(e){return V(e)}}]),Object(r.a)(e,[{key:"delete",value:function(){for(var e in this._createdBuffers)this._createdBuffers[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof pe?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();S(!n||n===this.targetTextureVarying);var o=Ye(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,u=Object(mi.d)(this.targetTextureType),c=new s(o.length*u/4),l=0,f=0;f0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,S(s=this.framebuffers[this.currentIndex]),r.viewport=[0,0,s.width,s.height],o&&this.gl.clear(this.gl.COLOR_BUFFER_BIT)),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){s.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){S(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)S(r[o]instanceof pe||r[o].buffer instanceof pe);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(Oi)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,S(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(s.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(s.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,u=e.varyings,c=e._sourceTextures,l=e._targetTexture,f=e._targetTextureVarying,h=e._swapTexture;for(var d in S(a&&(u||n||l)&&o),t||{})S(t[d]instanceof pe||t[d].buffer instanceof pe);for(var v in c||{})S(c[v]instanceof ke);return S(!l||f),S(!h||c[h]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n);S(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e){var t;if(e instanceof ke)return e;var n=this.sourceTextures[0][e];return n?(this._targetRefTexName=e,pt(n,{parameters:(t={},Object(x.a)(t,10241,9728),Object(x.a)(t,10240,9728),Object(x.a)(t,10242,33071),Object(x.a)(t,10243,33071),t),pixelStore:Object(x.a)({},37440,!1)})):null}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=new pe(this.gl,{byteLength:o,usage:s,accessor:u});this._createdBuffers[r]&&this._createdBuffers[r].delete(),this._createdBuffers[r]=c,this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new pe(this.gl,t);return this._createdBuffers[e]&&(this._createdBuffers[e].delete(),this._createdBuffers[e]=n),n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],S(this.feedbackBuffers[t][i]instanceof pe))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new gi(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){C(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new yn(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new yn(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new gt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(x.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new gt(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(x.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new pe(this.gl,{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,s=Object(pi.b)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:Object(mi.b)({version:At(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[yi.a].concat(e.modules||[]):e.modules,uniforms:i,inject:s,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return wi({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}(),Si="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",ki=[-1,-1,1,-1,-1,1,1,1],ji=function(e){function t(e,n){var r;Object(i.a)(this,t);var a=ki.map(function(e){return-1===e?0:e});return(r=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({},n,{vs:Si,geometry:new Nn({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(ki)},aTexCoord:{size:2,value:new Float32Array(a)},aCoordinate:{size:2,value:new Float32Array(a)}}})})))).setVertexCount(4),r}return Object(ne.a)(t,e),t}(gi),Ei=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),S(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){S("string"==typeof t),S(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new It(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){S("string"==typeof t),S(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new Ft(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){S(this._compareContexts(e,this.gl)),S("string"==typeof t.vs),S("string"==typeof t.fs),S("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new pn(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}(),Ci=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.onInitialize,a=void 0===r?function(){}:r,o=n.onFinalize,s=void 0===o?function(){}:o,u=n.useDevicePixels,c=void 0===u||u,l=n.autoResizeDrawingBuffer,f=void 0===l||l;this.props={onInitialize:a,onFinalize:s},this.setProps({autoResizeDrawingBuffer:f,useDevicePixels:c}),S(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._resolveNextFrame=null,this._nextFramePromise=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(r.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.addEventListener("message",function(n){switch(n.data.command){case"start":i=n.data.opts.canvas,r=new Map,i.addEventListener=function(e,n){t.postMessage({command:"addEventListener",type:e}),r.has(e)||r.set(e,[]),r.get(e).push(n)},i.removeEventListener=function(e,n){t.postMessage({command:"removeEventListener",type:e});var i=r.get(e);i&&i.splice(i.indexOf(n),1)},i.dispatchEvent=function(e,t){var n=r.get(e);n&&n.forEach(function(e){return e(t)})},t.canvas=i,e.start(n.data.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=n.data.width,t.canvas.height=n.data.height;break;case"event":t.canvas.dispatchEvent(n.data.type,n.data.event)}var i,r})}}}]),Object(r.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,R().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=H(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(X(this._animationFrameId),this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"waitForRender",value:function(){var e=this;return this._nextFramePromise||(this._nextFramePromise=new Promise(function(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(Yn.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._animationFrameId=H(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=D(e);t.transferControlToOffscreen||s.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),Ai=function(){function e(t,n){Object(i.a)(this,e);var r=n.id,a=void 0===r?"pass":r;this.id=a,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(r.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=gt.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),b(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),Ti=function(e){function t(e,n){return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(Ai),Li=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(i.a)(this,e),this.gl=t,this.framebuffer1=new gt(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new gt(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(r.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),Mi=function(e){function t(e,n){var r;return Object(i.a)(this,t),n=Array.isArray(n)?{passes:n}:n,(r=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"multi-pass"},n)))).renderState=new Li(e,n),r}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(Ti),Ii=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.gl,n=this.props.clearBits,i=void 0===n?16640:n;t.clear(i)}}]),t}(Ai),Fi=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(Ai),Ri="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",Di=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},r)))).clipspace=new ji(e,{id:"copy-pass",fs:Ri}),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Ai),Ni="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",zi=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t),n=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:"texture-pass"},r)));var a=r.texture,o=r.opacity,s=void 0===o?1:o;return n.clipspace=new ji(e,{id:"texture-pass",fs:Ni,uniforms:{uDiffuseSampler:a,uOpacity:s}}),n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Ai),Bi=n(147),Ui=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(Ai),Vi=function(e){function t(e,n){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(i.a)(this,t);var o="".concat(n.name,"-pass");Object(Bi.a)(n);var s=function(e,t,n,i){if(t.filter||t.sampler){var r=Xi(t),a=new Ui(e,{id:n,model:Gi(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=Xi(t,r),s="".concat(n,"-").concat(o.length+1);return new Ui(e,Object.assign({id:s,model:Gi(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,o,a);return(r=Object($.a)(this,Object(ee.a)(t).call(this,e,Object.assign({id:o,passes:s},a)))).module=n,r}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.module.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1,c.uniforms&&c.model.setUniforms(c.uniforms),c.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(Ti);function Gi(e,t,n,i,r){var a=new ji(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var Wi=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},Hi=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function Xi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return Wi(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return Hi(i)}return null}var qi={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Zi=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("truncated-code-geometry"):n,a=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,O=x(b),P=_(b),S=v?-2:0,k=l+(p?2:0),j=u+1,E=new Uint16Array(u*(l+m)*6),C=qi[h],A=new Float32Array(3*y),T=new Float32Array(3*y),L=new Float32Array(2*y),M=0,I=0,F=S;F<=k;F++){var R=F/l,D=o*R,N=void 0;F<0?(D=0,R=1,N=n):F>l?(D=o,R=1,N=r):N=n+F/l*(r-n),-2!==F&&F!==l+2||(N=0,R=0),D-=o/2;for(var z=0;zl?0:B*O,T[M+C[1]]=F<0?-1:F>l?1:P,T[M+C[2]]=F<0||F>l?0:U*O,L[I+0]=z/u,L[I+1]=R,I+=2,M+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("cone-geometry"):n,a=e.radius,o=void 0===a?1:a,s=e.cap,u=void 0===s||s;return Object($.a)(this,Object(ee.a)(t).call(this,w({},e,{id:r,topRadius:0,topCap:Boolean(u),bottomCap:Boolean(u),bottomRadius:o})))}return Object(ne.a)(t,e),t}(Zi),Ki=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]),Qi=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]),Ji=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]),$i=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]),er={POSITION:{size:3,value:new Float32Array(Qi)},NORMAL:{size:3,value:new Float32Array(Ji)},TEXCOORD_0:{size:2,value:new Float32Array($i)}},tr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("cube-geometry"):n;return Object($.a)(this,Object(ee.a)(t).call(this,w({},e,{id:r,indices:{size:1,value:new Uint16Array(Ki)},attributes:w({},er,e.attributes)})))}return Object(ne.a)(t,e),t}(Nn),nr=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("cylinder-geometry"):n,a=e.radius,o=void 0===a?1:a;return Object($.a)(this,Object(ee.a)(t).call(this,w({},e,{id:r,bottomRadius:o,topRadius:o})))}return Object(ne.a)(t,e),t}(Zi),ir=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],rr=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],ar=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("ico-sphere-geometry"):n,a=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).iterations,t=void 0===e?0:e,n=Math.PI,i=2*n,r=[].concat(ir),a=[].concat(rr);r.push(),a.push();for(var o=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,a=t>n?t:n,o="".concat(i,"|").concat(a);if(o in e)return e[o];var s=r[t],u=r[t+1],c=r[t+2],l=r[n],f=r[n+1],h=r[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,r.push(d,v,g),e[o]=r.length/3-1}}(),s=0;s=0;g-=3){var p=a[g+0],m=a[g+1],y=a[g+2],b=3*p,_=3*m,x=3*y,w=2*p,O=2*m,P=2*y,S=r[b+0],k=r[b+1],j=r[b+2],E=Math.acos(j/Math.sqrt(S*S+k*k+j*j)),C=Math.atan2(k,S)+n,A=E/n,T=1-C/i,L=r[_+0],M=r[_+1],I=r[_+2],F=Math.acos(I/Math.sqrt(L*L+M*M+I*I)),R=Math.atan2(M,L)+n,D=F/n,N=1-R/i,z=r[x+0],B=r[x+1],U=r[x+2],V=Math.acos(U/Math.sqrt(z*z+B*B+U*U)),G=Math.atan2(B,z)+n,W=V/n,H=1-G/i,X=[z-L,B-M,U-I],q=[S-L,k-M,j-I],Z=new Bn.a(X).cross(q).normalize(),Y=void 0;(0===T||0===N||0===H)&&(0===T||T>.5)&&(0===N||N>.5)&&(0===H||H>.5)&&(r.push(r[b+0],r[b+1],r[b+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=A,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z,r.push(r[_+0],r[_+1],r[_+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=D,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z,r.push(r[x+0],r[x+1],r[x+2]),Y=r.length/3-1,a.push(Y),v[2*Y+0]=1,v[2*Y+1]=W,d[3*Y+0]=Z.x,d[3*Y+1]=Z.y,d[3*Y+2]=Z.z),d[b+0]=d[_+0]=d[x+0]=Z.x,d[b+1]=d[_+1]=d[x+1]=Z.y,d[b+2]=d[_+2]=d[x+2]=Z.z,v[w+0]=T,v[w+1]=A,v[O+0]=N,v[O+1]=D,v[P+0]=H,v[P+1]=W}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(r)},NORMAL:{size:3,value:new Float32Array(d)},TEXCOORD_0:{size:2,value:new Float32Array(v)}}}}(e),o=a.indices,s=a.attributes;return Object($.a)(this,Object(ee.a)(t).call(this,w({},e,{id:r,indices:o,attributes:w({},s,e.attributes)})))}return Object(ne.a)(t,e),t}(Nn);var or=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("plane-geometry"):n,a=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")],f=e["".concat(c[1],"len")],h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,O=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=O,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*O-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*O-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*O-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0}y+=2,b+=3}for(var P=h+1,S=new Uint16Array(h*d*6),k=0;k0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var n=e.id,r=void 0===n?j("sphere-geometry"):n,a=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,O=s*y,P=Math.sin(w),S=Math.cos(w),k=Math.sin(O),j=Math.cos(O),E=S*k,C=j,A=P*k,T=o(E,C,A,m,y);f[x+0]=T*E,f[x+1]=T*C,f[x+2]=T*A,h[x+0]=E,h[x+1]=C,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var L=n+1,M=0;M1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){S(e),t=t||this.matrix;var n=new fr.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{key:"transform",value:function(){if(this.parent){var e=this.parent;this.endPosition.set(this.position.add(e.endPosition)),this.endRotation.set(this.rotation.add(e.endRotation)),this.endScale.set(this.scale.add(e.endScale))}else this.endPosition.set(this.position),this.endRotation.set(this.rotation),this.endScale.set(this.scale);for(var t=this.children,n=0;n0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,t);var r=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===r?[]:r;return a.every(function(e){return S(e instanceof hr)}),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).children=a,e}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),Rt(Object(ee.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new fr.a:n,r=new fr.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l instanceof t?l.traverse(e,{worldMatrix:r}):e(l,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return s.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(hr),vr=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object($.a)(this,Object(ee.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof gi?(n.model=e,n._setModelNodeProps(r)):n.model=new gi(e,r),n.managedResources=r.managedResources||[],n}return Object(ne.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return Rt(Object(ee.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(hr),gr=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(i.a)(this,t),(e=Object($.a)(this,Object(ee.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(ne.a)(t,e),t}(hr);n.d(t,"isWebGL",function(){return U}),n.d(t,"isWebGL2",function(){return V}),n.d(t,"lumaStats",function(){return l}),n.d(t,"createGLContext",function(){return _t}),n.d(t,"destroyGLContext",function(){return wt}),n.d(t,"resizeGLContext",function(){return Ot}),n.d(t,"setGLContextDefaults",function(){return bt}),n.d(t,"getContextInfo",function(){return ot}),n.d(t,"getGLContextInfo",function(){return at}),n.d(t,"getContextLimits",function(){return rt}),n.d(t,"FEATURES",function(){return st}),n.d(t,"hasFeature",function(){return ct}),n.d(t,"hasFeatures",function(){return lt}),n.d(t,"getFeatures",function(){return ft}),n.d(t,"canCompileGLGSExtension",function(){return vt}),n.d(t,"cloneTextureFrom",function(){return pt}),n.d(t,"getKeyValue",function(){return Q}),n.d(t,"getKey",function(){return J}),n.d(t,"setContextDefaults",function(){return bt}),n.d(t,"glGetDebugInfo",function(){return N}),n.d(t,"trackContextState",function(){return m.a}),n.d(t,"resetParameters",function(){return f.d}),n.d(t,"getParameter",function(){return f.b}),n.d(t,"getParameters",function(){return f.c}),n.d(t,"setParameter",function(){return f.e}),n.d(t,"setParameters",function(){return p}),n.d(t,"withParameters",function(){return b}),n.d(t,"getModifiedParameters",function(){return f.a}),n.d(t,"Buffer",function(){return pe}),n.d(t,"Shader",function(){return Mt}),n.d(t,"VertexShader",function(){return It}),n.d(t,"FragmentShader",function(){return Ft}),n.d(t,"Program",function(){return pn}),n.d(t,"Framebuffer",function(){return gt}),n.d(t,"Renderbuffer",function(){return De}),n.d(t,"Texture2D",function(){return ke}),n.d(t,"TextureCube",function(){return Te}),n.d(t,"clear",function(){return Xe}),n.d(t,"clearBuffer",function(){return qe}),n.d(t,"readPixelsToArray",function(){return Ye}),n.d(t,"readPixelsToBuffer",function(){return Ke}),n.d(t,"copyToDataUrl",function(){return Qe}),n.d(t,"copyToImage",function(){return Je}),n.d(t,"copyToTexture",function(){return $e}),n.d(t,"blit",function(){return et}),n.d(t,"Query",function(){return mn}),n.d(t,"Texture3D",function(){return Me}),n.d(t,"TransformFeedback",function(){return yn}),n.d(t,"VertexArrayObject",function(){return Pn}),n.d(t,"VertexArray",function(){return jn}),n.d(t,"UniformBufferLayout",function(){return Tn}),n.d(t,"setPathPrefix",function(){return Oe}),n.d(t,"loadFile",function(){return Pe}),n.d(t,"loadImage",function(){return Se}),n.d(t,"_Accessor",function(){return he}),n.d(t,"_clearBuffer",function(){return qe}),n.d(t,"Geometry",function(){return Nn}),n.d(t,"Material",function(){return zn}),n.d(t,"AmbientLight",function(){return Xn}),n.d(t,"DirectionalLight",function(){return qn}),n.d(t,"PointLight",function(){return Zn}),n.d(t,"AnimationLoop",function(){return Qn}),n.d(t,"encodePickingColor",function(){return $n}),n.d(t,"decodePickingColor",function(){return ei}),n.d(t,"getNullPickingColor",function(){return ti}),n.d(t,"Model",function(){return gi}),n.d(t,"Transform",function(){return Pi}),n.d(t,"ClipSpace",function(){return ji}),n.d(t,"_ShaderCache",function(){return Ei}),n.d(t,"_AnimationLoopProxy",function(){return Ci}),n.d(t,"_MultiPassRenderer",function(){return Mi}),n.d(t,"_RenderState",function(){return Li}),n.d(t,"_Pass",function(){return Ai}),n.d(t,"_CompositePass",function(){return Ti}),n.d(t,"_ClearPass",function(){return Ii}),n.d(t,"_RenderPass",function(){return Fi}),n.d(t,"_CopyPass",function(){return Di}),n.d(t,"_TexturePass",function(){return zi}),n.d(t,"_ShaderModulePass",function(){return Vi}),n.d(t,"ConeGeometry",function(){return Yi}),n.d(t,"CubeGeometry",function(){return tr}),n.d(t,"CylinderGeometry",function(){return nr}),n.d(t,"IcoSphereGeometry",function(){return ar}),n.d(t,"PlaneGeometry",function(){return or}),n.d(t,"SphereGeometry",function(){return sr}),n.d(t,"TruncatedConeGeometry",function(){return Zi}),n.d(t,"PhongMaterial",function(){return cr}),n.d(t,"PBRMaterial",function(){return lr}),n.d(t,"ScenegraphNode",function(){return hr}),n.d(t,"GroupNode",function(){return dr}),n.d(t,"ModelNode",function(){return vr}),n.d(t,"CameraNode",function(){return gr}),n.d(t,"registerShaderModules",function(){return ai.u}),n.d(t,"setDefaultShaderModules",function(){return ai.v}),n.d(t,"assembleShaders",function(){return ai.c}),n.d(t,"createShaderHook",function(){return ai.g}),n.d(t,"createModuleInjection",function(){return ai.f}),n.d(t,"combineInjects",function(){return ai.d}),n.d(t,"normalizeShaderModule",function(){return ai.p}),n.d(t,"fp32",function(){return ai.j}),n.d(t,"fp64",function(){return ai.k}),n.d(t,"project",function(){return ai.t}),n.d(t,"lights",function(){return ai.o}),n.d(t,"dirlight",function(){return ai.i}),n.d(t,"picking",function(){return ai.s}),n.d(t,"diffuse",function(){return ai.h}),n.d(t,"gouraudlighting",function(){return ai.n}),n.d(t,"phonglighting",function(){return ai.r}),n.d(t,"pbr",function(){return ai.q}),n.d(t,"_transform",function(){return ai.b}),n.d(t,"MODULAR_SHADERS",function(){return ai.a}),n.d(t,"getQualifierDetails",function(){return ai.m}),n.d(t,"getPassthroughFS",function(){return ai.l}),n.d(t,"typeToChannelSuffix",function(){return ai.x}),n.d(t,"typeToChannelCount",function(){return ai.w}),n.d(t,"convertToVec4",function(){return ai.e}),n.d(t,"log",function(){return s}),n.d(t,"assert",function(){return S}),n.d(t,"uid",function(){return j}),n.d(t,"self",function(){return o.c}),n.d(t,"window",function(){return o.d}),n.d(t,"global",function(){return o.b}),n.d(t,"document",function(){return o.a})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n=24&&2303741511===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint32(16,u),height:e.getUint32(20,u)}}}],["image/jpeg",{test:function(e){return e.byteLength>=2&&65496===e.getUint16(0,u)},getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,u))return null;var t=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),n=t.tableMarkers,i=t.sofMarkers,r=2;for(;r=10&&1195984440===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint16(6,c),height:e.getUint16(8,c)}}}],["image/bmp",{test:function(e){return e.byteLength>=2&&16973===e.getUint16(0,u)},getSize:function(e){return{width:e.getUint32(18,c),height:e.getUint32(22,c)}}}]]);"Invalid MIME type. Supported MIME types are: ".concat(Array.from(l.keys()).join(", "));s.a._parseImageNode;function f(e,t){return h.apply(this,arguments)}function h(){return(h=Object(o.a)(a.a.mark(function e(t,n){var i,r,o;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return r=e.sent,e.next=6,r.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}var d=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],v={extensions:d,loadAndParse:f},g=n(78),p=n(14);var m={name:"JSON",extensions:["json","geojson"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},y=n(1),b={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n} geometry;\n",fs:"\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n"},_=n(61),x={name:"project32",dependencies:[_.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"};var w="7.2.0-alpha.4";if(g.a.deck&&g.a.deck.VERSION!==w)throw new Error("deck.gl - multiple versions detected: ".concat(g.a.deck.VERSION," vs ").concat(w));g.a.deck||(p.a.log(0,"deck.gl ".concat(w," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),g.a.deck=g.a.deck||{VERSION:w,version:w,log:p.a},Object(i.b)([m,v]),Object(y.registerShaderModules)([y.fp32,_.a,x,y.gouraudlighting,y.phonglighting,y.picking]),Object(y.setDefaultShaderModules)([b,_.a]),Object(y.createShaderHook)("vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)"),Object(y.createShaderHook)("vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)"),Object(y.createShaderHook)("vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)"),Object(y.createShaderHook)("fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"),Object(y.createModuleInjection)("geometry",{hook:"vs:DECKGL_FILTER_COLOR",order:99,injection:"\n #ifdef COLOR_FORMAT_RGB\n color.a *= 255.;\n #endif\n"}),Object(y.createModuleInjection)("picking",{hook:"fs:DECKGL_FILTER_COLOR",order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n"}));var O=n(27),P=n(98),S=n(2),k=n.n(S),j=n(3),E=n.n(j),C=n(7),A=n.n(C),T=n(4),L=n.n(T),M=n(8),I=n.n(M),F=n(102),R=function(e){function t(e){var n;return k()(this,t),(n=A()(this,L()(t).call(this,e))).projectedLight=new y.PointLight(e),n}return I()(t,e),E()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=Object(F.b)(this.position,{viewport:n,coordinateSystem:r,coordinateOrigin:a,fromCoordinateSystem:n.isGeospatial?O.a.LNGLAT:O.a.IDENTITY,fromCoordinateOrigin:[0,0,0]});return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=o,this.projectedLight}}]),t}(y.PointLight),D=n(99),N=n(90),z=function(e){function t(){return k()(this,t),A()(this,L()(t).apply(this,arguments))}return I()(t,e),E()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=i.modelMatrix,s=Object(N.b)({viewport:n,modelMatrix:o,coordinateSystem:r,coordinateOrigin:a}).project_uCameraPosition;return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=s,this.projectedLight}}]),t}(R),B=n(150),U=n.n(B),V=Math.PI/180,G=864e5,W=2440588,H=2451545,X=23.4397*V,q=357.5291,Z=.98560028,Y=280.147,K=360.9856235;function Q(e,t,n){var i,r,a,o,s,u,c=V*-n,l=V*t,f=function(e){return function(e){return e/G-.5+W}(e)-H}(e),h=(i=V*(q+Z*f),r=V*(1.9148*Math.sin(i)+.02*Math.sin(2*i)+3e-4*Math.sin(3*i)),a=i+r+102.9372*V+Math.PI,{declination:(o=a,s=0,u=o,Math.asin(Math.sin(s)*Math.cos(X)+Math.cos(s)*Math.sin(X)*Math.sin(u))),rightAscension:J(a,0)}),d=function(e,t){return V*(Y+K*e)-t}(f,c)-h.rightAscension;return{azimuth:$(d,l,h.declination),altitude:ee(d,l,h.declination)}}function J(e,t){var n=e;return Math.atan2(Math.sin(n)*Math.cos(X)-Math.tan(t)*Math.sin(X),Math.cos(n))}function $(e,t,n){var i=e,r=t,a=n;return Math.atan2(Math.sin(i),Math.cos(i)*Math.sin(r)-Math.tan(a)*Math.cos(r))}function ee(e,t,n){var i=e,r=t,a=n;return Math.asin(Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos(i))}var te=function(e){function t(e){var n,i=e.timestamp,r=U()(e,["timestamp"]);return k()(this,t),(n=A()(this,L()(t).call(this,r))).timestamp=i,n}return I()(t,e),E()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer.context.viewport,n=t.latitude,i=t.longitude;return this.direction=function(e,t,n){var i=Q(e,t,n),r=i.azimuth,a=i.altitude,o=r+Math.PI;return[-Math.sin(o),-Math.cos(o),-Math.sin(a)]}(this.timestamp,n,i),this}}]),t}(y.DirectionalLight),ne=n(101),ie=n(83),re=n(135),ae=n(113),oe=n(116),se=n(85),ue=n(134),ce=n(120),le=n(39),fe=n(112),he=n(109),de=n(42),ve=n(111),ge=n(140),pe=n(138),me=n(30),ye=n(81);var be=function(e){function t(){return k()(this,t),A()(this,L()(t).apply(this,arguments))}return I()(t,e),E()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.bearing,i=t.pitch,r=t.position,a=t.up,o=50*t.zoom,s=function(e){var t=e.bearing,n=e.pitch;return new pe.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:n,pitch:i}).scale(-o).multiply(new me.a(1,1,-1)),u=(new ye.a).multiplyRight((new ye.a).lookAt({eye:s,center:r,up:a}));return new le.a(Object.assign({},e,{id:this.id,zoom:null,viewMatrix:u}))}}]),t}(de.a);be.displayName="ThirdPersonView";var _e=n(141),xe=n(18),we=Math.PI/180,Oe=function(e){function t(){return k()(this,t),A()(this,L()(t).apply(this,arguments))}return I()(t,e),E()(t,[{key:"_getViewport",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.viewState,o=a.eye,s=a.lookAt,u=void 0===s?[0,0,0]:s,c=a.up,l=void 0===c?[0,1,0]:c,f=e.fovy||a.fovy||75,h=e.near||a.near||1,d=e.far||a.far||100,v=Number.isFinite(a.aspect)?a.aspect:i/r,g=f*we;return new le.a({id:this.id,x:t,y:n,width:i,height:r,viewMatrix:xe.f([],o,u,l),projectionMatrix:xe.i([],g,v,h,d)})}}]),t}(de.a);Oe.displayName="PerspectiveView";var Pe=n(142),Se=n(60),ke=n(119),je=n(114),Ee=n(84),Ce=n(115),Ae=n(72),Te=n(59),Le=n(58),Me=n(125),Ie=n(20),Fe=n(44),Re=n(24),De=n(41),Ne=.01,ze=["longitude","latitude","zoom"];var Be=["bearing","pitch"],Ue=function(e){function t(){return k()(this,t),A()(this,L()(t).call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]}))}return I()(t,e),E()(t,[{key:"interpolateProps",value:function(e,t,n){for(var i=function(e,t,n){var i={},r=e.zoom,a=[e.longitude,e.latitude],o=Object(Re.l)(r),s=t.zoom,u=[t.longitude,t.latitude],c=Object(Re.l)(s-r),l=Object(Re.g)(a,o),f=Object(Re.g)(u,o),h=De.g([],f,l),d=Math.max(e.width,e.height),v=d/c,g=De.c(h);if(Math.abs(g)0&&void 0!==arguments[0]?arguments[0]:{};k()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=He.a,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return E()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64,a=e.dataChanged;if(this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,Array.isArray(a)){var o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;this._rebuildGeometry(f)}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(Ge.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w0&&void 0!==arguments[0]?arguments[0]:{};k()(this,e),this.opts=t}return E()(e,[{key:"equals",value:function(e){return this===e||this.constructor===e.constructor&&Object(Ye.a)(this.opts,e.opts)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var t=e.constructor.defaultProps,n=void 0===t?{}:t,i={updateTriggers:{}};for(var r in n)if(r in this.props){var a=n[r],o=this.props[r];i[r]=o,a&&"accessor"===a.type&&(i.updateTriggers[r]=this.props.updateTriggers[r],"function"==typeof o&&(i[r]=this.getSubLayerAccessor(o,!0)))}return i}},{key:"initializeState",value:function(e,t){}},{key:"updateState",value:function(e,t){}},{key:"finalizeState",value:function(e){}}]),e}();n.d(t,"experimental",function(){return Qe}),n.d(t,"COORDINATE_SYSTEM",function(){return O.a}),n.d(t,"LightingEffect",function(){return P.a}),n.d(t,"PointLight",function(){return R}),n.d(t,"DirectionalLight",function(){return D.a}),n.d(t,"_CameraLight",function(){return z}),n.d(t,"_SunLight",function(){return te}),n.d(t,"PostProcessEffect",function(){return ne.a}),n.d(t,"_LayersPass",function(){return ie.a}),n.d(t,"Deck",function(){return re.a}),n.d(t,"LayerManager",function(){return ae.a}),n.d(t,"AttributeManager",function(){return oe.a}),n.d(t,"Layer",function(){return se.a}),n.d(t,"CompositeLayer",function(){return ue.a}),n.d(t,"DeckRenderer",function(){return ce.a}),n.d(t,"Viewport",function(){return le.a}),n.d(t,"WebMercatorViewport",function(){return fe.a}),n.d(t,"project",function(){return _.a}),n.d(t,"project64",function(){return he.a}),n.d(t,"View",function(){return de.a}),n.d(t,"MapView",function(){return ve.a}),n.d(t,"FirstPersonView",function(){return ge.a}),n.d(t,"ThirdPersonView",function(){return be}),n.d(t,"OrbitView",function(){return _e.a}),n.d(t,"PerspectiveView",function(){return Oe}),n.d(t,"OrthographicView",function(){return Pe.a}),n.d(t,"Controller",function(){return Se.a}),n.d(t,"MapController",function(){return ke.a}),n.d(t,"_FirstPersonController",function(){return je.a}),n.d(t,"_OrbitController",function(){return Ee.b}),n.d(t,"_OrthographicController",function(){return Ce.a}),n.d(t,"Effect",function(){return Ae.a}),n.d(t,"TRANSITION_EVENTS",function(){return Te.a}),n.d(t,"LinearInterpolator",function(){return Le.a}),n.d(t,"FlyToInterpolator",function(){return Ue}),n.d(t,"log",function(){return p.a}),n.d(t,"createIterable",function(){return Ge.a}),n.d(t,"fp64LowPart",function(){return We.c}),n.d(t,"AmbientLight",function(){return y.AmbientLight}),n.d(t,"LayerExtension",function(){return Ke});var Qe={Tesselator:Xe,flattenVertices:Ve.c,fillArray:Ve.a,count:qe.a,memoize:Ze.a}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"e",function(){return d});var i={};function r(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function a(e){return Math.round(e/i.EPSILON)*i.EPSILON}function o(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function O(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.h([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function S(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function k(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){"use strict";var i=n(87),r=n(108),a=n(100),o=n(147),s=n(82),u={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null};function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var l="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",f="".concat(l,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),h={ONE:1};var d={name:"fp64",vs:f,fs:null,fp64ify:c,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var i=0;i<4;++i){var r=4*n+i;c(e[4*i+n],t,2*r)}return t},getUniforms:function(){return Object.assign({},h)}},v=("".concat(l),n(81)),g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p={modelMatrix:g,viewMatrix:g,projectionMatrix:g,cameraPositionWorld:[0,0,0]};var m="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",y={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new v.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(m,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(m)},b="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",_={name:"lights",vs:b,fs:b,getUniforms:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,r=n.pointLights,a=n.directionalLights,o=i||r&&r.length>0||a&&a.length>0;return o?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,a=void 0===r?[]:r,o={};o["lighting_uAmbientLight.color"]=t?w(t):[0,0,0];return i.forEach(function(e,t){o["lighting_uPointLight[".concat(t,"].color")]=w(e),o["lighting_uPointLight[".concat(t,"].position")]=e.position,o["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),o.lighting_uPointLightCount=i.length,a.forEach(function(e,t){o["lighting_uDirectionalLight[".concat(t,"].color")]=w(e),o["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),o.lighting_uDirectionalLightCount=a.length,o}({ambientLight:i,pointLights:r,directionalLights:a}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var s={pointLights:[],directionalLights:[]},u=!0,c=!1,l=void 0;try{for(var f,h=(t.lights||[])[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;switch(d.type){case"ambient":s.ambientLight=d;break;case"directional":s.directionalLights.push(d);break;case"point":s.pointLights.push(d)}}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}return e({lightSources:s})}return{}},defines:{MAX_LIGHTS:3}},x={};function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}var O={lightDirection:new Float32Array([1,1,2])};var P={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[y]},S={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};var k={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:S,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}},j={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var E={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},C="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",A={name:"gouraud-lighting",dependencies:[_],vs:C,defines:{LIGHTING_VERTEX:1},getUniforms:M},T={name:"phong-lighting",dependencies:[_],fs:C,defines:{LIGHTING_FRAGMENT:1},getUniforms:M},L={};function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor,t}(t):{lighting_uEnabled:!1}}var I="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",F={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[{name:"project2",vs:I,fs:I},_]},R=n(139);n.d(t,"a",function(){return D}),n.d(t,"u",function(){return i.b}),n.d(t,"v",function(){return i.d}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.b}),n.d(t,"p",function(){return o.a}),n.d(t,"m",function(){return s.c}),n.d(t,"l",function(){return s.b}),n.d(t,"x",function(){return s.e}),n.d(t,"w",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u}),n.d(t,"k",function(){return d}),n.d(t,"t",function(){return y}),n.d(t,"o",function(){return _}),n.d(t,"i",function(){return P}),n.d(t,"s",function(){return k}),n.d(t,"h",function(){return E}),n.d(t,"n",function(){return A}),n.d(t,"r",function(){return T}),n.d(t,"q",function(){return F}),n.d(t,"b",function(){return R.a});var D={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",defaultUniforms:{}}},function(e,t,n){"use strict";(function(e){n.d(t,"c",function(){return c}),n.d(t,"b",function(){return d}),n.d(t,"a",function(){return v});var i=n(5),r=n(37),a=n(71),o="luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",s=e,u=null;function c(){var e=s.require("gl");if(!e)throw new Error(o);return e.apply(void 0,arguments)}if(!a.a)try{u=s.require("gl/wrap")}catch(e){}var l=function e(){Object(i.a)(this,e)},f=u||r.b,h=(f.WebGLRenderingContext,f.WebGLProgram,f.WebGLShader,f.WebGLBuffer),d=void 0===h?l:h;f.WebGLFramebuffer,f.WebGLRenderbuffer,f.WebGLTexture,f.WebGLUniformLocation,f.WebGLActiveInfo,f.WebGLShaderPrecisionFormat;var v=r.b.WebGL2RenderingContext||function e(){Object(i.a)(this,e)};r.b.Image}).call(this,n(164)(e))},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r});var i={LNGLAT:1,LNGLAT_DEPRECATED:5,METER_OFFSETS:2,METERS:2,LNGLAT_OFFSETS:3,IDENTITY:0},r={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},function(e,t,n){"use strict";function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(5),r=n(6),a=n(11),o=n(10),s=n(12),u=n(88),c=n(20),l=n(35),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.c(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.j(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.k(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.l(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,n,i){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e[3]=s+i*(n[3]-s),e}function g(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}function p(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function m(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=i.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-u)<=i.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=i.b*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var y,b;y=new i.a(4),i.a!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),b=y},function(e,t,n){e.exports=n(179)()},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=i=function(e){return n(e)}:e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},i(t)}e.exports=i},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"g",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"n",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return v}),n.d(t,"a",function(){return g}),n.d(t,"m",function(){return m}),n.d(t,"f",function(){return y});var i=n(13);function r(){var e=new i.a(3);return i.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function l(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function f(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function v(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function g(e,t){var n=o(e[0],e[1],e[2]),i=o(t[0],t[1],t[2]);u(n,n),u(i,i);var r=c(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var p,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},y=a;p=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";(function(e){n.d(t,"c",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},r=i.self||i.window||i.global,a=i.window||i.self||i.global,o=i.global||i.self||i.window,s=i.document||{}}).call(this,n(56))},,function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(17),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(14),l=n(62),f=n(20),h=n(81),d=n(30),v=n(18),g=n(24),p=n(16),m=Math.PI/180,y=Object(l.a)(),b=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(73),v=n(16);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,O=t.modelMatrix,P=void 0===O?null:O,S=t.viewportInstance,k=void 0===S?null:S,j=t.type,E=void 0===j?c.a:j;Object(v.a)(!k||k instanceof c.a),this.viewportInstance=k,this.id=i||this.constructor.displayName||"view",this.type=E,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(29),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(56),n(66))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(32);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.n([],t,e);return i.k(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){for(var t=1;t0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s})},function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return v}),n.d(t,"c",function(){return p});var i,r,a,o=n(23),s=n(0),u=n(49),c=(i={},Object(s.a)(i,3042,!1),Object(s.a)(i,32773,new Float32Array([0,0,0,0])),Object(s.a)(i,32777,32774),Object(s.a)(i,34877,32774),Object(s.a)(i,32969,1),Object(s.a)(i,32968,0),Object(s.a)(i,32971,1),Object(s.a)(i,32970,0),Object(s.a)(i,3106,new Float32Array([0,0,0,0])),Object(s.a)(i,3107,[!0,!0,!0,!0]),Object(s.a)(i,2884,!1),Object(s.a)(i,2885,1029),Object(s.a)(i,2929,!1),Object(s.a)(i,2931,1),Object(s.a)(i,2932,513),Object(s.a)(i,2928,new Float32Array([0,1])),Object(s.a)(i,2930,!0),Object(s.a)(i,3024,!0),Object(s.a)(i,36006,null),Object(s.a)(i,2886,2305),Object(s.a)(i,33170,4352),Object(s.a)(i,2849,1),Object(s.a)(i,32823,!1),Object(s.a)(i,32824,0),Object(s.a)(i,10752,0),Object(s.a)(i,32938,1),Object(s.a)(i,32939,!1),Object(s.a)(i,3089,!1),Object(s.a)(i,3088,new Int32Array([0,0,1024,1024])),Object(s.a)(i,2960,!1),Object(s.a)(i,2961,0),Object(s.a)(i,2968,4294967295),Object(s.a)(i,36005,4294967295),Object(s.a)(i,2962,519),Object(s.a)(i,2967,0),Object(s.a)(i,2963,4294967295),Object(s.a)(i,34816,519),Object(s.a)(i,36003,0),Object(s.a)(i,36004,4294967295),Object(s.a)(i,2964,7680),Object(s.a)(i,2965,7680),Object(s.a)(i,2966,7680),Object(s.a)(i,34817,7680),Object(s.a)(i,34818,7680),Object(s.a)(i,34819,7680),Object(s.a)(i,2978,new Int32Array([0,0,1024,1024])),Object(s.a)(i,3333,4),Object(s.a)(i,3317,4),Object(s.a)(i,37440,!1),Object(s.a)(i,37441,!1),Object(s.a)(i,37443,37444),Object(s.a)(i,35723,4352),Object(s.a)(i,36010,null),Object(s.a)(i,35977,!1),Object(s.a)(i,3330,0),Object(s.a)(i,3332,0),Object(s.a)(i,3331,0),Object(s.a)(i,3314,0),Object(s.a)(i,32878,0),Object(s.a)(i,3316,0),Object(s.a)(i,3315,0),Object(s.a)(i,32877,0),i),l=function(e,t,n){return t?e.enable(n):e.disable(n)},f=function(e,t,n){return e.hint(n,t)},h=function(e,t,n){return e.pixelStorei(n,t)},d=(r={},Object(s.a)(r,3042,l),Object(s.a)(r,32773,function(e,t){return e.blendColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,32777,"blendEquation"),Object(s.a)(r,34877,"blendEquation"),Object(s.a)(r,32969,"blendFunc"),Object(s.a)(r,32968,"blendFunc"),Object(s.a)(r,32971,"blendFunc"),Object(s.a)(r,32970,"blendFunc"),Object(s.a)(r,3106,function(e,t){return e.clearColor.apply(e,Object(o.a)(t))}),Object(s.a)(r,3107,function(e,t){return e.colorMask.apply(e,Object(o.a)(t))}),Object(s.a)(r,2884,l),Object(s.a)(r,2885,function(e,t){return e.cullFace(t)}),Object(s.a)(r,2929,l),Object(s.a)(r,2931,function(e,t){return e.clearDepth(t)}),Object(s.a)(r,2932,function(e,t){return e.depthFunc(t)}),Object(s.a)(r,2928,function(e,t){return e.depthRange.apply(e,Object(o.a)(t))}),Object(s.a)(r,2930,function(e,t){return e.depthMask(t)}),Object(s.a)(r,3024,l),Object(s.a)(r,35723,f),Object(s.a)(r,36006,function(e,t){var n=Object(u.c)(e)?36009:36160;return e.bindFramebuffer(n,t)}),Object(s.a)(r,2886,function(e,t){return e.frontFace(t)}),Object(s.a)(r,33170,f),Object(s.a)(r,2849,function(e,t){return e.lineWidth(t)}),Object(s.a)(r,32823,l),Object(s.a)(r,32824,"polygonOffset"),Object(s.a)(r,10752,"polygonOffset"),Object(s.a)(r,35977,l),Object(s.a)(r,32938,"sampleCoverage"),Object(s.a)(r,32939,"sampleCoverage"),Object(s.a)(r,3089,l),Object(s.a)(r,3088,function(e,t){return e.scissor.apply(e,Object(o.a)(t))}),Object(s.a)(r,2960,l),Object(s.a)(r,2961,function(e,t){return e.clearStencil(t)}),Object(s.a)(r,2968,function(e,t){return e.stencilMaskSeparate(1028,t)}),Object(s.a)(r,36005,function(e,t){return e.stencilMaskSeparate(1029,t)}),Object(s.a)(r,2962,"stencilFuncFront"),Object(s.a)(r,2967,"stencilFuncFront"),Object(s.a)(r,2963,"stencilFuncFront"),Object(s.a)(r,34816,"stencilFuncBack"),Object(s.a)(r,36003,"stencilFuncBack"),Object(s.a)(r,36004,"stencilFuncBack"),Object(s.a)(r,2964,"stencilOpFront"),Object(s.a)(r,2965,"stencilOpFront"),Object(s.a)(r,2966,"stencilOpFront"),Object(s.a)(r,34817,"stencilOpBack"),Object(s.a)(r,34818,"stencilOpBack"),Object(s.a)(r,34819,"stencilOpBack"),Object(s.a)(r,2978,function(e,t){return e.viewport.apply(e,Object(o.a)(t))}),Object(s.a)(r,3333,h),Object(s.a)(r,3317,h),Object(s.a)(r,37440,h),Object(s.a)(r,37441,h),Object(s.a)(r,37443,h),Object(s.a)(r,3330,h),Object(s.a)(r,3332,h),Object(s.a)(r,3331,h),Object(s.a)(r,36010,function(e,t){return e.bindFramebuffer(36008,t)}),Object(s.a)(r,3314,h),Object(s.a)(r,32878,h),Object(s.a)(r,3316,h),Object(s.a)(r,3315,h),Object(s.a)(r,32877,h),r),v={blendEquation:function(e,t){return e.blendEquationSeparate(t[32777],t[34877])},blendFunc:function(e,t){return e.blendFuncSeparate(t[32969],t[32968],t[32971],t[32970])},polygonOffset:function(e,t){return e.polygonOffset(t[32824],t[10752])},sampleCoverage:function(e,t){return e.sampleCoverage(t[32938],t[32939])},stencilFuncFront:function(e,t){return e.stencilFuncSeparate(1028,t[2962],t[2967],t[2963])},stencilFuncBack:function(e,t){return e.stencilFuncSeparate(1029,t[34816],t[36003],t[36004])},stencilOpFront:function(e,t){return e.stencilOpSeparate(1028,t[2964],t[2965],t[2966])},stencilOpBack:function(e,t){return e.stencilOpSeparate(1029,t[34817],t[34818],t[34819])}},g=function(e,t){return e.isEnabled(t)},p=(a={},Object(s.a)(a,3042,g),Object(s.a)(a,2884,g),Object(s.a)(a,2929,g),Object(s.a)(a,3024,g),Object(s.a)(a,32823,g),Object(s.a)(a,32926,g),Object(s.a)(a,32928,g),Object(s.a)(a,3089,g),Object(s.a)(a,2960,g),Object(s.a)(a,35977,g),a)},function(t,n){t.exports=e},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n(110);function r(e){for(var t in e)return!1;return!0}function a(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"c",function(){return a}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(127),r=n.n(i),a=n(36),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});var i="vs",r="fs"},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(46),r=n(110),a=n(49);function o(e,t,n){var r=i.c[t],o=r?r(e,Number(t)):e.getParameter(Number(t)),s=i.d[t];return Object(a.a)("function"==typeof s),s(e,n,Number(t)),o}function s(e,t){var n={};for(var r in t){var a=Number(r),o=i.d[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],a))}var s=e.state&&e.state.cache;if(s){var u=Object.assign({},s,t);for(var c in n){(0,i.a[c])(e,u)}}}function u(e,t){var n=i.c[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function c(e,t){t=t||i.b;var n=Array.isArray(t)?t:Object.keys(t),r={},a=!0,o=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;r[f]=u(e,f)}}catch(e){o=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return r}function l(e){s(e,Object.assign({},i.b,{}))}function f(e){var t=c(i.b),n={};for(var a in i.b)Object(r.a)(t[a],i.b[a])||(n[a]=t[a]);return n}},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}function o(e){return e&&e[Symbol.asyncIterator]}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&uHTMLVideoElement.HAVE_METADATA&&(i.width!==o.videoWidth||i.height!==o.videoHeight?(i.resize({width:o.videoWidth,height:o.videoHeight,mipmaps:!0}),i.setSubImageData({data:o,paramters:w})):i.setSubImageData({data:o}),i.generateMipmap());i&&r&&r.setUniforms(Object.assign({},t,{bitmapTexture:i,desaturate:s,transparentColor:u,tintColor:c})).draw()}},{key:"loadTexture",value:function(e){var t=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),e instanceof x.Texture2D?this.setState({bitmapTexture:e}):e instanceof Image||e instanceof HTMLCanvasElement?this.setState({bitmapTexture:new x.Texture2D(t,{data:e,parameters:w})}):e instanceof HTMLVideoElement&&this.setState({bitmapTexture:new x.Texture2D(t,{width:1,height:1,parameters:w,mipmaps:!1})})}},{key:"calculatePositions",value:function(e){var t=e.value,n=this.state.positions;t.set(n)}},{key:"calculatePositions64xyLow",value:function(e){var t=this.use64bitPositions();(e.constant=!t,t)?e.value.set(this.state.positions.map(b.c)):e.value=new Float32Array(4)}}]),t}(_.a);O.layerName="BitmapLayer",O.defaultProps={image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};var P=n(53),S=n(31),k=n.n(S),j=n(48),E=n(154),C=n.n(E),A=n(155),T=n.n(A),L=n(21);function M(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}var I=!1,F=!0,R=new Map([["image/png",function(e){var t=B(e);if(t.byteLength<24||2303741511!==t.getUint32(0,I))return null;return{width:t.getUint32(16,I),height:t.getUint32(20,I)}}],["image/jpeg",function(e){var t=B(e);if(t.byteLength<2||65496!==t.getUint16(0,I))return null;var n=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),i=n.tableMarkers,r=n.sofMarkers,a=2;for(;a1&&void 0!==arguments[1]?arguments[1]:null;if(t){var n=R.get(t);if(!n)throw new Error(D);var i=n(e);if(!i)throw new Error("invalid image data for type: ".concat(t));return i}var r=z(e,t);if(!r)throw new Error(D);return r}function z(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=R.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=Object(L.a)(a.value,2),u=s[0],c=(0,s[1])(e);if(c)return c.mimeType=u,c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function B(e){if(M&&(e=M(e)),e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}function U(e,t){return V.apply(this,arguments)}function V(){return(V=Object(j.a)(k.a.mark(function e(t,n){var i,r,a,o,s;return k.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=T.a.promisify(C.a),r=N(t),a=r.mimeType,o=t instanceof Buffer?t:Buffer.from(t),e.next=5,i(o,a);case 5:return s=e.sent,e.abrupt("return",{width:s.shape[0],height:s.shape[1],data:s.data});case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}var G;function W(e,t){return U?U(e,t):function(e){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var t=new Blob([new Uint8Array(e)]);return createImageBitmap(t)}(e)}function H(){return(H=Object(j.a)(k.a.mark(function e(t,n){var i,r;return k.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof Image){e.next=8;break}return e.next=3,fetch(t,n);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return r=e.sent,e.abrupt("return",W(r));case 8:return e.next=10,X(t,n);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function X(e,t){return q.apply(this,arguments)}function q(){return(q=Object(j.a)(k.a.mark(function e(t,n){var i,r,a;return k.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return r=e.sent,e.next=6,r.text();case 6:a=e.sent,i="data:image/svg+xml;base64,".concat(btoa(a)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Z=1024,Y=4,K=function(){},Q=(G={},y()(G,10241,9987),y()(G,10240,9729),G);function J(e){return e&&(e.id||e.url)}function $(e,t,n){for(var i=0;i0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&($(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&$(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new x.Texture2D(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:Q})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(x.readPixelsToBuffer)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:Q}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;(function(e,t){return H.apply(this,arguments)})(e.url).then(function(r){var a=J(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},Q,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),te=[0,0,0,255],ne={iconAtlas:{type:"object",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},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:te},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},ie=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors / 255.;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new ee(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getColor",defaultValue:te},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s||this.props._asyncPropOriginalValues.iconAtlas?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),r.extensionsChanged){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new x.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new x.Geometry({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(P.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=Object(b.c)(p[0]),a[o++]=Object(b.c)(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(P.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(P.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(P.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(_.a);ie.layerName="IconLayer",ie.defaultProps=ne;var re=n(145),ae=[0,0,0,255],oe=[0,0,1],se=new x.PhongMaterial,ue={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:oe},getColor:{type:"accessor",value:ae},material:se,radiusPixels:{deprecatedFor:"pointSize"}};var ce=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity) / 255.0;\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:oe},instanceColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getColor",defaultValue:ae}})}},{key:"updateState",value:function(e){var n,i,r,a=e.props,o=e.oldProps,s=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:a,oldProps:o,changeFlags:s}),s.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),this.getAttributeManager().invalidateAll()}s.dataChanged&&(n=a.data,i=n.header,r=n.attributes,i&&r&&(n.length=i.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION,r.instancePositions64xyLow={constant:!0,value:new Float32Array(2)}),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0&&(r.instanceColors=r.COLOR_0)))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new x.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new x.Geometry({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(P.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var _=s(y,h);u[c++]=Object(b.c)(_[0]),u[c++]=Object(b.c)(_[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(_.a);ce.layerName="PointCloudLayer",ce.defaultProps=ue;var le=n(118),fe=n(117),he=n(143),de=n(75),ve=n(144),ge=n(148),pe=n(134),me=n(17),ye=n.n(me),be=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position); \n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getParagraphSize,f=r.getRowSize,h=r.getOffsets,d=e.value,v=n*e.size,g=Object(P.a)(a,n,i).iterable,p=!0,m=!1,y=void 0;try{for(var b,_=g[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){var x=b.value,w=o[s(x)]||{},O=l(x),S=ye()(O,2),k=S[0],j=S[1],E=f(x),C=ye()(E,1)[0],A=h(x),T=ye()(A,2),L=T[0],M=T[1],I=u(x),F=c(x),R=(1-I)*(k-C)/2;d[v++]=(I-1)*k/2+R+w.width/2+L||0,d[v++]=(F-1)*j/2+w.height/2+M||0}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(P.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(ie);be.layerName="MultiIconLayer",be.defaultProps={getRowSize:{type:"accessor",value:function(e){return e.rowSize||[0,0]}},getOffsets:{type:"accessor",value:function(e){return e.offsets||[0,0]}},getParagraphSize:{type:"accessor",value:function(e){return e.size||[1,1]}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var _e=n(158),xe=n.n(_e),we=n(14),Oe=32;function Pe(e,t,n,i,r){var a=e.split("\n"),o=[0,0],s=0;a.forEach(function(e){var a=function(e,t,n){var i=0,r=0,a=Array.from(e);return{characters:a=a.map(function(e,a){var o={text:e,offsetLeft:i},s=t[e];return s?(i+=s.width,r||(r=s.height*n)):(we.a.warn("Missing character: ".concat(e))(),i+=Oe),o}),rowWidth:i,rowHeight:r}}(e,n,t),u=a.characters,c=a.rowWidth,l=a.rowHeight,f=[c,l];u.forEach(function(e){e.offsetTop=s,e.size=o,e.rowSize=f,r.push(i(e))}),s+=l,o[0]=Math.max(o[0],c)}),o[1]=s}var Se=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ke=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),je="Monaco, monospace",Ee="normal",Ce=64,Ae=2,Te=.25,Le=3,Me=new Se(3),Ie=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function Fe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};Ie.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=Me.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=Me.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),Me.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");Re(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(Re(h,r,o,a),u){var b=new xe.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,O=void 0;try{for(var P,S=t[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var k=P.value;Fe(b.draw(k),_),h.putImageData(_,v[k].x-s,v[k].y-s)}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}}else{var j=!0,E=!1,C=void 0;try{for(var A,T=t[Symbol.iterator]();!(j=(A=T.next()).done);j=!0){var L=A.value;h.fillText(L,v[L].x,v[L].y+.9*o)}}catch(e){E=!0,C=e}finally{try{j||null==T.return||T.return()}finally{if(E)throw C}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=Me.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),Ne=n(93),ze={fontSize:Ce,buffer:Ae,sdf:!1,radius:Le,cutoff:Te},Be={start:1,middle:0,end:-1},Ue={top:1,center:0,bottom:-1},Ve=["fontSize","buffer","sdf","radius","cutoff"],Ge={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ke,fontFamily:je,fontWeight:Ee,lineHeight:1,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},We=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new De(this.context.gl)}}},{key:"updateState",value:function(e){var t=this,n=e.props,i=e.oldProps,r=e.changeFlags,a=this.fontChanged(i,n);a&&this.updateFontAtlas({oldProps:i,props:n});var o=r.dataChanged||a||n.lineHeight!==i.lineHeight||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText);if(o&&Array.isArray(r.dataChanged)){var s=this.state.data.slice(),u=r.dataChanged.map(function(e){return Object(Ne.a)({data:s,getIndex:function(e){return e.__source.index},dataRange:e,replace:t.transformStringToLetters(e)})});this.setState({data:s,dataDiff:u})}else o&&this.setState({data:this.transformStringToLetters(),dataDiff:null})}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},ze,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return Ve.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,r=n.lineHeight,a=n.getText,o=this.state.iconMapping,s=t.startRow,u=t.endRow,c=Object(P.a)(i,s,u),l=c.iterable,f=c.objectInfo,h=[],d=!0,v=!1,g=void 0;try{for(var p,m=function(){var t=p.value;f.index++;var n=a(t,f);n&&Pe(n,r,o,function(n){return e.getSubLayerRow(n,t,f.index)},h)},y=l[Symbol.iterator]();!(d=(p=y.next()).done);d=!0)m()}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}return h}},{key:"getAnchorXFromTextAnchor",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Be[e(t)]||0}):function(){return Be[e]||0}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Be[e(t)]||0}):function(){return Ue[e]||0}}},{key:"renderLayers",value:function(){var e=this.state,t=e.data,n=e.dataDiff,i=e.scale,r=e.iconAtlas,a=e.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.billboard,g=o.sdf,p=o.sizeScale,m=o.sizeUnits,y=o.sizeMinPixels,b=o.sizeMaxPixels,_=o.transitions,x=o.updateTriggers;return new(this.getSubLayerClass("characters",be))({sdf:g,iconAtlas:r,iconMapping:a,_dataDiff:n&&function(){return n},getPosition:this.getSubLayerAccessor(s),getColor:this.getSubLayerAccessor(u),getSize:this.getSubLayerAccessor(c),getAngle:this.getSubLayerAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this.getSubLayerAccessor(d),getPickingIndex:function(e){return e.__source.index},billboard:v,sizeScale:p*i,sizeUnits:m,sizeMinPixels:y*i,sizeMaxPixels:b*i,transitions:_&&{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:x.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:x.getPixelOffset,getAnchorX:x.getTextAnchor,getAnchorY:x.getAlignmentBaseline}}),{data:t,getIcon:function(e){return e.text},getRowSize:function(e){return e.rowSize},getOffsets:function(e){return[e.offsetLeft,e.offsetTop]},getParagraphSize:function(e){return e.size}})}}]),t}(pe.a);We.layerName="TextLayer",We.defaultProps=Ge;var He=n(86);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return O}),n.d(t,"IconLayer",function(){return ie}),n.d(t,"LineLayer",function(){return re.a}),n.d(t,"PointCloudLayer",function(){return ce}),n.d(t,"ScatterplotLayer",function(){return le.a}),n.d(t,"ColumnLayer",function(){return fe.a}),n.d(t,"GridCellLayer",function(){return he.a}),n.d(t,"PathLayer",function(){return de.a}),n.d(t,"PolygonLayer",function(){return ve.a}),n.d(t,"GeoJsonLayer",function(){return ge.a}),n.d(t,"TextLayer",function(){return We}),n.d(t,"SolidPolygonLayer",function(){return He.a}),n.d(t,"_MultiIconLayer",function(){return be})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(125),v=n(20),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(58),u=n(126),c=n(16),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(59),u=n(14),c=n(16),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,e.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){if(!this.isDragging())return!1;var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState,r={};switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut(),r.isZooming=!0;break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn(),r.isZooming=!0;break;case 37:n?(t=i.rotateLeft(),r.isRotating=!0):(t=i.moveLeft(),r.isPanning=!0);break;case 39:n?(t=i.rotateRight(),r.isRotating=!0):(t=i.moveRight(),r.isPanning=!0);break;case 38:n?(t=i.rotateUp(),r.isRotating=!0):(t=i.moveUp(),r.isPanning=!0);break;case 40:n?(t=i.rotateDown(),r.isRotating=!0):(t=i.moveDown(),r.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),r),!0}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";var i=n(1),r=n(40),a=Object.keys(r.a).map(function(e){return"const float COORDINATE_SYSTEM_".concat(e," = ").concat(r.a[e],".;")}).join(""),o="".concat(a,"\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform float project_uAntimeridian;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n dy = clamp(dy, -1., 1.);\n }\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return project_uViewProjectionMatrix * position + project_uCenter;\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n"),s=n(90),u={};t.a={name:"project",dependencies:[i.fp32],vs:o,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?Object(s.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return v});var i=n(30);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-t[2],-t[6],-t[10]],up:[t[1],t[5],t[9]],right:[t[0],t[4],t[8]]}}var o=new i.a,s=new i.a,u=new i.a,c=new i.a,l=new i.a,f=new i.a,h=new i.a;function d(e){var t=e.aspect,n=e.near,r=e.far,a=e.fovyRadians,d=e.position,v=e.direction,g=e.up,p=e.right;s.copy(v);var m=1/s.len();s.normalize(),o.copy(d),u.copy(g).normalize(),c.copy(p).normalize();var y=2*Math.tan(a/2)*n,b=y*t;l.copy(s).scale(n*m).add(o),f.copy(s).scale(r*m).add(o);var _=s.clone().negate(),x=_.dot(l),w={near:{d:x,n:_},far:{d:s.dot(f),n:s.clone()}};return h.copy(c).scale(.5*b).add(l).subtract(o).normalize(),_=new i.a(u).cross(h),x=o.dot(_),w.right={n:_,d:x},h.copy(c).scale(.5*-b).add(l).subtract(o).normalize(),_=new i.a(h).cross(u),x=o.dot(_),w.left={n:_,d:x},h.copy(u).scale(.5*y).add(l).subtract(o).normalize(),_=new i.a(h).cross(c),x=o.dot(_),w.top={n:_,d:x},h.copy(u).scale(.5*-y).add(l).subtract(o).normalize(),_=new i.a(c).cross(h),x=o.dot(_),w.bottom={n:_,d:x},w}function v(e){return e-Math.fround(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(68),r=n(43);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t){var n,i,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),c(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(56))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(121),r="7.2.0-alpha.4",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},function(e,t,n){"use strict";(function(e){var i=n(29),r=n(149),a=!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||r.a;t.a=a}).call(this,n(66))},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";function i(e,t){return e===t||Object.keys(e).every(function(n){return Array.isArray(e[n])&&Array.isArray(t[n])?i(e[n],t[n]):e[n]===t[n]})}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(85),p=n(1),m=n(19),y=n(62),b=m.experimental.Tesselator,_=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3,padding:3},endPositions:{size:3,padding:3},segmentTypes:{size:1,type:Uint8ClampedArray},startPositions64XyLow:{size:2,padding:2,fp64Only:!0},endPositions64XyLow:{size:2,padding:2,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){var t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t+1:Math.max(0,t-1)}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.startPositions64XyLow,o=n.endPositions64XyLow,s=n.segmentTypes,u=this.fp64,c=t.geometrySize;if(0!==c)for(var l,f,h=this.isClosed(e),d=t.vertexStart,v=0;v=e.length&&(t+=1-e.length/n),[e[t*n],e[t*n+1],3===n?e[t*n+2]:0]}return t>=e.length&&(t+=1-e.length),e[t]}},{key:"isClosed",value:function(e){var t=this.getPathLength(e),n=this.getPointOnPath(e,0),i=this.getPointOnPath(e,t-1);return n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]}}]),t}(b);n.d(t,"a",function(){return P});var x=[0,0,0,255],w={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:x},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},O={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},P=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceLeftStartPositions64xyLow;\nattribute vec4 instanceEndRightPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width, vec2 widthPixels\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = !isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0);\n bool isEndCap = isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0);\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(vCornerOffset * widthPixels * isValid, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n return currPoint + vec3(offset.xy / widthPixels * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n vec2 width = billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width, widthPixels\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.worldPosition = instanceStartPositions;\n geometry.worldPositionAlt = instanceEndPositions;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceLeftStartPositions64xyLow.xy, instanceLeftStartPositions64xyLow.zw, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceLeftStartPositions64xyLow.zw, instanceEndRightPositions64xyLow.xy, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceEndRightPositions64xyLow.xy, instanceEndRightPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({startPositions:{size:3,offset:12,transition:O,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{offset:0},instanceStartPositions:{offset:12}}},endPositions:{size:3,transition:O,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0,shaderAttributes:{instanceEndPositions:{offset:0},instanceRightPositions:{offset:12}}},instanceLeftStartPositions64xyLow:{size:4,stride:8,update:this.calculateLeftStartPositions64xyLow,noAlloc:!0},instanceEndRightPositions64xyLow:{size:4,stride:8,update:this.calculateEndRightPositions64xyLow,noAlloc:!0},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:O,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:this.props.colorFormat.length,type:5121,accessor:"getColor",transition:O,defaultValue:x},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new _({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions(),dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),r.dataChanged||a.invalidateAll()}if(r.extensionsChanged){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new p.Geometry({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateSegmentTypes",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("segmentTypes")}},{key:"calculateLeftStartPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startPositions64XyLow"):new Float32Array(4)}},{key:"calculateEndRightPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("endPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(88).a),p=n(18),m=n(41),y=n(35),b=n(32);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.n(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.n(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.n(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.n(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.n(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(21),r=n(77),a="void main() {gl_FragColor = vec4(0);}",o="#version 300 es\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}";function s(e,t){t=Array.isArray(t)?t:[t];var n=e.replace(/^\s+/,"").split(/\s+/),r=Object(i.a)(n,3),a=r[0],o=r[1],s=r[2];return t.includes(a)&&o&&s?{qualifier:a,type:o,name:s.split(";")[0]}:null}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(124),v=n(1),g=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.withParameters)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.withParameters)(e,{scissorTest:!0,scissor:l},function(){return Object(v.clear)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(v.setParameters)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,mousePosition:e.context.mousePosition,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.withParameters)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return O});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(132),v=n(20),g=n(60),p=n(92),m=n(58),y=n(59),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,O=void 0===w?b.minZoom:w,P=e.maxZoom,S=void 0===P?b.maxZoom:P,k=e.startPanPosition,j=e.startTarget,E=e.startRotationX,C=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:O,maxZoom:S})))._interactiveState={startPanPosition:k,startTarget:j,startRotationX:E,startRotationOrbit:C,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c=Object.keys(t),l=0;l=0&&n.modules.splice(i,1)}return"inject"in t&&(n.inject=Object.assign({},e.inject,t.inject)),n}var T=n(102),L=n(70),M=n(53),I={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return N(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return F(e,t)}},accessor:{validate:function(e,t){var n=z(e);return"function"===n||n===z(t.value)},equal:function(e,t,n){return"function"==typeof t||F(e,t)}},array:{validate:function(e,t){return t.optional&&!e||N(e)},equal:function(e,t,n){return n.compare?F(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function F(e,t){if(e===t)return!0;if(!N(e)||!N(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=Q,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):Object(M.b)(t)?this._resolveAsyncIterable(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){t=n._postProcessValue(e,t),n._setAsyncPropValue(e,t,r);var i=n.layer.props.onDataLoad;"data"===e&&i&&i(t,{propName:e,layer:n.layer})}).catch(function(e){return E.a.error(e)()})}},{key:"_resolveAsyncIterable",value:function(){var e=Z()(X.a.mark(function e(t,n){var i,r,a,o,s,u,c,l,f,h,d,v;return X.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"data"!==t&&this._setPropValue(t,n),(i=this.asyncProps[t]).pendingLoadCount++,r=i.pendingLoadCount,a=[],o=0,s=!0,u=!1,e.prev=8,l=K()(n);case 10:return e.next=12,l.next();case 12:return f=e.sent,s=f.done,e.next=16,f.value;case 16:if(h=e.sent,s){e.next=26;break}d=h,a=this._postProcessValue(t,d,a),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:o,endRow:a.length}]}),o=a.length,this._setAsyncPropValue(t,a,r);case 23:s=!0,e.next=10;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(8),u=!0,c=e.t0;case 32:if(e.prev=32,e.prev=33,s||null==l.return){e.next=37;break}return e.next=37,l.return();case 37:if(e.prev=37,!u){e.next=40;break}throw c;case 40:return e.finish(37);case 41:return e.finish(32);case 42:(v=this.layer.props.onDataLoad)&&v(a,{propName:t,layer:this.layer});case 44:case"end":return e.stop()}},e,this,[[8,28,32,42],[33,,37,41]])}));return function(t,n){return e.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(e,t,n){var i=(this.component?this.component.props:{}).dataTransform;return"data"!==e?t:i?i(t,n):n?n.concat(t):t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),$=0,ee=function(){function e(){o()(this,e),this.props=function(){for(var e=U(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=e.match(Oe);if(i&&i[0]){var r=function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object(_e.b)(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,i[0]);if(r)return r}var a=function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s.testText&&s.testText(t))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,t);return a||null}var Se=n(76),ke=function(e){return e&&e instanceof ArrayBuffer},je=function(e){return e&&e instanceof Buffer};function Ee(e){if(ke(e))return e;if(je(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){var t=e;return(new TextEncoder).encode(t).buffer}return Object(ge.a)(!1)}var Ce=new Map;function Ae(e,t,n){var i=function(e){var t=Ce.get(e);if(!t){var n=new Blob([e],{type:"application/javascript"});t=URL.createObjectURL(n),Ce.set(e,t)}return new Worker(t)}(e);n=function(e){null!==(e=Object.assign({},e)).log&&delete e.log;return e}(n);var r=function(e,t){return new Promise(function(n,r){i.onmessage=function(e){switch(e.data.type){case"done":n(e.data.result),i.terminate();break;case"error":r(new Error(e.data.message))}};var a=Ee(e);i.postMessage({arraybuffer:a,opts:t},[a])})};return t?r(t,n):r}function Te(e){this.wrapped=e}function Le(e){var t,n;function i(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Te;Promise.resolve(s?o.wrapped:o).then(function(e){s?i("next",e):r(a.done?"return":"normal",e)},function(e){i("throw",e)})}catch(e){r("throw",e)}}function r(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(a,o){var s={key:e,arg:r,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,i(e,r))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(Le.prototype[Symbol.asyncIterator]=function(){return this}),Le.prototype.next=function(e){return this._invoke("next",e)},Le.prototype.throw=function(e){return this._invoke("throw",e)},Le.prototype.return=function(e){return this._invoke("return",e)};n(151);var Me="Cannot convert supplied data type";function Ie(e){return se(e)?e.url:null}function Fe(e,t){if(t.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){var n=e.buffer||e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}throw new Error(Me)}function Re(e,t){return De.apply(this,arguments)}function De(){return(De=oe(re.a.mark(function e(t,n){var i;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(t=e.sent,i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=6;break}return e.abrupt("return",Fe(t,n));case 6:if(!ue(t)){e.next=10;break}return e.next=9,me(t);case 9:t=e.sent;case 10:if(!se(t)){e.next=19;break}if(!n.binary){e.next=17;break}return e.next=14,t.arrayBuffer();case 14:e.t0=e.sent,e.next=18;break;case 17:e.t0=t.text();case 18:return e.abrupt("return",e.t0);case 19:throw new Error(Me);case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ne(e,t,n,i){return ze.apply(this,arguments)}function ze(){return(ze=oe(re.a.mark(function e(t,n,i,r){return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=r||Ie(t),e.next=3,Re(t,n);case 3:if(t=e.sent,!n.parseTextSync||"string"!=typeof t){e.next=7;break}return i.dataType="text",e.abrupt("return",n.parseTextSync(t,i,r,n));case 7:if(!n.parseSync){e.next=9;break}return e.abrupt("return",n.parseSync(t,i,r,n));case 9:if(!n.parse){e.next=13;break}return e.next=12,n.parse(t,i,r,n);case 12:return e.abrupt("return",e.sent);case 13:if(!n.worker){e.next=17;break}return e.next=16,Ae(n.worker,t,i);case 16:return e.abrupt("return",e.sent);case 17:return e.abrupt("return",Object(ge.a)(!1));case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Be(e,t,n,i){return Ue.apply(this,arguments)}function Ue(){return(Ue=oe(re.a.mark(function e(t,n,i,r){var a,o;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||Object(_e.a)(n)||(r=i,i=n,n=null),a=ue(r)?r.name:r,n=n||Object(Se.a)(),o=Array.isArray(n)?Pe(a,t,n):n){e.next=6;break}return e.abrupt("return",null);case 6:return Object(_e.b)(o),i=we(i,o),e.next=10,Ne(t,o,i,a);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ve(){return(Ve=oe(re.a.mark(function e(t,n,i){var r,a,o;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||Object(_e.a)(n)||(i=n,n=null),r=ue(t)?t.name:t,n=n||Object(Se.a)(),a=Array.isArray(n)?Pe(r,null,n):n,i=we(i,a),!a||!a.loadAndParse){e.next=9;break}return e.next=8,a.loadAndParse(t,i);case 8:return e.abrupt("return",e.sent);case 9:if(!ue(o=t)&&"string"!=typeof o){e.next=14;break}return e.next=13,ye(t,i);case 13:o=e.sent;case 14:return e.abrupt("return",Be(o,n,i,r));case 15:case"end":return e.stop()}},e)}))).apply(this,arguments)}n.d(t,"a",function(){return Xe});var Ge=Object.freeze([]),We=new Uint8ClampedArray(0),He={data:{type:"data",value:Ge,async:!0},dataComparator:null,_dataDiff:{type:"function",value:function(e){return e&&e.__diff},compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:function(e,t){return function(e,t,n){return Ve.apply(this,arguments)}(e,t.layer.getLoadOptions())},compare:!1},updateTriggers:{},numInstances:void 0,visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:.8},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:g.a.LNGLAT,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:{},uniforms:{},extensions:[],framebuffer:null,animation:null,getPolygonOffset:{type:"function",value:function(e){return[0,100*-e.layerIndex]},compare:!1},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"color",value:[0,0,128,128]}},Xe=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,[{key:"toString",value:function(){var e=this.constructor.layerName||this.constructor.name;return"".concat(e,"({id: '").concat(this.props.id,"'})")}},{key:"setState",value:function(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}},{key:"setNeedsRedraw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{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:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(T.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(ne.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(T.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){E.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){E.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitPositions",value:function(){return this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return E.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.props.extensions[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=A(e,o.getShaders.call(this,o))}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return"RGB"===this.props.colorFormat&&(e=A(e,{defines:{COLOR_FORMAT_RGB:1}})),e}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();if(t.dataChanged&&n){var i=t.dataChanged;if(Array.isArray(i)){var r=!0,a=!1,o=void 0;try{for(var s,u=i[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;n.invalidateAll(c)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}else n.invalidateAll()}}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(E.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(E.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=this.getModels();if(r.length>0)for(var a=t.getChangedAttributes({clearChangedFlags:!0}),o=0,s=r.length;o2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=Object(b.c)(v),o[2*l+1]=Object(b.c)(g)),s[l]=1,l++}if(h)for(var m=0;m0&&void 0!==arguments[0]?arguments[0]:[];return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}}]),e}(),u=function(){function e(){Object(i.a)(this,e),this.shaderModules={},this.defaultShaderModules=[]}return Object(r.a)(e,[{key:"setDefaultShaderModules",value:function(e){this.defaultShaderModules=this.resolveModules(e)}},{key:"registerShaderModules",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof s)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof s)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new s(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"c",function(){return h}),n.d(t,"a",function(){return d});var c=new u;function l(e){c.setDefaultShaderModules(e)}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;c.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(c.defaultShaderModules),v(e=c.resolveModules(e))}function d(e){return c.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]=0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;ih&&d>=o&&(l=h),d>=u){f=h;break}}for(var v=l,g=f-l!==r.length,p=g&&t.slice(f),m=0;m=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(69),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},,function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=n(99),g=n(72),p={color:[255,255,255],intensity:1},m=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],y=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n.applyDefaultLights(),n}return h()(t,e),o()(t,[{key:"getParameters",value:function(e){var t=this.ambientLight,n=this.getProjectedPointLights(e);return{lightSources:{ambientLight:t,directionalLights:this.getProjectedDirectionalLights(e),pointLights:n}}}},{key:"applyDefaultLights",value:function(){var e=this.ambientLight,t=this.pointLights,n=this.directionalLights;e||0!==t.length||0!==n.length||(this.ambientLight=new d.AmbientLight(p),this.directionalLights.push(new v.a(m[0])),this.directionalLights.push(new v.a(m[1])))}},{key:"getProjectedPointLights",value:function(e){for(var t=[],n=0;n1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(72),v=n(1),g=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.withParameters)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new v.ClipSpace(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(v.clear)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(124).a),p=n(147);n.d(t,"a",function(){return m});var m=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(p.a)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=_(t),a=new g(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=_(t,r),s="".concat(n,"-").concat(a);return new g(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return y(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return b(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(17),r=n.n(i),a=n(27),o=n(90),s=n(32),u=n(35),c=n(24);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.n([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.m(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.overAlloc,i=void 0===n?2:n,a=t.poolSize,o=void 0===a?100:a;r()(this,e),this.overAlloc=i,this.poolSize=o,this._pool=[]}return o()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=void 0===i?1:i,a=n.type,o=n.padding,s=void 0===o?0:o,u=n.copy,c=void 0!==u&&u,l=a||e&&e.constructor||Float32Array,f=t*r+s;if(ArrayBuffer.isView(e)){if(f<=e.length)return e;if(f*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new l(e.buffer,0,f)}var h=this._allocate(l,f);return e&&c?h.set(e):h.fill(0,0,4),this._release(e),h}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,t){t=Math.max(Math.ceil(t*this.overAlloc),1);var n=this._pool,i=e.BYTES_PER_ELEMENT*t,r=n.findIndex(function(e){return e.byteLength>=i});return r>=0?new e(n.splice(r,1)[0],0,t):new e(t)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.poolSize&&t.shift()}}}]),e}();t.a=new s},function(e,t){function n(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise(function(r,a){var o=e.apply(t,i);function s(e){n(o,r,a,s,u,"next",e)}function u(e){n(o,r,a,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var i=n(5),r=n(6),a=n(11),o=n(10),s=n(12),u=n(28),c=n(21),l=n(44),f=n(24),h=n(18),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(137),p=n(41);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,O=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(f.l)(g);x=Math.max(.75,x);var S=Object(f.g)([d,l],P);S[2]=0;var k=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:O||1.01}),j=Object(f.f)({height:s,center:S,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:j,projectionMatrix:k}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=P,e.center=S,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,function(e,t,n){"use strict";(function(e){var t=n(69),i=n(96);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(100);n.d(t,"c",function(){return j}),n.d(t,"b",function(){return E}),n.d(t,"a",function(){return C});var w="\n\n".concat(x.a,"\n\n"),O=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),S={},k="precision highp float;\n\n";function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function E(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);S[e]=S[e]||{},S[e][o]=S[e][o]||{},Object(s.a)(!S[e][o][n],"Module injection already created"),S[e][o][n]={injection:i,order:a}}function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.vs,i=t.fs,r=Object(o.c)(t.modules||[]);return{gl:e,vs:A(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:A(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:T(r),modules:L(r)}}function A(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=void 0===o?[]:o,c=t.defines,l=void 0===c?{}:c,f=t.inject,h=void 0===f?{}:f,v=t.prologue,p=void 0===v||v,b=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var _=r===a.b,j=i.split("\n"),E=100,C="",A=i;0===j[0].indexOf("#version ")&&(E=300,C=j[0],A=j.slice(1).join("\n"));var T={};u.forEach(function(e){Object.assign(T,e.getDefines())}),Object.assign(T,l);var L=p?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(O[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(O[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(T),"\n").concat(_?"":k,"\n"):"".concat(C,"\n"),M=!1,I={},F={};for(var R in h){var D="string"==typeof h[R]?{injection:h[R],order:0}:h[R];R.match(/^(v|f)s:/)?"#"===R[3]?F[R]=[D]:I[R]=[D]:F[R]=[D]}var N=!0,z=!1,B=void 0;try{for(var U,V=u[Symbol.iterator]();!(N=(U=V.next()).done);N=!0){var G=U.value;switch(G.name){case"inject":M=!0;break;default:if(G.checkDeprecations(A,b),L+=G.getModuleSource(r,E),S[G.name]){var W=S[G.name][r];for(var H in W)H.match(/^(v|f)s:#/)?(F[H]=F[H]||[],F[H].push(W[H])):(I[H]=I[H]||[],I[H].push(W[H]))}}}}catch(e){z=!0,B=e}finally{try{N||null==V.return||V.return()}finally{if(z)throw B}}return L+=w,L+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,I),L+=A,L=Object(x.c)(L,r,F,M)}function T(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function L(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.a)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";var i=n(1),r=n(61),a=n(91),o=i.fp64.fp64ify,s=i.fp64.fp64ifyMatrix4,u=(t.a={name:"project64",dependencies:[r.a,i.fp64],vs:"\nconst vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);\n\nuniform vec2 project64_uScale;\nuniform vec2 project_uViewProjectionMatrixFP64[16];\nvoid mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) {\n\n#if defined(NVIDIA_FP64_WORKAROUND)\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64 * ONE);\n#else\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64);\n#endif\n out_val[1] = sub_fp64(PI_FP64,\n log_fp64(tan_fp64(sum_fp64(PI_4_FP64, radians_fp64(lnglat_fp64.zw) / 2.0))));\n return;\n}\n\nvoid project_position_fp64(vec4 position_fp64, out vec2 out_val[2]) {\n vec2 pos_fp64[2];\n mercatorProject_fp64(position_fp64, pos_fp64);\n vec2 x_fp64 = mul_fp64(pos_fp64[0], project64_uScale);\n vec2 y_fp64 = mul_fp64(pos_fp64[1], project64_uScale);\n out_val[0] = mul_fp64(x_fp64, WORLD_SCALE_FP64);\n out_val[1] = mul_fp64(y_fp64, WORLD_SCALE_FP64);\n\n return;\n}\n\nvoid project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val[2]) {\n vec4 position64xy = vec4(\n position.x, position64xyLow.x,\n position.y, position64xyLow.y);\n\n project_position_fp64(position64xy, out_val);\n}\n\nvec4 project_common_position_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n vec2 vertex_pos_clipspace[4];\n mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace,\n vertex_pos_clipspace);\n return vec4(\n vertex_pos_clipspace[0].x,\n vertex_pos_clipspace[1].x,\n vertex_pos_clipspace[2].x,\n vertex_pos_clipspace[3].x\n );\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec2 offset64[4];\n vec4_fp64(vec4(offset, 0.0), offset64);\n\n float z = project_size(position.z);\n vec2 projectedPosition64xy[2];\n project_position_fp64(position.xy, position64xyLow, projectedPosition64xy);\n\n vec2 commonPosition64[4];\n commonPosition64[0] = sum_fp64(offset64[0], projectedPosition64xy[0]);\n commonPosition64[1] = sum_fp64(offset64[1], projectedPosition64xy[1]);\n commonPosition64[2] = sum_fp64(offset64[2], vec2(z, 0.0));\n commonPosition64[3] = vec2(1.0, 0.0);\n\n commonPosition = vec4(projectedPosition64xy[0].x, projectedPosition64xy[1].x, z, 1.0);\n\n return project_common_position_to_clipspace_fp64(commonPosition64);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(\n position, position64xyLow, offset, commonPosition\n );\n}\nvec4 project_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n return project_common_position_to_clipspace_fp64(vertex_pos_modelspace);\n}\n",getUniforms:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return u({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},Object(a.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=s(t),r=o(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}}))},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;var n=Array.isArray(e)||ArrayBuffer.isView(e),i=Array.isArray(t)||ArrayBuffer.isView(t);if(n&&i&&e.length===t.length){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,O=void 0!==w&&w,P=n.width,S=n.height,k=n.altitude,j=void 0===k?1.5:k;P=P||1,S=S||1,j=Math.max(.75,j);var E=Object(y.e)({width:P,height:S,pitch:d,altitude:j,nearZMultiplier:b,farZMultiplier:x}),C=E.fov,A=E.aspect,T=E.focalDistance,L=E.near,M=E.far,I=Object(y.f)({height:S,pitch:d,bearing:g,altitude:j}),F=Object.assign({},n,{width:P,height:S,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:O,fovyRadians:C,aspect:A,orthographicFocalDistance:T,near:L,far:M});return(e=l()(this,h()(t).call(this,F))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=j,e.orthographic=O,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);O.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(127),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(16),l=n(1),f=n(36),h=n.n(f),d=n(85),v=n(70),g=n(14),p=n(54),m=n(188),y=n(39),b=n(50),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,mousePosition:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l._ShaderCache({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(17),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(7),l=n.n(c),f=n(4),h=n.n(f),d=n(8),v=n.n(d),g=n(60),p=n(92),m=n(20),y=n(30);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(60),v=n(84),g=n(58),p=n(59),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(17),u=n.n(s),c=n(7),l=n.n(c),f=n(4),h=n.n(f),d=n(15),v=n.n(d),g=n(8),p=n.n(g),m=n(1),y=n(16),b=n(53),_=n(54),x=[],w=[[0,1/0]];var O=n(14),P=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(m.uid)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(m.hasFeature)(t,m.FEATURES.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a),this._setAccessor(e);for(var o=this.elementOffset,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,k,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"delete",value:function(){v()(h()(t.prototype),"delete",this).call(this),S.a.release(this.userData.allocatedValue)}},{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;if(t.update){Object(y.a)(Number.isFinite(e));var n=Math.max(e,1),i=E(this.type||5126),r=t.allocatedValue,a=t.updateRanges!==w;return this.constant=!1,this.value=S.a.allocate(r,n,{size:this.size,type:i,padding:this.elementOffset,copy:a}),this.buffer&&this.buffer.byteLength=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return n+e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(P);function E(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}function C(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.Buffer){var l=new Float32Array(r),f=t.getData({}),h=n.size,d=n.constant,v=d?n.getValue():n.getBuffer().getData({}),g=d?function(e,t){return c(v,t)}:function(e,t){return c(v.subarray(e,e+h),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.offset,a=void 0===r?0:r,o=e.getData,s=e.sourceLayout,u=e.targetLayout;if(!Array.isArray(u))return C({source:t,target:n,getData:o}),n;for(var c=a,l=a,f=o&&function(e,t){return o(e+l,t)},h=Math.min(s.length,u.length),d=0;d0),this.needsRedraw=!0;var n=Object.assign({},F,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return z});function D(){}var N={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;O.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;N.savedMessages=[],N.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;N.savedMessages&&N.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-N.timeStart),a="".concat(r,"ms");O.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=N.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;O.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}O.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),N.savedMessages=null}},z=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new R(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(N.onLog=t||D),void 0!==n&&(N.onUpdateStart=n||D),void 0!==i&&(N.onUpdate=i||D),void 0!==r&&(N.onUpdateEnd=r||D)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in N.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h]||t.attributes&&t.attributes[h])||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&N.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&O.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new j(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),O.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&N.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);N.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(53),p=n(62),m=n(85),y=n(1),b=n(156),_=n.n(b),x=n(14),w=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(y.uid)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;x.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity) / 255.0;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.0;\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getFillColor",defaultValue:P},instanceLineColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getLineColor",defaultValue:P},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=r.extensionsChanged;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new w({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new y.Model(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new y.Geometry({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);x.layerName="ScatterplotLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(17),r=n.n(i),a=n(2),o=n.n(a),s=n(3),u=n.n(s),c=n(7),l=n.n(c),f=n(4),h=n.n(f),d=n(8),v=n.n(d),g=n(20),p=n(60),m=n(92),y=n(105),b=n(44),_=85.05113,x=-85.05113;var w=n(16),O=n(58),P=n(59);n.d(t,"a",function(){return A});var S={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new O.a,transitionInterruption:P.a.BREAK},k={transitionDuration:0},j={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},E={pitch:0,bearing:0,altitude:1.5},C=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?E.bearing:c,d=n.pitch,v=void 0===d?E.pitch:d,g=n.altitude,p=void 0===g?E.altitude:g,m=n.maxZoom,y=void 0===m?j.maxZoom:m,b=n.minZoom,_=void 0===b?j.minZoom:b,x=n.maxPitch,O=void 0===x?j.maxPitch:x,P=n.minPitch,S=void 0===P?j.minPitch:P,k=n.startPanLngLat,C=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,L=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:O,minPitch:S})))._interactiveState={startPanLngLat:k,startZoomLngLat:C,startBearing:A,startPitch:T,startZoom:L},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,C,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return S}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,k,{isDragging:!0,isRotating:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(14),u=n(7),c=n.n(u),l=n(4),f=n.n(l),h=n(15),d=n.n(h),v=n(8),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(83).a),m=n(130),y=n(131),b=n(101),_=n(1);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h}),m=this.lastPostProcessEffect?this.screenBuffer:_.Framebuffer.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.Framebuffer(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.Framebuffer(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.Framebuffer.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(29),r=n(122);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(66))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(29);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(66))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(20),u=n(16),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){var i=n(173),r=n(174),a=n(175);e.exports=function(e){return i(e)||r(e)||a()}},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(34),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(83),p=n(1),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.withParameters)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";function i(e){return e&&"undefined"!=typeof window?window.devicePixelRatio:1}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(5),r=n(6),a=n(11),o=n(10),s=n(12),u=n(88),c=n(41),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return o()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"project",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{topLeft:!0},n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.contains(e,t))return r.project(e,t)}return null}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i=n.length-1;i>=0;--i){var r=n[i];if(r.containsPixel(e,t))return r.unproject(e)}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(u.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(d.b)(e,{filter:Boolean}).map(function(e){return e instanceof f.a?new l.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(c.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):h.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),g=n(111),p=n(98),m=function(){function e(){r()(this,e),this.effects=[],this._needsRedraw="Initial render",this.defaultLightingEffect=new p.a,this.needApplyDefaultLighting=!1}return o()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(c.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed")),this.checkLightingEffect()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){var e=this.effects;return this.needApplyDefaultLighting&&(e=this.effects.slice()).push(this.defaultLightingEffect),e}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}this.effects.length=0}},{key:"checkLightingEffect",value:function(){var e=!1,t=!0,n=!1,i=void 0;try{for(var r,a=this.effects[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){if(r.value instanceof p.a){e=!0;break}}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}this.needApplyDefaultLighting=!e}}]),e}(),y=n(72),b=n(120),_=n(1),x=n(131),w=n(130),O={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function P(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,d=-1,v=0,g=0;gf)v+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,d=v)}v+=4}}if(d>=0){var x=t[d+3]-1,w=t.slice(d,d+4),P=n[x];if(P){var S=P.decodePickingColor(w);return{pickedColor:w,pickedLayer:P,pickedObjectIndex:S}}h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return O}function S(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=k({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function k(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var j=function(){function e(t){r()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new w.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(x.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new _.Framebuffer(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-(r+1)*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=k({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(u.a)(r),Object(u.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(u.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,c=r.y,l=r.width,f=r.height,h=new Uint8Array(l*f*4);return Object(_.readPixelsToArray)(o,{sourceX:s,sourceY:c,sourceWidth:l,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight,o=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-o,c=Math.min(a,n+i+1)-s;return u<=0||c<=0?null:{x:o,y:s,width:u,height:c}}},{key:"callLayerPickingCallbacks",value:function(e,t){var n=[],i=this.pickingEvent;return e.forEach(function(e){if(e.layer){var r=!1;switch(t){case"hover":r=e.layer.onHover(e,i);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}}),n}}]),e}(),E=n(188),C=n(21),A=n(5),T=n(6),L=1,M=2,I=4,F={mousedown:L,mousemove:M,mouseup:I};var R,D,N=null;"undefined"!=typeof document&&(N=n(172),R=N.PointerEventInput,D=R.prototype.handler,R.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&M&&0===e.which&&(t=I),this.pressed&&(t&I&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var z=N;var B=z?[[z.Rotate,{enable:!1}],[z.Pinch,{enable:!1}],[z.Swipe,{enable:!1}],[z.Pan,{threshold:0,enable:!1}],[z.Press,{enable:!1}],[z.Tap,{event:"doubletap",taps:2,enable:!1}],[z.Tap,{event:"anytap",enable:!1}],[z.Tap,{enable:!1}]]:null,U={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},V={doubletap:["tap"]},G={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},W=["keydown","keyup"],H=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],X=["wheel","mousewheel","DOMMouseScroll"],q={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",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"},Z={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},Y=n(79),K=-1!==Y.b.indexOf("firefox"),Q=X,J=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=Q.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!Y.a&&{passive:!1})})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;Y.c.WheelEvent&&(K&&e.deltaMode===Y.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=Y.c.devicePixelRatio),e.deltaMode===Y.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),$=H,ee=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=$.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),te=W,ne=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=te.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(T.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),ie=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(A.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(T.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),re=1,ae=2,oe=4,se={pointerdown:re,pointermove:ae,pointerup:oe,mousedown:re,mousemove:ae,mouseup:oe},ue=1,ce=2,le=3,fe=0,he=1,de=2,ve=1,ge=2,pe=4;var me=function(){function e(t){Object(A.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(T.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(A.a)(this,e),this.options=Object.assign({},ye,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(T.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||B}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(U).forEach(function(e){var n=t.manager.get(e);n&&U[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new J(e,this._onOtherEvent,{enable:!1}),this.moveInput=new ee(e,this._onOtherEvent,{enable:!1}),this.keyInput=new ne(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new ie(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(C.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=V[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=Z[e]||e,o=r.get(a);o||(o=new me(this),r.set(a,o),o.recognizerName=q[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=Z[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=G[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),_e=n(27);function xe(){}n.d(t,"a",function(){return Oe});var we={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:xe,onResize:xe,onViewStateChange:xe,onBeforeRender:xe,onAfterRender:xe,onLoad:xe,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Oe=function(){function e(t){r()(this,e),t=Object.assign({},we,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new E.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return o()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&h.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&h.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(u.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new _.AnimationLoop({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(_.createGLContext)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new g.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.callback=this.props.onHover,t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(_.trackContextState)(e,{enable:!0,copyState:!0})),Object(_.setParameters)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new be(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),_e.b)this.eventManager.on(t,this._onEvent);this.viewManager=new v({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(u.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new s.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new m,this.deckRenderer=new b.a(e),this.deckPicker=new j(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(_.setParameters)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),h.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=_e.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){this.stats.get("frameRate").timeEnd(),this.stats.get("frameRate").timeStart();var e=this.animationLoop.stats;this.stats.get("GPU Time").addTime(e.get("GPU Time").lastTiming),this.stats.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){this.metrics.fps=this.stats.get("frameRate").getHz(),this.metrics.setPropsTime=this.stats.get("setProps Time").time,this.metrics.updateAttributesTime=this.stats.get("Update Attributes").time,this.metrics.framesRedrawn=this.stats.get("Redraw Count").count,this.metrics.pickTime=this.stats.get("pickObject Time").time+this.stats.get("pickMultipleObjects Time").time+this.stats.get("pickObjects Time").time,this.metrics.pickCount=this.stats.get("Pick Count").count,this.metrics.gpuTime=this.stats.get("GPU Time").time,this.metrics.cpuTime=this.stats.get("CPU Time").time,this.metrics.gpuTimePerFrame=this.stats.get("GPU Time").getAverageTime(),this.metrics.cpuTimePerFrame=this.stats.get("CPU Time").getAverageTime();var e=_.lumaStats.get("Memory Usage");this.metrics.bufferMemory=e.get("Buffer Memory").count,this.metrics.textureMemory=e.get("Texture Memory").count,this.metrics.renderbufferMemory=e.get("Renderbuffer Memory").count,this.metrics.gpuMemory=e.get("GPU Memory").count}}]),e}();Oe.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(y.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Oe.defaultProps=we},function(e,t,n){"use strict";var i=n(0);t.a={enable:function(e,t){return e(Object(i.a)({},t,!0))},disable:function(e,t){return e(Object(i.a)({},t,!1))},pixelStorei:function(e,t,n){return e(Object(i.a)({},t,n))},hint:function(e,t,n){return e(Object(i.a)({},t,n))},bindFramebuffer:function(e,t,n){var r;switch(t){case 36160:return e((r={},Object(i.a)(r,36006,n),Object(i.a)(r,36010,n),r));case 36009:return e(Object(i.a)({},36006,n));case 36008:return e(Object(i.a)({},36010,n));default:return null}},blendColor:function(e,t,n,r,a){return e(Object(i.a)({},32773,new Float32Array([t,n,r,a])))},blendEquation:function(e,t){var n;return e((n={},Object(i.a)(n,32777,t),Object(i.a)(n,34877,t),n))},blendEquationSeparate:function(e,t,n){var r;return e((r={},Object(i.a)(r,32777,t),Object(i.a)(r,34877,n),r))},blendFunc:function(e,t,n){var r;return e((r={},Object(i.a)(r,32969,t),Object(i.a)(r,32968,n),Object(i.a)(r,32971,t),Object(i.a)(r,32970,n),r))},blendFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,32969,t),Object(i.a)(o,32968,n),Object(i.a)(o,32971,r),Object(i.a)(o,32970,a),o))},clearColor:function(e,t,n,r,a){return e(Object(i.a)({},3106,new Float32Array([t,n,r,a])))},clearDepth:function(e,t){return e(Object(i.a)({},2931,t))},clearStencil:function(e,t){return e(Object(i.a)({},2961,t))},colorMask:function(e,t,n,r,a){return e(Object(i.a)({},3107,[t,n,r,a]))},cullFace:function(e,t){return e(Object(i.a)({},2885,t))},depthFunc:function(e,t){return e(Object(i.a)({},2932,t))},depthRange:function(e,t,n){return e(Object(i.a)({},2928,new Float32Array([t,n])))},depthMask:function(e,t){return e(Object(i.a)({},2930,t))},frontFace:function(e,t){return e(Object(i.a)({},2886,t))},lineWidth:function(e,t){return e(Object(i.a)({},2849,t))},polygonOffset:function(e,t,n){var r;return e((r={},Object(i.a)(r,32824,t),Object(i.a)(r,10752,n),r))},sampleCoverage:function(e,t,n){var r;return e((r={},Object(i.a)(r,32938,t),Object(i.a)(r,32939,n),r))},scissor:function(e,t,n,r,a){return e(Object(i.a)({},3088,new Int32Array([t,n,r,a])))},stencilMask:function(e,t){var n;return e((n={},Object(i.a)(n,2968,t),Object(i.a)(n,36005,t),n))},stencilMaskSeparate:function(e,t,n){return e(Object(i.a)({},1028===t?2968:36005,n))},stencilFunc:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2962,t),Object(i.a)(a,2967,n),Object(i.a)(a,2963,r),Object(i.a)(a,34816,t),Object(i.a)(a,36003,n),Object(i.a)(a,36004,r),a))},stencilFuncSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2962:34816,n),Object(i.a)(o,1028===t?2967:36003,r),Object(i.a)(o,1028===t?2963:36004,a),o))},stencilOp:function(e,t,n,r){var a;return e((a={},Object(i.a)(a,2964,t),Object(i.a)(a,2965,n),Object(i.a)(a,2966,r),Object(i.a)(a,34817,t),Object(i.a)(a,34818,n),Object(i.a)(a,34819,r),a))},stencilOpSeparate:function(e,t,n,r,a){var o;return e((o={},Object(i.a)(o,1028===t?2964:34817,n),Object(i.a)(o,1028===t?2965:34818,r),Object(i.a)(o,1028===t?2966:34819,a),o))},viewport:function(e,t,n,r,a){return e(Object(i.a)({},2978,new Int32Array([t,n,r,a])))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(21),r=n(105),a=n(65);function o(e){var t=e.width,n=e.height,o=e.bounds,s=e.padding,u=void 0===s?0:s,c=e.offset,l=void 0===c?[0,0]:c,f=Object(i.a)(o,2),h=Object(i.a)(f[0],2),d=h[0],v=h[1],g=Object(i.a)(f[1],2),p=g[0],m=g[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else Object(a.a)(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var y=new r.a({width:t,height:n,longitude:0,latitude:0,zoom:0}),b=y.project([d,m]),_=y.project([p,v]),x=[Math.abs(_[0]-b[0]),Math.abs(_[1]-b[1])],w=[t-u.left-u.right-2*Math.abs(l[0]),n-u.top-u.bottom-2*Math.abs(l[1])];Object(a.a)(w[0]>0&&w[1]>0);var O=w[0]/x[0],P=w[1]/x[1],S=(u.right-u.left)/2/O,k=(u.bottom-u.top)/2/P,j=[(_[0]+b[0])/2+S,(_[1]+b[1])/2+k],E=y.unproject(j),C=y.zoom+Math.log2(Math.abs(Math.min(O,P)));return{longitude:E[0],latitude:E[1],zoom:C}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(21),r=n(5),a=n(6),o=n(20),s=n(30),u=n(35),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.g(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(42),v=n(39),g=n(138),p=n(81),m=n(114);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(3),r=n.n(i),a=n(2),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(42),v=n(39),g=n(81),p=n(84),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,O=e.zoom,P=void 0===O?0:O;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:P}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(3),r=n.n(i),a=n(4),o=n.n(a),s=n(2),u=n.n(s),c=n(7),l=n.n(c),f=n(8),h=n.n(f),d=n(42),v=n(39),g=n(81),p=n(115),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.CubeGeometry}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(117).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(8),h=n.n(f),d=n(1),v=n(53),g=n(134),p=n(86),m=n(75),y=n(94),b=n(93),_=new d.PhongMaterial,x={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags),i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(i&&Array.isArray(n.dataChanged)){var r=this.state.paths.slice(),a=n.dataChanged.map(function(e){return Object(b.a)({data:r,getIndex:function(e){return e.__source.index},dataRange:e,replace:t._getPaths(e)})});this.setState({paths:r,pathsDiff:a})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.data,i=t.getPolygon,r=[],a="XY"===t.positionFormat?2:3,o=e.startRow,s=e.endRow,u=Object(v.a)(n,o,s),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var g,p=c[Symbol.iterator]();!(f=(g=p.next()).done);f=!0){var m=g.value;l.index++;var b=y.c(i(m,l),a),_=b.positions,x=b.holeIndices;if(x)for(var w=0;w<=x.length;w++){var O=_.subarray(x[w-1]||0,x[w]||_.length);r.push(this.getSubLayerRow({path:O},m,l.index))}else r.push(this.getSubLayerRow({path:_},m,l.index))}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}return r}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e._dataDiff,i=e.stroked,r=e.filled,a=e.extruded,o=e.wireframe,s=e.elevationScale,u=e.transitions,c=e.positionFormat,l=this.props,f=l.lineWidthUnits,h=l.lineWidthScale,d=l.lineWidthMinPixels,v=l.lineWidthMaxPixels,g=l.lineJointRounded,y=l.lineMiterLimit,b=l.lineDashJustified,_=this.props,x=_.getFillColor,w=_.getLineColor,O=_.getLineWidth,P=_.getLineDashArray,S=_.getElevation,k=_.getPolygon,j=_.updateTriggers,E=_.material,C=this.state,A=C.paths,T=C.pathsDiff,L=this.getSubLayerClass("fill",p.a),M=this.getSubLayerClass("stroke",m.a),I=this.shouldRenderSubLayer("fill",A)&&new L({_dataDiff:n,extruded:a,elevationScale:s,filled:r,wireframe:o,getElevation:S,getFillColor:x,getLineColor:w,material:E,transitions:u},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:j.getPolygon,getElevation:j.getElevation,getFillColor:j.getFillColor,getLineColor:j.getLineColor}}),{data:t,positionFormat:c,getPolygon:k});return[!a&&I,!a&&i&&this.shouldRenderSubLayer("stroke",A)&&new M({_dataDiff:T&&function(){return T},widthUnits:f,widthScale:h,widthMinPixels:d,widthMaxPixels:v,rounded:g,miterLimit:y,dashJustified:b,transitions:u&&{getWidth:u.getLineWidth,getColor:u.getLineColor,getPath:u.getPolygon},getColor:this.getSubLayerAccessor(w),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:j.getLineWidth,getColor:j.getLineColor,getDashArray:j.getLineDashArray}}),{data:A,positionFormat:c,getPath:function(e){return e.path}}),a&&I]}}]),t}(g.a);w.layerName="PolygonLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(53),p=n(62),m=n(85),y=n(1);n.d(t,"a",function(){return _});var b={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},_=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.), target_commonspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},instanceColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new y.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new y.Geometry({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),O=u(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]),c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);_.layerName="LineLayer",_.defaultProps=b},function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(53),p=n(62),m=n(85),y=n(1);n.d(t,"a",function(){return x});var b=[0,0,0,255],_={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:b},getTargetColor:{type:"accessor",value:b},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n vec2 source = project_position(geometry.worldPosition, instancePositions64Low.xy).xy;\n vec2 target = project_position(geometry.worldPositionAlt, instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.;\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getSourceColor",defaultValue:b},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,transition:!0,accessor:"getTargetColor",defaultValue:b},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new y.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new y.Geometry({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]);var O=u(x,d);c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);x.layerName="ArcLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(29),r=n(21),a={boolean:{validate:function(e,t){return!0}},number:{validateType:function(e,t){return"value"in t&&(!("max"in t)||Number.isFinite(t.max))&&(!("min"in t)||Number.isFinite(t.min))},validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}}};function o(e,t){switch(s(t)){case"object":return function(e){var t=e.type;(a[t]||{}).typeValidator;return e}(t=function(e,t){if(!("type"in t))return"value"in t?Object.assign({name:e,type:s(t.value)},t):{name:e,type:"object",value:t};return Object.assign({name:e},t)}(e,t));case"array":return function(e,t){if(/color/i.test(e)&&(3===t.length||4===t.length))return{name:e,type:"color",value:t};return{name:e,type:"array",value:t}}(e,t);case"boolean":return{name:e,type:"boolean",value:t};case"number":return function(e,t){var n=/radius|scale|width|height|pixel|size|miter/i.test(e)&&/^((?!scale).)*$/.test(e)?100:1;return{name:e,type:"number",max:Math.max(t,n),min:Math.min(t,0),value:t}}(e,t);case"function":return{name:e,type:"function",value:t};default:return{name:e,type:"unknown",value:t}}}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":null===e?"null":Object(i.a)(e)}function u(e){if(!e.normalized){if(e.normalized=!0,e.uniforms){var t=function(e){for(var t={},n={},i=0,a=Object.entries(e);i2&&void 0!==arguments[2]?arguments[2]:{},i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},r=n.startRow,a=void 0===r?0:r,o=n.endRow,s=void 0===o?e.length:o,u=a;u0;)t=t[0];return t&&Number.isFinite(t[0])}(a,o))switch(a){case"Point":s.push(n({geometry:e},i,r));break;case"MultiPoint":o.forEach(function(e){s.push(n({geometry:{type:"Point",coordinates:e}},i,r))});break;case"LineString":u.push(n({geometry:e},i,r));break;case"MultiLineString":o.forEach(function(e){u.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"Polygon":c.push(n({geometry:e},i,r)),o.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"MultiPolygon":o.forEach(function(e){c.push(n({geometry:{type:"Polygon",coordinates:e}},i,r)),e.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))})})}else b.a.warn("".concat(a," coordinates are malformed"))()}var w={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return k});var O=new p.PhongMaterial,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:O};function S(e){return e.geometry.coordinates}var k=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){var t=e.props,n=e.changeFlags;if(n.dataChanged){var i=function(e){if(Array.isArray(e))return e;switch(b.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return b.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data),r=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var a=this.state.features,o={},s={};for(var u in a)o[u]=a[u].slice(),s[u]=[];var c=!0,l=!1,f=void 0;try{for(var h,d=n.dataChanged[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value,g=_(i,r,v);for(var p in a)s[p].push(Object(y.a)({data:o[p],getIndex:function(e){return e.__source.index},dataRange:v,replace:g[p]}))}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}this.setState({features:o,featuresDiff:s})}else this.setState({features:_(i,r),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var e=this.state,t=e.features,n=e.featuresDiff,i=t.pointFeatures,r=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures,s=this.props,u=s.stroked,c=s.filled,l=s.extruded,f=s.wireframe,h=s.material,d=s.transitions,p=this.props,y=p.lineWidthUnits,b=p.lineWidthScale,_=p.lineWidthMinPixels,x=p.lineWidthMaxPixels,w=p.lineJointRounded,O=p.lineMiterLimit,P=p.pointRadiusScale,k=p.pointRadiusMinPixels,j=p.pointRadiusMaxPixels,E=p.elevationScale,C=p.lineDashJustified,A=this.props,T=A.getLineColor,L=A.getFillColor,M=A.getRadius,I=A.getLineWidth,F=A.getLineDashArray,R=A.getElevation,D=A.updateTriggers,N=this.getSubLayerClass("polygons-fill",m.a),z=this.getSubLayerClass("polygons-stroke",g.a),B=this.getSubLayerClass("line-strings",g.a),U=this.getSubLayerClass("points",v.a),V=this.shouldRenderSubLayer("polygons-fill",a)&&new N({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:l,elevationScale:E,filled:c,wireframe:f,material:h,getElevation:this.getSubLayerAccessor(R),getFillColor:this.getSubLayerAccessor(L),getLineColor:this.getSubLayerAccessor(T),transitions:d&&{getPolygon:d.geometry,getElevation:d.getElevation,getFillColor:d.getFillColor,getLineColor:d.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:D.getElevation,getFillColor:D.getFillColor,getLineColor:D.getLineColor}}),{data:a,getPolygon:S});return[!l&&V,!l&&u&&this.shouldRenderSubLayer("polygons-stroke",o)&&new z({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:C,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(F),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:o,getPath:S}),this.shouldRenderSubLayer("linestrings",r)&&new B({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:C,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(F),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:r,getPath:S}),this.shouldRenderSubLayer("points",i)&&new U({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:u,filled:c,radiusScale:P,radiusMinPixels:k,radiusMaxPixels:j,lineWidthUnits:y,lineWidthScale:b,lineWidthMinPixels:_,lineWidthMaxPixels:x,getFillColor:this.getSubLayerAccessor(L),getLineColor:this.getSubLayerAccessor(T),getRadius:this.getSubLayerAccessor(M),getLineWidth:this.getSubLayerAccessor(I),transitions:d&&{getPosition:d.geometry,getFillColor:d.getFillColor,getLineColor:d.getLineColor,getRadius:d.getRadius,getLineWidth:d.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:D.getFillColor,getLineColor:D.getLineColor,getRadius:D.getRadius,getLineWidth:D.getLineWidth}}),{data:i,getPosition:S}),l&&V]}}]),t}(d.a);k.layerName="GeoJsonLayer",k.defaultProps=P},function(e,t,n){"use strict";(function(e){var i=n(29);t.a="undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==Object(i.a)(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(66))},function(e,t,n){var i=n(171);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";(function(e,i){n.d(t,"a",function(){return a});var r=n(128),a="object"!==(void 0===e?"undefined":Object(r.a)(e))||"[object process]"!==String(e)||e.browser;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document}).call(this,n(66),n(56))},function(e,t){e.exports=function(e){var t;if("function"==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(33),a=n.n(r),o=n(80);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(66))},function(e,t){},function(e,t){},function(e,t,n){var i=n(9);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===S(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(O(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),O(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),O(i),O(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:{},i=g.b[t];if(Object(m.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in y)return y[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),y[t]=s,s}var _=n(59),x=n(43),w=n(61),O=n(196),P=n(60),S=n(95),j=n(125),k=n(159),C=n(112),E=n(80),A=n(176),T=n(160),M=n(201),L=n(106),I=n(202),R=n(4),F=n(5),D=n(73),N=5126,z=5124,B=5125,U=function(){function e(t){var n;for(var i in Object(R.a)(this,e),this.layout={},this.size=0,t)this._addUniform(i,t[i]);this.size+=(4-this.size%4)%4;var r=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,N,r),Object(c.a)(n,z,new Int32Array(r.buffer)),Object(c.a)(n,B,new Uint32Array(r.buffer)),n)}return Object(F.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[N]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Object(m.a)(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Object(D.a)(t);Object(m.a)(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}(),V=n(123),G=n(26),W=n(67),H=n(46);n.d(t,"S",function(){return r.a}),n.d(t,"A",function(){return a.a}),n.d(t,"B",function(){return a.b}),n.d(t,"V",function(){return a.d}),n.d(t,"X",function(){return a.e}),n.d(t,"N",function(){return o.c}),n.d(t,"O",function(){return o.d}),n.d(t,"w",function(){return s.a}),n.d(t,"J",function(){return u.b}),n.d(t,"I",function(){return u.a}),n.d(t,"E",function(){return v}),n.d(t,"H",function(){return d}),n.d(t,"F",function(){return h}),n.d(t,"D",function(){return f.a}),n.d(t,"c",function(){return g.a}),n.d(t,"L",function(){return p.b}),n.d(t,"M",function(){return p.c}),n.d(t,"G",function(){return p.a}),n.d(t,"t",function(){return b}),n.d(t,"a",function(){return _.a}),n.d(t,"b",function(){return x.a}),n.d(t,"i",function(){return w.b}),n.d(t,"q",function(){return w.c}),n.d(t,"d",function(){return w.a}),n.d(t,"f",function(){return O.a}),n.d(t,"e",function(){return P.a}),n.d(t,"h",function(){return S.a}),n.d(t,"j",function(){return j.a}),n.d(t,"l",function(){return k.a}),n.d(t,"u",function(){return C.a}),n.d(t,"v",function(){return C.b}),n.d(t,"T",function(){return E.e}),n.d(t,"U",function(){return E.f}),n.d(t,"x",function(){return E.b}),n.d(t,"y",function(){return E.c}),n.d(t,"z",function(){return E.d}),n.d(t,"s",function(){return E.a}),n.d(t,"g",function(){return A.a}),n.d(t,"k",function(){return T.a}),n.d(t,"m",function(){return M.a}),n.d(t,"p",function(){return L.a}),n.d(t,"o",function(){return I.a}),n.d(t,"n",function(){return U}),n.d(t,"Y",function(){return V.c}),n.d(t,"P",function(){return V.a}),n.d(t,"Q",function(){return V.b}),n.d(t,"R",function(){return G.a}),n.d(t,"r",function(){return m.a}),n.d(t,"Z",function(){return W.c}),n.d(t,"W",function(){return H.c}),n.d(t,"ab",function(){return H.d}),n.d(t,"K",function(){return H.b}),n.d(t,"C",function(){return H.a})},function(e,t,n){"use strict";var i=n(236);t.a=new i.a({id:"deck"}).enable()},function(e,t,n){var i=n(252),r=n(253),a=n(254);e.exports=function(e,t){return i(e)||r(e,t)||a()}},function(e,t,n){"use strict";n.r(t);var i=n(14),r=n(51),a=n(58),o=n(127),s=n(144),u=n(203),c=n(24),l=new Uint8Array([0,0,0]);function f(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function h(e){var t=Object(c.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function d(){return l}var v=n(93),g=n(223),p=n(101),m=n(189),y=n(34),b=n(4),_=n(5),x=n(124),w=n(134),O=n(19),P=n(26);var S=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.onInitialize,r=void 0===i?function(){}:i,a=n.onFinalize,o=void 0===a?function(){}:a,s=n.useDevicePixels,u=void 0===s||s,c=n.autoResizeDrawingBuffer,l=void 0===c||c;this.props={onInitialize:r,onFinalize:o},this.setProps({autoResizeDrawingBuffer:l,useDevicePixels:u}),Object(O.a)(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(_.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.onmessage=function(n){var i,r,a,o=n.data;switch(o.command){case"start":i=t,r=o.opts.canvas,a=new Map,r.addEventListener=function(e,t){i.postMessage({command:"addEventListener",type:e}),a.has(e)||a.set(e,[]),a.get(e).push(t)},r.removeEventListener=function(e,t){i.postMessage({command:"removeEventListener",type:e});var n=a.get(e);n&&n.splice(n.indexOf(t),1)},r.dispatchEvent=function(e,t){var n=a.get(e);n&&n.forEach(function(e){return e(t)})},i.canvas=r,e.start(o.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=o.width,t.canvas.height=o.height;break;case"event":t.canvas.dispatchEvent(o.type,o.event)}}}}}]),Object(_.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,Object(x.b)().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=Object(w.b)(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(Object(w.a)(this._animationFrameId),this._animationFrameId=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(y.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._animationFrameId=Object(w.b)(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=Object(x.a)(e);t.transferControlToOffscreen||P.a.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),j=n(10),k=n(9),C=n(11),E=n(60),A=n(70),T=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.id,r=void 0===i?"pass":i;this.id=r,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(_.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=E.a.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),Object(A.a)(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),M=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(T),L=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(b.a)(this,e),this.gl=t,this.framebuffer1=new E.a(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new E.a(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(_.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),I=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),i=Array.isArray(i)?{passes:i}:i,(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"multi-pass"},i)))).renderState=new L(e,i),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(M),R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){var e=this.gl,t=this.props.clearBits,n=void 0===t?16640:t;e.clear(n)}}]),t}(T),F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(T),D="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",N=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},i)))).clipspace=new p.a(e,{id:"copy-pass",fs:D}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),z="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",B=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,t),n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"texture-pass"},i)));var r=i.texture,a=i.opacity,o=void 0===a?1:a;return n.clipspace=new p.a(e,{id:"texture-pass",fs:z,uniforms:{uDiffuseSampler:r,uOpacity:o}}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),U=n(138),V=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),G=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(b.a)(this,t);var a="".concat(n.name,"-pass");Object(U.b)(n);var o=function(e,t,n,i){if(t.filter||t.sampler){var r=q(t),a=new V(e,{id:n,model:W(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=q(t,r),s="".concat(n,"-").concat(o.length+1);return new V(e,Object.assign({id:s,model:W(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,a,r);return(i=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:a,passes:o},r)))).module=n,i}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.props.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1;var l=c.props,f=l.uniforms,h=l.model;f&&h.setUniforms(f),h.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(M);function W(e,t,n,i,r){var a=new p.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var H=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},X=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return H(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return X(i)}return null}var Z=n(36),Y=n(67),K={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Q=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("truncated-code-geometry"):n,r=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,O=x(b),P=_(b),S=v?-2:0,j=l+(p?2:0),k=u+1,C=new Uint16Array(u*(l+m)*6),E=K[h],A=new Float32Array(3*y),T=new Float32Array(3*y),M=new Float32Array(2*y),L=0,I=0,R=S;R<=j;R++){var F=R/l,D=o*F,N=void 0;R<0?(D=0,F=1,N=n):R>l?(D=o,F=1,N=r):N=n+R/l*(r-n),-2!==R&&R!==l+2||(N=0,F=0),D-=o/2;for(var z=0;zl?0:B*O,T[L+E[1]]=R<0?-1:R>l?1:P,T[L+E[2]]=R<0||R>l?0:U*O,M[I+0]=z/u,M[I+1]=F,I+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cone-geometry"):n,r=e.radius,a=void 0===r?1:r,o=e.cap,s=void 0===o||o;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,topRadius:0,topCap:Boolean(s),bottomCap:Boolean(s),bottomRadius:a})))}return Object(C.a)(t,e),t}(Q),$=n(190),ee=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cylinder-geometry"):n,r=e.radius,a=void 0===r?1:r;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,bottomRadius:a,topRadius:a})))}return Object(C.a)(t,e),t}(Q),te=n(29),ne=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],ie=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],re=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("ico-sphere-geometry"):n,r=function(e){var t=e.iterations,n=void 0===t?0:t,i=Math.PI,r=2*i,a=[].concat(ne),o=[].concat(ie);a.push(),o.push();for(var s=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,r=t>n?t:n,o="".concat(i,"|").concat(r);if(o in e)return e[o];var s=a[t],u=a[t+1],c=a[t+2],l=a[n],f=a[n+1],h=a[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,a.push(d,v,g),e[o]=a.length/3-1}}(),u=0;u=0;p-=3){var m=o[p+0],y=o[p+1],b=o[p+2],_=3*m,x=3*y,w=3*b,O=2*m,P=2*y,S=2*b,j=a[_+0],k=a[_+1],C=a[_+2],E=Math.acos(C/Math.sqrt(j*j+k*k+C*C)),A=Math.atan2(k,j)+i,T=E/i,M=1-A/r,L=a[x+0],I=a[x+1],R=a[x+2],F=Math.acos(R/Math.sqrt(L*L+I*I+R*R)),D=Math.atan2(I,L)+i,N=F/i,z=1-D/r,B=a[w+0],U=a[w+1],V=a[w+2],G=Math.acos(V/Math.sqrt(B*B+U*U+V*V)),W=Math.atan2(U,B)+i,H=G/i,X=1-W/r,q=[B-L,U-I,V-R],Z=[j-L,k-I,C-R],Y=new te.a(q).cross(Z).normalize(),K=void 0;(0===M||0===z||0===X)&&(0===M||M>.5)&&(0===z||z>.5)&&(0===X||X>.5)&&(a.push(a[_+0],a[_+1],a[_+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=T,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[x+0],a[x+1],a[x+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=N,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[w+0],a[w+1],a[w+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=H,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z),v[_+0]=v[x+0]=v[w+0]=Y.x,v[_+1]=v[x+1]=v[w+1]=Y.y,v[_+2]=v[x+2]=v[w+2]=Y.z,g[O+0]=M,g[O+1]=T,g[P+0]=z,g[P+1]=N,g[S+0]=X,g[S+1]=H}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(g)}}}}(e),a=r.indices,o=r.attributes;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,indices:a,attributes:Object(Z.a)({},o,e.attributes)})))}return Object(C.a)(t,e),t}(a.a);var ae=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("plane-geometry"):n,r=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")]||1,f=e["".concat(c[1],"len")]||1,h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,O=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=O,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*O-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*O-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*O-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}y+=2,b+=3}for(var P=h+1,S=new Uint16Array(h*d*6),j=0;j0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("sphere-geometry"):n,r=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,O=s*y,P=Math.sin(w),S=Math.cos(w),j=Math.sin(O),k=Math.cos(O),C=S*j,E=k,A=P*j,T=o(C,E,A,m,y);f[x+0]=T*C,f[x+1]=T*E,f[x+2]=T*A,h[x+0]=C,h[x+1]=E,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var M=n+1,L=0;L0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.a)(this,t),(e=Object(j.a)(this,Object(k.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(C.a)(t,e),t}(ce.a),de=n(28);n.d(t,"isWebGL",function(){return i.N}),n.d(t,"isWebGL2",function(){return i.O}),n.d(t,"lumaStats",function(){return i.S}),n.d(t,"createGLContext",function(){return i.A}),n.d(t,"destroyGLContext",function(){return i.B}),n.d(t,"resizeGLContext",function(){return i.V}),n.d(t,"setGLContextDefaults",function(){return i.X}),n.d(t,"getContextInfo",function(){return i.E}),n.d(t,"getGLContextInfo",function(){return i.H}),n.d(t,"getContextLimits",function(){return i.F}),n.d(t,"FEATURES",function(){return i.c}),n.d(t,"hasFeature",function(){return i.L}),n.d(t,"hasFeatures",function(){return i.M}),n.d(t,"getFeatures",function(){return i.G}),n.d(t,"canCompileGLGSExtension",function(){return i.t}),n.d(t,"cloneTextureFrom",function(){return i.w}),n.d(t,"getKeyValue",function(){return i.J}),n.d(t,"getKey",function(){return i.I}),n.d(t,"setContextDefaults",function(){return i.X}),n.d(t,"glGetDebugInfo",function(){return i.D}),n.d(t,"trackContextState",function(){return r.g}),n.d(t,"resetParameters",function(){return r.d}),n.d(t,"getParameter",function(){return r.b}),n.d(t,"getParameters",function(){return r.c}),n.d(t,"setParameter",function(){return r.e}),n.d(t,"setParameters",function(){return r.f}),n.d(t,"withParameters",function(){return r.h}),n.d(t,"getModifiedParameters",function(){return r.a}),n.d(t,"Buffer",function(){return i.b}),n.d(t,"Shader",function(){return i.i}),n.d(t,"VertexShader",function(){return i.q}),n.d(t,"FragmentShader",function(){return i.d}),n.d(t,"Program",function(){return i.f}),n.d(t,"Framebuffer",function(){return i.e}),n.d(t,"Renderbuffer",function(){return i.h}),n.d(t,"Texture2D",function(){return i.j}),n.d(t,"TextureCube",function(){return i.l}),n.d(t,"clear",function(){return i.u}),n.d(t,"clearBuffer",function(){return i.v}),n.d(t,"readPixelsToArray",function(){return i.T}),n.d(t,"readPixelsToBuffer",function(){return i.U}),n.d(t,"copyToDataUrl",function(){return i.x}),n.d(t,"copyToImage",function(){return i.y}),n.d(t,"copyToTexture",function(){return i.z}),n.d(t,"blit",function(){return i.s}),n.d(t,"Query",function(){return i.g}),n.d(t,"Texture3D",function(){return i.k}),n.d(t,"TransformFeedback",function(){return i.m}),n.d(t,"VertexArrayObject",function(){return i.p}),n.d(t,"VertexArray",function(){return i.o}),n.d(t,"UniformBufferLayout",function(){return i.n}),n.d(t,"setPathPrefix",function(){return i.Y}),n.d(t,"loadFile",function(){return i.P}),n.d(t,"loadImage",function(){return i.Q}),n.d(t,"_Accessor",function(){return i.a}),n.d(t,"_clearBuffer",function(){return i.v}),n.d(t,"Geometry",function(){return a.a}),n.d(t,"Material",function(){return o.a}),n.d(t,"AmbientLight",function(){return s.a}),n.d(t,"DirectionalLight",function(){return s.b}),n.d(t,"PointLight",function(){return s.c}),n.d(t,"AnimationLoop",function(){return u.a}),n.d(t,"encodePickingColor",function(){return f}),n.d(t,"decodePickingColor",function(){return h}),n.d(t,"getNullPickingColor",function(){return d}),n.d(t,"Model",function(){return v.a}),n.d(t,"Transform",function(){return g.a}),n.d(t,"ClipSpace",function(){return p.a}),n.d(t,"_ShaderCache",function(){return m.a}),n.d(t,"_AnimationLoopProxy",function(){return S}),n.d(t,"_MultiPassRenderer",function(){return I}),n.d(t,"_RenderState",function(){return L}),n.d(t,"_Pass",function(){return T}),n.d(t,"_CompositePass",function(){return M}),n.d(t,"_ClearPass",function(){return R}),n.d(t,"_RenderPass",function(){return F}),n.d(t,"_CopyPass",function(){return N}),n.d(t,"_TexturePass",function(){return B}),n.d(t,"_ShaderModulePass",function(){return G}),n.d(t,"ConeGeometry",function(){return J}),n.d(t,"CubeGeometry",function(){return $.a}),n.d(t,"CylinderGeometry",function(){return ee}),n.d(t,"IcoSphereGeometry",function(){return re}),n.d(t,"PlaneGeometry",function(){return ae}),n.d(t,"SphereGeometry",function(){return oe}),n.d(t,"TruncatedConeGeometry",function(){return Q}),n.d(t,"PhongMaterial",function(){return se.a}),n.d(t,"PBRMaterial",function(){return ue}),n.d(t,"ScenegraphNode",function(){return ce.a}),n.d(t,"GroupNode",function(){return le.a}),n.d(t,"ModelNode",function(){return fe.a}),n.d(t,"CameraNode",function(){return he}),n.d(t,"registerShaderModules",function(){return de.v}),n.d(t,"setDefaultShaderModules",function(){return de.w}),n.d(t,"getDefaultShaderModules",function(){return de.l}),n.d(t,"assembleShaders",function(){return de.c}),n.d(t,"createShaderHook",function(){return de.g}),n.d(t,"createModuleInjection",function(){return de.f}),n.d(t,"combineInjects",function(){return de.d}),n.d(t,"normalizeShaderModule",function(){return de.q}),n.d(t,"fp32",function(){return de.j}),n.d(t,"fp64",function(){return de.k}),n.d(t,"project",function(){return de.u}),n.d(t,"lights",function(){return de.p}),n.d(t,"dirlight",function(){return de.i}),n.d(t,"picking",function(){return de.t}),n.d(t,"diffuse",function(){return de.h}),n.d(t,"gouraudlighting",function(){return de.o}),n.d(t,"phonglighting",function(){return de.s}),n.d(t,"pbr",function(){return de.r}),n.d(t,"_transform",function(){return de.b}),n.d(t,"MODULAR_SHADERS",function(){return de.a}),n.d(t,"getQualifierDetails",function(){return de.n}),n.d(t,"getPassthroughFS",function(){return de.m}),n.d(t,"typeToChannelSuffix",function(){return de.y}),n.d(t,"typeToChannelCount",function(){return de.x}),n.d(t,"convertToVec4",function(){return de.e}),n.d(t,"log",function(){return i.R}),n.d(t,"assert",function(){return i.r}),n.d(t,"uid",function(){return i.Z}),n.d(t,"self",function(){return i.W}),n.d(t,"window",function(){return i.ab}),n.d(t,"global",function(){return i.K}),n.d(t,"document",function(){return i.C})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return g}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return b});var i=n(12);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],g=t[13],p=t[14],m=t[15],y=n*s-i*o,b=n*u-r*o,_=n*c-a*o,x=i*u-r*s,w=i*c-a*s,O=r*c-a*u,P=l*g-f*v,S=l*p-h*v,j=l*m-d*v,k=f*p-h*g,C=f*m-d*g,E=h*m-d*p,A=y*E-b*C+_*k+x*j-w*S+O*P;return A?(A=1/A,e[0]=(s*E-u*C+c*k)*A,e[1]=(r*C-i*E-a*k)*A,e[2]=(g*O-p*w+m*x)*A,e[3]=(h*w-f*O-d*x)*A,e[4]=(u*j-o*E-c*S)*A,e[5]=(n*E-r*j+a*S)*A,e[6]=(p*_-v*O-m*b)*A,e[7]=(l*O-h*_+d*b)*A,e[8]=(o*C-s*j+c*P)*A,e[9]=(i*j-n*C-a*P)*A,e[10]=(v*w-g*_+m*y)*A,e[11]=(f*_-l*w-d*y)*A,e[12]=(s*S-o*k-u*P)*A,e[13]=(n*k-i*S+r*P)*A,e[14]=(g*b-v*x-p*y)*A,e[15]=(l*x-f*b+h*y)*A,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],v=e[13],g=e[14],p=e[15];return(t*o-n*a)*(f*p-h*g)-(t*s-i*a)*(l*p-h*v)+(t*u-r*a)*(l*g-f*v)+(n*s-i*o)*(c*p-h*d)-(n*u-r*o)*(c*g-f*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],g=t[12],p=t[13],m=t[14],y=t[15],b=n[0],_=n[1],x=n[2],w=n[3];return e[0]=b*i+_*s+x*f+w*g,e[1]=b*r+_*u+x*h+w*p,e[2]=b*a+_*c+x*d+w*m,e[3]=b*o+_*l+x*v+w*y,b=n[4],_=n[5],x=n[6],w=n[7],e[4]=b*i+_*s+x*f+w*g,e[5]=b*r+_*u+x*h+w*p,e[6]=b*a+_*c+x*d+w*m,e[7]=b*o+_*l+x*v+w*y,b=n[8],_=n[9],x=n[10],w=n[11],e[8]=b*i+_*s+x*f+w*g,e[9]=b*r+_*u+x*h+w*p,e[10]=b*a+_*c+x*d+w*m,e[11]=b*o+_*l+x*v+w*y,b=n[12],_=n[13],x=n[14],w=n[15],e[12]=b*i+_*s+x*f+w*g,e[13]=b*r+_*u+x*h+w*p,e[14]=b*a+_*c+x*d+w*m,e[15]=b*o+_*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,f,h,d,v,g=n[0],p=n[1],m=n[2];return t===e?(e[12]=t[0]*g+t[4]*p+t[8]*m+t[12],e[13]=t[1]*g+t[5]*p+t[9]*m+t[13],e[14]=t[2]*g+t[6]*p+t[10]*m+t[14],e[15]=t[3]*g+t[7]*p+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=v,e[12]=i*g+s*p+f*m+t[12],e[13]=r*g+u*p+h*m+t[13],e[14]=a*g+c*p+d*m+t[14],e[15]=o*g+l*p+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,f,h,d,v,g,p,m,y,b,_,x,w,O,P,S,j,k,C,E=r[0],A=r[1],T=r[2],M=Math.sqrt(E*E+A*A+T*T);return M0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=Ce.a,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return u()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64,a=e.dataChanged;if(this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,Array.isArray(a)){var o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;this._rebuildGeometry(f)}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(je.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.opts=t}return u()(e,[{key:"equals",value:function(e){return this===e||this.constructor===e.constructor&&Object(Le.a)(this.opts,e.opts)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var t=e.constructor.defaultProps,n=void 0===t?{}:t,i={updateTriggers:{}};for(var r in n)if(r in this.props){var a=n[r],o=this.props[r];i[r]=o,a&&"accessor"===a.type&&(i.updateTriggers[r]=this.props.updateTriggers[r],"function"==typeof o&&(i[r]=this.getSubLayerAccessor(o,!0)))}return i}},{key:"initializeState",value:function(e,t){}},{key:"updateState",value:function(e,t){}},{key:"finalizeState",value:function(e){}}]),e}();n.d(t,"experimental",function(){return Re}),n.d(t,"COORDINATE_SYSTEM",function(){return i.a}),n.d(t,"LightingEffect",function(){return r.a}),n.d(t,"PointLight",function(){return m}),n.d(t,"DirectionalLight",function(){return y.a}),n.d(t,"_CameraLight",function(){return _}),n.d(t,"_SunLight",function(){return F}),n.d(t,"PostProcessEffect",function(){return D.a}),n.d(t,"_LayersPass",function(){return N.a}),n.d(t,"Deck",function(){return z.a}),n.d(t,"LayerManager",function(){return B.a}),n.d(t,"AttributeManager",function(){return U.a}),n.d(t,"Layer",function(){return V.a}),n.d(t,"CompositeLayer",function(){return G.a}),n.d(t,"DeckRenderer",function(){return W.a}),n.d(t,"Viewport",function(){return H.a}),n.d(t,"WebMercatorViewport",function(){return X.a}),n.d(t,"project",function(){return q.a}),n.d(t,"project64",function(){return Z.a}),n.d(t,"View",function(){return Y.a}),n.d(t,"MapView",function(){return K.a}),n.d(t,"FirstPersonView",function(){return Q.a}),n.d(t,"ThirdPersonView",function(){return te}),n.d(t,"OrbitView",function(){return ne.a}),n.d(t,"PerspectiveView",function(){return ae}),n.d(t,"OrthographicView",function(){return oe.a}),n.d(t,"Controller",function(){return se.a}),n.d(t,"MapController",function(){return ue.a}),n.d(t,"_FirstPersonController",function(){return ce.a}),n.d(t,"_OrbitController",function(){return le.b}),n.d(t,"_OrthographicController",function(){return fe.a}),n.d(t,"Effect",function(){return he.a}),n.d(t,"TRANSITION_EVENTS",function(){return de.a}),n.d(t,"LinearInterpolator",function(){return ve.a}),n.d(t,"FlyToInterpolator",function(){return Oe}),n.d(t,"log",function(){return Pe.a}),n.d(t,"createIterable",function(){return je.a}),n.d(t,"fp64LowPart",function(){return ke.c}),n.d(t,"AmbientLight",function(){return Me.AmbientLight}),n.d(t,"LayerExtension",function(){return Ie});var Re={Tesselator:Ee,flattenVertices:Se.c,fillArray:Se.a,count:Ae.a,memoize:Te.a}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"e",function(){return d});var i={};function r(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function a(e){return Math.round(e/i.EPSILON)*i.EPSILON}function o(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function O(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.h([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function S(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function j(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){"use strict";var i=n(109),r=n(131),a=n(146),o=n(138),s=n(122),u=n(204),c=n(219),l=n(64),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h={modelMatrix:f,viewMatrix:f,projectionMatrix:f,cameraPositionWorld:[0,0,0]};var d="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",v={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new l.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(d,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(d)},g=n(114),p={lightDirection:new Float32Array([1,1,2])};var m={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[v]},y=n(205),b={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var _={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},x=n(188),w=n(218),O=n(206);n.d(t,"a",function(){return P}),n.d(t,"v",function(){return i.c}),n.d(t,"w",function(){return i.e}),n.d(t,"l",function(){return i.a}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.b}),n.d(t,"q",function(){return o.b}),n.d(t,"n",function(){return s.c}),n.d(t,"m",function(){return s.b}),n.d(t,"y",function(){return s.e}),n.d(t,"x",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u.a}),n.d(t,"k",function(){return c.a}),n.d(t,"u",function(){return v}),n.d(t,"p",function(){return g.a}),n.d(t,"i",function(){return m}),n.d(t,"t",function(){return y.a}),n.d(t,"h",function(){return _}),n.d(t,"o",function(){return x.a}),n.d(t,"s",function(){return x.b}),n.d(t,"r",function(){return w.a}),n.d(t,"b",function(){return O.a});var P={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",uniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(132),c=n(22),l=n(40),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.c(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.j(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.k(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.l(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,n,i){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e[3]=s+i*(n[3]-s),e}function g(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}function p(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function m(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=i.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-u)<=i.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=i.b*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var y,b;y=new i.a(4),i.a!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),b=y},function(e,t,n){e.exports=n(259)()},,function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"g",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"n",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return v}),n.d(t,"a",function(){return g}),n.d(t,"m",function(){return m}),n.d(t,"f",function(){return y});var i=n(12);function r(){var e=new i.a(3);return i.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function l(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function f(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function v(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function g(e,t){var n=o(e[0],e[1],e[2]),i=o(t[0],t[1],t[2]);u(n,n),u(i,i);var r=c(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var p,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},y=a;p=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={LNG_LAT:1,LNGLAT_AUTO_OFFSET:4,METER_OFFSETS:2,LNGLAT_OFFSETS:3,IDENTITY:0}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(32),u=n(11),c=n(52),l=n(59),f=n(30),h=n(117),d=n(234),v=n(19),g=n(26),p={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"},m={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:p},y={removedProps:p},b=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(s.a)(n)),n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=Object(d.a)("Buffer",e,m),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=Object(d.a)("Buffer",e,y))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new l.a(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Object(v.a)(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(Object(f.a)(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return Object(f.a)(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;Object(f.a)(this.gl);var c,l,d=Object(h.c)(this.accessor.type||5126,{clamped:!1}),g=this._getAvailableElementCount(r),p=o;n?c=(l=n.length)-p:l=p+(c=Math.min(g,u||g));var m=Math.min(g,c);return u=u||m,Object(v.a)(u<=m),n=n||new d(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Object(v.a)(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=Object(h.b)(e);return Object(v.a)(i),this.setAccessor(new l.a(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/Object(h.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new l.a(this.accessor,{type:Object(h.b)(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return g.a.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return g.a.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new l.a(this.accessor,e),this}},{key:"type",get:function(){return g.a.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return g.a.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(c.a)},,function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(15),l=n(85),f=n(22),h=n(64),d=n(29),v=n(20),g=n(27),p=n(18),m=Math.PI/180,y=Object(l.a)(),b=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Object(o.b)(t);var r=n.id,a=n.userData,s=void 0===a?{}:a;this.gl=t,this.id=r||Object(u.c)(this.constructor.name),this.userData=s,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=Object(o.d)(this.gl),u={},c=n||Object.keys(r),l=!0,f=!1,h=void 0;try{for(var d,v=c[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value,p=r[g];if(p&&(!("webgl2"in p)||a)&&(!("extension"in p)||this.gl.getExtension(p.extension))){var m=i?Object(s.a)(this.gl,g):g;u[m]=this.getParameter(g,e),i&&"GLenum"===p.type&&(u[m]=Object(s.a)(this.gl,u[m]))}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return u}},{key:"setParameter",value:function(e,t){e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Object(s.b)(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return Object(l.a)(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(f)}},{key:"_deleteHandle",value:function(){throw new Error(f)}},{key:"_bindHandle",value:function(){throw new Error(f)}},{key:"_getOptsFromHandle",value:function(){throw new Error(f)}},{key:"_getParameter",value:function(e,t){throw new Error(f)}},{key:"_setParameter",value:function(e,t){throw new Error(f)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=a.a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;a.a.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=a.a.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=a.a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}()},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(45),l=/([0-9]+\.?[0-9]*)(%|px)/;function f(e){switch(r()(e)){case"number":return{position:e,relative:!1};case"string":var t=e.match(l);if(t&&t.length>=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(105),v=n(18);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,O=t.modelMatrix,P=void 0===O?null:O,S=t.viewportInstance,j=void 0===S?null:S,k=t.type,C=void 0===k?c.a:k;Object(v.a)(!j||j instanceof c.a),this.viewportInstance=j,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(34),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(78),n(89))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(37);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.n([],t,e);return i.k(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(0),r=n(4),a=n(10),o=n(9),s=n(5),u=n(11),c=n(52),l=n(43),f=n(98),h=n(70),d=n(30),v=n(49),g=n(67),p=n(26),m=n(19),y=[9729,9728],b=function(e){function t(e,n){var i;Object(r.a)(this,t);var s=n.id,u=void 0===s?Object(g.c)("texture"):s,c=n.handle,l=n.target;return(i=Object(a.a)(this,Object(o.a)(t).call(this,e,{id:u,handle:c}))).target=l,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&Object(f.d)(e,n))&&(!i||Object(f.e)(e,n))),r}}]),Object(s.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var r=t.pixels,a=void 0===r?null:r,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,v=t.pixelStore,g=void 0===v?{}:v,m=t.textureUnit,y=void 0===m?void 0:m,b=t.unpackFlipY,_=void 0===b||b,x=t.mipmaps,w=void 0===x||x;n||(n=a);var O=t.width,P=t.height,S=t.dataFormat,j=t.type,k=t.depth,C=void 0===k?0:k,E=this._deduceParameters({format:s,type:j,dataFormat:S,compressed:!1,data:n,width:O,height:P});O=E.width,P=E.height,S=E.dataFormat,j=E.type,this.width=O,this.height=P,this.depth=C,this.format=s,this.type=j,this.dataFormat=S,this.border=c,this.textureUnit=y,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var A=Object(i.a)({},37440,_),T=Object.assign({},A,g);return w&&this._isNPOT()&&(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),w=!1,this._updateForNPOT(d)),this.mipmaps=w,this.setImageData({data:n,width:O,height:P,depth:C,format:s,type:j,dataFormat:S,border:c,mipmaps:w,parameters:T}),w&&this.generateMipmap(),this.setParameters(d),f&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.height,n=e.width,i=e.mipmaps,r=void 0!==i&&i;return n!==this.width||t!==this.height?this.initialize({width:n,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,v=e.offset,g=void 0===v?0:v,p=e.parameters,y=void 0===p?{}:p,b=e.data,_=void 0===b?null:b,x=e.type,w=void 0===x?this.type:x,O=e.width,P=void 0===O?this.width:O,S=e.height,j=void 0===S?this.height:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E;_||(_=r);var T=this._deduceParameters({format:u,type:w,dataFormat:C,compressed:A,data:_,width:P,height:j});w=T.type,C=T.dataFormat,A=T.compressed,P=T.width,j=T.height;var M=this.gl;M.bindTexture(this.target,this.handle);var L,I=this._getDataType({data:_,compressed:A});if(_=I.data,L=I.dataType,Object(h.a)(this.gl,y,function(){switch(L){case"null":M.texImage2D(n,o,u,P,j,l,C,w,_);break;case"typed-array":M.texImage2D(n,o,u,P,j,l,C,w,_,g);break;case"buffer":Object(d.a)(M),M.bindBuffer(35052,_.handle||_),M.texImage2D(n,o,u,P,j,l,C,w,g),M.bindBuffer(35052,null);break;case"browser-object":Object(d.d)(M)?M.texImage2D(n,o,u,P,j,l,C,w,_):M.texImage2D(n,o,u,C,w,_);break;case"compressed":M.compressedTexImage2D(n,o,u,P,j,l,_);break;default:Object(m.a)(!1,"Unknown image data type")}}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var R=f.a[this.dataFormat]||4,F=f.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,f=e.y,g=void 0===f?0:f,p=e.width,y=void 0===p?this.width:p,b=e.height,_=void 0===b?this.height:b,x=e.level,w=void 0===x?0:x,O=e.format,P=void 0===O?this.format:O,S=e.type,j=void 0===S?this.type:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E,T=e.offset,M=void 0===T?0:T,L=e.border,I=(void 0===L&&this.border,e.parameters),R=void 0===I?{}:I,F=this._deduceParameters({format:P,type:j,dataFormat:C,compressed:A,data:s,width:y,height:_});if(j=F.type,C=F.dataFormat,A=F.compressed,y=F.width,_=F.height,Object(m.a)(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var D=s;s=D.data,y=D.shape[0],_=D.shape[1]}s instanceof l.a&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,R,function(){A?t.gl.compressedTexSubImage2D(i,w,c,g,y,_,P,s):null===s?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s,M):s instanceof v.b?(Object(d.a)(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,w,c,g,y,_,C,j,M),t.gl.bindBuffer(35052,null)):Object(d.d)(t.gl)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s):t.gl.texSubImage2D(i,w,c,g,C,j,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p.a.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof l.a?{data:t.handle,dataType:"buffer"}:t instanceof v.b?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=f.b[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},Object(m.a)(i,"Could not deduced texture size"),Object(m.a)(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Object(m.a)(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Object(m.a)(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Object(d.d)(this.gl)&&(!(!this.width||!this.height)&&(!Object(g.b)(this.width)||!Object(g.b)(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===y.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(c.a)},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){for(var t=1;t0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(36),r=n(4),a=n(5),o=n(67),s=n(19),u={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,e);var n=t.id,i=void 0===n?Object(o.c)("geometry"):n,a=t.drawMode,s=void 0===a?u.TRIANGLES:a,c=t.attributes,l=void 0===c?{}:c,f=t.indices,h=void 0===f?null:f,d=t.vertexCount,v=void 0===d?null:d;this.id=i,this.drawMode=0|s,this.attributes={},this.userData={},this._setAttributes(l,h),this.vertexCount=v||this._calculateVertexCount(this.attributes,this.indices)}return Object(a.a)(e,null,[{key:"DRAW_MODE",get:function(){return u}}]),Object(a.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?Object(i.a)({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Object(s.a)(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||i.size||(i.size=3),"indices"===n?(Object(s.a)(!this.indices),this.indices=i):this.attributes[n]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}return Object(s.a)(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}()},function(e,t,n){"use strict";var i=n(175);function r(e,t,n){return(r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Object(i.a)(a,n.prototype),a}).apply(null,arguments)}var a=n(4),o=n(5),s=n(117),u=n(19),c=n(234);n.d(t,"a",function(){return h});var l={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},f={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},h=function(){function e(){var t=this;Object(a.a)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=Object(c.a)("Accessor",e,f)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(0),r=n(24),a=n(4),o=n(10),s=n(9),u=n(32),c=n(5),l=n(11),f=n(52),h=n(125),d=n(95),v=n(112),g=n(80),p=n(126),m=n(30),y=n(68),b=n(19),_=n(26),x=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this,t),(n=Object(o.a)(this,Object(s.a)(t).call(this,e,i))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(i),Object.seal(Object(u.a)(n)),n}return Object(l.a)(t,e),Object(c.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(c.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(Object(b.a)(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Object(b.a)(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&_.a.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,a=void 0!==i&&i,o=n.resizeAttachments,s=void 0===o||o,u={};a&&Object.keys(this.attachments).forEach(function(e){u[e]=null}),Object.assign(u,e);var c=this.gl.bindFramebuffer(36160,this.handle);for(var l in u){Object(b.a)(void 0!==l,"Misspelled framebuffer binding point?");var f=Number(l),h=u[f],v=h;if(v)if(v instanceof d.a)this._attachRenderbuffer({attachment:f,renderbuffer:v});else if(Array.isArray(h)){var g=Object(r.a)(h,3),p=g[0],m=g[1],y=void 0===m?0:m,_=g[2],x=void 0===_?0:_;v=p,this._attachTexture({attachment:f,texture:p,layer:y,level:x})}else this._attachTexture({attachment:f,texture:v,layer:0,level:0});else this._unattach(f);s&&v&&v.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(w(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&Object(v.a)(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){Object(v.b)({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;Object(m.a)(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Object(y.a)(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?Object(y.a)(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>_.a.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Object(g.b)(this,{maxHeight:100});return _.a.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,r,a){var o,s=null;e&&((s=s||{})[36064]=new h.a(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:r,height:a,mipmaps:!1,parameters:(o={},Object(i.a)(o,10241,9729),Object(i.a)(o,10240,9729),Object(i.a)(o,10242,33071),Object(i.a)(o,10243,33071),o)}));return t&&n?(s=s||{})[33306]=new d.a(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:r,height:111}):t?(s=s||{})[36096]=new d.a(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:r,height:a}):n&&Object(b.a)(!1),s}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof d.a?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Object(b.a)(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;Object(m.d)(t)?t.readBuffer(e):Object(b.a)(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(Object(m.d)(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Object(b.a)(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=Object(p.a)(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(f.a);function w(e){return(x.STATUS||{})[e]||"Framebuffer error ".concat(e)}x.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(9),o=n(5),s=n(11),u=n(161),c=35632,l=35633;function f(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Object(u.a)(t)||"(unnamed)",f="".concat(function(e){switch(e){case c:return"fragment";case l:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),v=0;v1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=d(a,r-o);return s+n+e})}(t);return{shaderName:f,errors:h(a,b),warnings:h(o,b)}}function h(e,t){for(var n="",i=0;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(132).a),p=n(20),m=n(47),y=n(40),b=n(37);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.n(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.n(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.n(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.n(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.n(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(62),r=n(197),a=n(142);function o(e,t,n){var r=i.c[t],o=r?r(e,Number(t)):e.getParameter(Number(t)),s=i.d[t];return Object(a.a)("function"==typeof s),s(e,n,Number(t)),o}function s(e,t){var n={};for(var r in t){var a=Number(r),o=i.d[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],a))}var s=e.state&&e.state.cache;if(s){var u=Object.assign({},s,t);for(var c in n){(0,i.a[c])(e,u)}}}function u(e,t){var n=i.c[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function c(e,t){t=t||i.b;var n=Array.isArray(t)?t:Object.keys(t),r={},a=!0,o=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;r[f]=u(e,f)}}catch(e){o=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return r}function l(e){s(e,Object.assign({},i.b,{}))}function f(e){var t=c(e,Object.keys(i.b)),n={};for(var a in i.b)Object(r.a)(t[a],i.b[a])||(n[a]=t[a]);return n}},function(e,t,n){"use strict";var i=n(9);function r(e,t,n){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(i.a)(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i=n(19),r={};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";r[e]=r[e]||1;var t=r[e]++;return"".concat(e,"-").concat(t)}function o(e){return Object(i.a)("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function s(e){var t=!0;for(var n in e){t=!1;break}return t}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var i=n(19);function r(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var r=e[t=t.replace(/^.*\./,"")];return Object(i.a)(void 0!==r,"Accessing undefined constant GL.".concat(t)),r}function a(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(77),r=n.n(i),a=n(41),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(90),r=n(147),a=n(233),o=n(142);function s(e,t,n){if(Object(a.a)(t))return n(e);var s,u=t.nocatch,c=void 0===u||u;if(Object(o.a)(!t.frameBuffer),Object(i.c)(e),Object(r.a)(e,t),c)s=n(e),Object(i.b)(e);else try{s=n(e)}finally{Object(i.b)(e)}return s}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});var i="vs",r="fs"},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}function o(e){return e&&e[Symbol.asyncIterator]}},function(e,t,n){"use strict";n.d(t,"c",function(){return _}),n.d(t,"a",function(){return x}),n.d(t,"b",function(){return w});var i,r=n(24),a=n(0),o=n(19),s=5120,u=5121,c=5122,l=5123,f=0,h=1,d=2,v=3,g=4,p=5,m=6,y=5126,b=(i={},Object(a.a)(i,y,[y,1,"float"]),Object(a.a)(i,35664,[y,2,"vec2"]),Object(a.a)(i,35665,[y,3,"vec3"]),Object(a.a)(i,35666,[y,4,"vec4"]),Object(a.a)(i,5124,[5124,1,"int"]),Object(a.a)(i,35667,[5124,2,"ivec2"]),Object(a.a)(i,35668,[5124,3,"ivec3"]),Object(a.a)(i,35669,[5124,4,"ivec4"]),Object(a.a)(i,5125,[5125,1,"uint"]),Object(a.a)(i,36294,[5125,2,"uvec2"]),Object(a.a)(i,36295,[5125,3,"uvec3"]),Object(a.a)(i,36296,[5125,4,"uvec4"]),Object(a.a)(i,35670,[y,1,"bool"]),Object(a.a)(i,35671,[y,2,"bvec2"]),Object(a.a)(i,35672,[y,3,"bvec3"]),Object(a.a)(i,35673,[y,4,"bvec4"]),Object(a.a)(i,35674,[y,8,"mat2"]),Object(a.a)(i,35685,[y,8,"mat2x3"]),Object(a.a)(i,35686,[y,8,"mat2x4"]),Object(a.a)(i,35675,[y,12,"mat3"]),Object(a.a)(i,35687,[y,12,"mat3x2"]),Object(a.a)(i,35688,[y,12,"mat3x4"]),Object(a.a)(i,35676,[y,16,"mat4"]),Object(a.a)(i,35689,[y,16,"mat4x2"]),Object(a.a)(i,35690,[y,16,"mat4x3"]),i);function _(e){switch(e){case f:return f;case h:case v:case d:return h;case g:case p:case m:return g;default:return Object(o.a)(!1),0}}function x(e){var t=b[e];if(!t)return null;var n=Object(r.a)(t,2);return{type:n[0],components:n[1]}}function w(e,t){switch(e){case s:case u:case c:case l:e=y}for(var n in b){var i=Object(r.a)(b[n],3),a=i[0],o=i[1],f=i[2];if(a===e&&o===t)return{glType:n,name:f}}return null}},function(e,t,n){"use strict";n.d(t,"e",function(){return y}),n.d(t,"d",function(){return b}),n.d(t,"b",function(){return _}),n.d(t,"a",function(){return w}),n.d(t,"c",function(){return O});var i,r=n(0),a=n(60),o=n(95),s=n(56),u=n(26),c=(i={},Object(r.a)(i,5126,function(e,t,n){return e.uniform1fv(t,g(n,1))}),Object(r.a)(i,35664,function(e,t,n){return e.uniform2fv(t,g(n,2))}),Object(r.a)(i,35665,function(e,t,n){return e.uniform3fv(t,g(n,3))}),Object(r.a)(i,35666,function(e,t,n){return e.uniform4fv(t,g(n,4))}),Object(r.a)(i,5124,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35667,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35668,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35669,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35670,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35671,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35672,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35673,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,g(n,4))}),Object(r.a)(i,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,g(n,9))}),Object(r.a)(i,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,g(n,16))}),Object(r.a)(i,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,5125,function(e,t,n){return e.uniform1uiv(t,m(n,1))}),Object(r.a)(i,36294,function(e,t,n){return e.uniform2uiv(t,m(n,2))}),Object(r.a)(i,36295,function(e,t,n){return e.uniform3uiv(t,m(n,3))}),Object(r.a)(i,36296,function(e,t,n){return e.uniform4uiv(t,m(n,4))}),Object(r.a)(i,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,g(n,6))}),Object(r.a)(i,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,g(n,8))}),Object(r.a)(i,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,g(n,6))}),Object(r.a)(i,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,g(n,12))}),Object(r.a)(i,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,g(n,8))}),Object(r.a)(i,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,g(n,12))}),Object(r.a)(i,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36311,function(e,t,n){return e.uniform1i(t,n)}),i),l={},f={},h={},d=[0];function v(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(d[0]=e,e=d);var r=e.length;if(r%t&&u.a.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&uHTMLVideoElement.HAVE_METADATA&&(i.width!==o.videoWidth||i.height!==o.videoHeight?(i.resize({width:o.videoWidth,height:o.videoHeight,mipmaps:!0}),i.setSubImageData({data:o,paramters:P})):i.setSubImageData({data:o}),i.generateMipmap());i&&r&&r.setUniforms(Object.assign({},t,{bitmapTexture:i,desaturate:s,transparentColor:u.map(function(e){return e/255}),tintColor:c.slice(0,3).map(function(e){return e/255})})).draw()}},{key:"loadTexture",value:function(e){var t=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),e instanceof O.a?this.setState({bitmapTexture:e}):e instanceof Image||e instanceof HTMLCanvasElement?this.setState({bitmapTexture:new O.a(t,{data:e,parameters:P})}):e instanceof HTMLVideoElement&&this.setState({bitmapTexture:new O.a(t,{width:1,height:1,parameters:P,mipmaps:!1})})}},{key:"calculatePositions",value:function(e){var t=e.value,n=this.state.positions;t.set(n)}},{key:"calculatePositions64xyLow",value:function(e){var t=this.use64bitPositions();(e.constant=!t,t)?e.value.set(this.state.positions.map(b.c)):e.value=new Float32Array(4)}}]),t}(_.a);S.layerName="BitmapLayer",S.defaultProps={image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};var j,k=n(72),C=n(80),E=n(121),A=1024,T=4,M=function(){},L=(j={},y()(j,10241,9987),y()(j,10240,9729),j);function I(e){return e&&(e.id||e.url)}function R(e,t,n){for(var i=0;i0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&(R(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&R(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new O.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:L})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(C.f)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:L}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(E.b)(e.url).then(function(r){var a=I(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},L,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),D=[0,0,0,255],N={iconAtlas:{type:"object",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},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:D},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},z=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new F(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:D},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s||this.props._asyncPropOriginalValues.iconAtlas?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),r.extensionsChanged){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(k.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=Object(b.c)(p[0]),a[o++]=Object(b.c)(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(_.a);z.layerName="IconLayer",z.defaultProps=N;var B=n(221),U=n(191),V=[0,0,0,255],G=[0,0,1],W=new U.a,H={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:G},getColor:{type:"accessor",value:V},material:W,radiusPixels:{deprecatedFor:"pointSize"}};var X=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:G},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:V}})}},{key:"updateState",value:function(e){var n,i,r,a=e.props,o=e.oldProps,s=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:a,oldProps:o,changeFlags:s}),s.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),this.getAttributeManager().invalidateAll()}s.dataChanged&&(n=a.data,i=n.header,r=n.attributes,i&&r&&(n.length=i.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION,r.instancePositions64xyLow={constant:!0,value:new Float32Array(2)}),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0&&(r.instanceColors=r.COLOR_0)))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(k.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var _=s(y,h);u[c++]=Object(b.c)(_[0]),u[c++]=Object(b.c)(_[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(_.a);X.layerName="PointCloudLayer",X.defaultProps=H;var q=n(170),Z=n(169),Y=n(216),K=n(113),Q=n(217),J=n(222),$=n(192),ee=n(16),te=n.n(ee),ne=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position); \n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getParagraphSize,f=r.getRowSize,h=r.getOffsets,d=e.value,v=n*e.size,g=Object(k.a)(a,n,i).iterable,p=!0,m=!1,y=void 0;try{for(var b,_=g[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){var x=b.value,w=o[s(x)]||{},O=l(x),P=te()(O,2),S=P[0],j=P[1],C=f(x),E=te()(C,1)[0],A=h(x),T=te()(A,2),M=T[0],L=T[1],I=u(x),R=c(x),F=(1-I)*(S-E)/2;d[v++]=(I-1)*S/2+F+w.width/2+M||0,d[v++]=(R-1)*j/2+w.height/2+L||0}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(k.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(z);ne.layerName="MultiIconLayer",ne.defaultProps={getRowSize:{type:"accessor",value:function(e){return e.rowSize||[0,0]}},getOffsets:{type:"accessor",value:function(e){return e.offsets||[0,0]}},getParagraphSize:{type:"accessor",value:function(e){return e.size||[1,1]}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ie=n(231),re=n.n(ie),ae=n(15),oe=32;function se(e,t,n,i,r){var a=e.split("\n"),o=[0,0],s=0;a.forEach(function(e){var a=function(e,t,n){var i=0,r=0,a=Array.from(e);return{characters:a=a.map(function(e,a){var o={text:e,offsetLeft:i},s=t[e];return s?(i+=s.width,r||(r=s.height*n)):(ae.a.warn("Missing character: ".concat(e))(),i+=oe),o}),rowWidth:i,rowHeight:r}}(e,n,t),u=a.characters,c=a.rowWidth,l=a.rowHeight,f=[c,l];u.forEach(function(e){e.offsetTop=s,e.size=o,e.rowSize=f,r.push(i(e))}),s+=l,o[0]=Math.max(o[0],c)}),o[1]=s}var ue=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ce=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),le="Monaco, monospace",fe="normal",he=64,de=2,ve=.25,ge=3,pe=new ue(3),me=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function ye(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};me.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=pe.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=pe.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),pe.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");be(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(be(h,r,o,a),u){var b=new re.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,O=void 0;try{for(var P,S=t[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;ye(b.draw(j),_),h.putImageData(_,v[j].x-s,v[j].y-s)}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}}else{var k=!0,C=!1,E=void 0;try{for(var A,T=t[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h.fillText(M,v[M].x,v[M].y+.9*o)}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=pe.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),xe=n(137),we={fontSize:he,buffer:de,sdf:!1,radius:ge,cutoff:ve},Oe={start:1,middle:0,end:-1},Pe={top:1,center:0,bottom:-1},Se=["fontSize","buffer","sdf","radius","cutoff"],je={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ce,fontFamily:le,fontWeight:fe,lineHeight:1,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},ke=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new _e(this.context.gl)}}},{key:"updateState",value:function(e){var t=this,n=e.props,i=e.oldProps,r=e.changeFlags,a=this.fontChanged(i,n);a&&this.updateFontAtlas({oldProps:i,props:n});var o=r.dataChanged||a||n.lineHeight!==i.lineHeight||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText);if(o&&Array.isArray(r.dataChanged)){var s=this.state.data.slice(),u=r.dataChanged.map(function(e){return Object(xe.a)({data:s,getIndex:function(e){return e.__source.index},dataRange:e,replace:t.transformStringToLetters(e)})});this.setState({data:s,dataDiff:u})}else o&&this.setState({data:this.transformStringToLetters(),dataDiff:null})}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},we,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return Se.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,r=n.lineHeight,a=n.getText,o=this.state.iconMapping,s=t.startRow,u=t.endRow,c=Object(k.a)(i,s,u),l=c.iterable,f=c.objectInfo,h=[],d=!0,v=!1,g=void 0;try{for(var p,m=function(){var t=p.value;f.index++;var n=a(t,f);n&&se(n,r,o,function(n){return e.getSubLayerRow(n,t,f.index)},h)},y=l[Symbol.iterator]();!(d=(p=y.next()).done);d=!0)m()}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}return h}},{key:"getAnchorXFromTextAnchor",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Oe[e]||0}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Pe[e]||0}}},{key:"renderLayers",value:function(){var e=this.state,t=e.data,n=e.dataDiff,i=e.scale,r=e.iconAtlas,a=e.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.billboard,g=o.sdf,p=o.sizeScale,m=o.sizeUnits,y=o.sizeMinPixels,b=o.sizeMaxPixels,_=o.transitions,x=o.updateTriggers;return new(this.getSubLayerClass("characters",ne))({sdf:g,iconAtlas:r,iconMapping:a,_dataDiff:n&&function(){return n},getPosition:this.getSubLayerAccessor(s),getColor:this.getSubLayerAccessor(u),getSize:this.getSubLayerAccessor(c),getAngle:this.getSubLayerAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this.getSubLayerAccessor(d),getPickingIndex:function(e){return e.__source.index},billboard:v,sizeScale:p*i,sizeUnits:m,sizeMinPixels:y*i,sizeMaxPixels:b*i,transitions:_&&{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:x.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:x.getPixelOffset,getAnchorX:x.getTextAnchor,getAnchorY:x.getAlignmentBaseline}}),{data:t,getIcon:function(e){return e.text},getRowSize:function(e){return e.rowSize},getOffsets:function(e){return[e.offsetLeft,e.offsetTop]},getParagraphSize:function(e){return e.size}})}}]),t}($.a);ke.layerName="TextLayer",ke.defaultProps=je;var Ce=n(130);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return S}),n.d(t,"IconLayer",function(){return z}),n.d(t,"LineLayer",function(){return B.a}),n.d(t,"PointCloudLayer",function(){return X}),n.d(t,"ScatterplotLayer",function(){return q.a}),n.d(t,"ColumnLayer",function(){return Z.a}),n.d(t,"GridCellLayer",function(){return Y.a}),n.d(t,"PathLayer",function(){return K.a}),n.d(t,"PolygonLayer",function(){return Q.a}),n.d(t,"GeoJsonLayer",function(){return J.a}),n.d(t,"TextLayer",function(){return ke}),n.d(t,"SolidPolygonLayer",function(){return Ce.a}),n.d(t,"_MultiIconLayer",function(){return ne})},function(e,t,n){"use strict";var i=n(43),r=n(60),a=n(56),o=n(70),s=n(30),u=n(117),c=n(19);function l(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(c.a)(!1),0}}var f=n(158),h=n(26);function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,f=t.sourceAttachment,h=void 0===f?36064:f,d=t.target,v=void 0===d?null:d,g=t.sourceWidth,p=t.sourceHeight,m=t.sourceType,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=_.attachments;g=g||_.width,p=p||_.height,36064===h&&null===O&&(h=1028),Object(c.a)(P[h]),v=function(e,t,n,i,r){if(e)return e;t=t||5121;var a=Object(u.c)(t,{clamped:!1}),o=l(n);return new a(i*r*o)}(v,m=m||P[h].type,s,g,p),m=m||Object(u.b)(v);var S=w.bindFramebuffer(36160,O);return w.readPixels(i,a,g,p,s,m,v),w.bindFramebuffer(36160,S||null),x&&_.delete(),v}function v(e,t){var n=t.sourceX,r=void 0===n?0:n,a=t.sourceY,u=void 0===a?0:a,f=t.sourceFormat,h=void 0===f?6408:f,d=t.target,v=void 0===d?null:d,g=t.targetByteOffset,p=void 0===g?0:g,m=t.sourceWidth,y=t.sourceHeight,_=t.sourceType,x=b(e),w=x.framebuffer,O=x.deleteFramebuffer;Object(c.a)(w);var P=w.gl;if(m=m||w.width,y=y||w.height,Object(s.a)(P),_=_||(v?v.type:5121),!v){var S=l(h),j=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(c.a)(!1),0}}(_),k=p+m*y*S*j;v=new i.a(P,{byteLength:k,accessor:{type:_,size:S}})}return v.bind({target:35051}),Object(o.a)(P,{framebuffer:w},function(){P.readPixels(r,u,m,y,h,_,p)}),v.unbind({target:35051}),O&&w.delete(),v}function g(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=d(e,{sourceAttachment:i}),s=e.width,c=e.height;c>a;){var l=Object(u.d)({data:o,width:s,height:c});o=l.data,s=l.width,c=l.height}Object(u.a)({data:o,width:s,height:c});var f=document.createElement("canvas");f.width=s,f.height=c;var h=f.getContext("2d"),v=h.createImageData(s,c);return v.data.set(o),h.putImageData(v,0,0),f.toDataURL()}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=g(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,o=n.sourceY,s=void 0===o?0:o,u=n.targetX,l=n.targetY,f=n.targetZ,h=n.targetMipmaplevel,d=void 0===h?0:h,v=n.targetInternalFormat,g=void 0===v?6408:v,p=n.width,m=n.height,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=void 0!==u||void 0!==l||void 0!==f;u=u||0,l=l||0,f=f||0;var S=w.bindFramebuffer(36160,O);Object(c.a)(t);var j=null;if(t instanceof a.a&&(j=t,p=Number.isFinite(p)?p:j.width,m=Number.isFinite(m)?m:j.height,j.bind(0),t=j.target),P)switch(t){case 3553:case 34067:w.copyTexSubImage2D(t,d,u,l,r,s,p,m);break;case 35866:case 32879:w.copyTexSubImage3D(t,d,u,l,f,r,s,p,m)}else w.copyTexImage2D(t,d,g,r,s,p,m,0);return j&&j.unbind(),w.bindFramebuffer(36160,S||null),x&&_.delete(),j}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,u=n.sourceY0,l=void 0===u?0:u,f=n.sourceX1,d=n.sourceY1,v=n.targetX0,g=void 0===v?0:v,p=n.targetY0,m=void 0===p?0:p,y=n.targetX1,_=n.targetY1,x=n.color,w=void 0===x||x,O=n.depth,P=void 0!==O&&O,S=n.stencil,j=void 0!==S&&S,k=n.mask,C=void 0===k?0:k,E=n.filter,A=void 0===E?9728:E,T=b(e),M=T.framebuffer,L=T.deleteFramebuffer,I=b(t),R=I.framebuffer,F=I.deleteFramebuffer;Object(c.a)(M),Object(c.a)(R);var D=R.gl,N=R.handle,z=R.width,B=R.height,U=R.readBuffer;Object(s.a)(D),M.handle||36064!==r||(r=1028),w&&(C|=16384),P&&(C|=256),j&&(C|=1024),(L||F)&&1280&C&&(C=16384,h.a.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Object(c.a)(C),f=void 0===f?M.width:f,d=void 0===d?M.height:d,y=void 0===y?z:y,_=void 0===_?B:_;var V=D.bindFramebuffer(36009,N),G=D.bindFramebuffer(36008,M.handle);return D.readBuffer(r),D.blitFramebuffer(o,l,f,d,g,m,y,_,C,A),D.readBuffer(U),D.bindFramebuffer(36008,G||null),D.bindFramebuffer(36009,V||null),L&&M.delete(),F&&R.delete(),R}function b(e){return e instanceof r.a?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Object(f.b)(e),deleteFramebuffer:!0}}n.d(t,"e",function(){return d}),n.d(t,"f",function(){return v}),n.d(t,"b",function(){return g}),n.d(t,"c",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return y})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(178),v=n(22),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(81),u=n(179),c=n(18),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(82),u=n(15),c=n(18),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,e.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){if(!this.isDragging())return!1;var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState,r={};switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut(),r.isZooming=!0;break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn(),r.isZooming=!0;break;case 37:n?(t=i.rotateLeft(),r.isRotating=!0):(t=i.moveLeft(),r.isPanning=!0);break;case 39:n?(t=i.rotateRight(),r.isRotating=!0):(t=i.moveRight(),r.isPanning=!0);break;case 38:n?(t=i.rotateUp(),r.isRotating=!0):(t=i.moveUp(),r.isPanning=!0);break;case 40:n?(t=i.rotateDown(),r.isRotating=!0):(t=i.moveDown(),r.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),r),!0}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";var i=n(204),r=n(42),a=Object.keys(r.a).map(function(e){return"const float COORDINATE_SYSTEM_".concat(e," = ").concat(r.a[e],".;")}).join(""),o="".concat(a,"\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform float project_uAntimeridian;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n dy = clamp(dy, -1., 1.);\n }\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n"),s=n(135),u={};t.a={name:"project",dependencies:[i.a],vs:o,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?Object(s.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return v});var i=n(29);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-t[2],-t[6],-t[10]],up:[t[1],t[5],t[9]],right:[t[0],t[4],t[8]]}}var o=new i.a,s=new i.a,u=new i.a,c=new i.a,l=new i.a,f=new i.a,h=new i.a;function d(e){var t=e.aspect,n=e.near,r=e.far,a=e.fovyRadians,d=e.position,v=e.direction,g=e.up,p=e.right;s.copy(v);var m=1/s.len();s.normalize(),o.copy(d),u.copy(g).normalize(),c.copy(p).normalize();var y=2*Math.tan(a/2)*n,b=y*t;l.copy(s).scale(n*m).add(o),f.copy(s).scale(r*m).add(o);var _=s.clone().negate(),x=_.dot(l),w={near:{distance:x,normal:_},far:{distance:s.dot(f),normal:s.clone()}};return h.copy(c).scale(.5*b).add(l).subtract(o).normalize(),_=new i.a(u).cross(h),x=o.dot(_),w.right={normal:_,distance:x},h.copy(c).scale(.5*-b).add(l).subtract(o).normalize(),_=new i.a(h).cross(u),x=o.dot(_),w.left={normal:_,distance:x},h.copy(u).scale(.5*y).add(l).subtract(o).normalize(),_=new i.a(h).cross(c),x=o.dot(_),w.top={normal:_,distance:x},h.copy(u).scale(.5*-y).add(l).subtract(o).normalize(),_=new i.a(c).cross(h),x=o.dot(_),w.bottom={normal:_,distance:x},w}function v(e){return e-Math.fround(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(96),r=n(54);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t){var n,i,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),Object(c.a)(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(78))},function(e,t,n){"use strict";var i=n(36),r=n(90),a=n(49),o="Failed to create WebGL context in Node.js, headless gl not available",s="Failed to create WebGL context in Node.js, headless gl returned null";var u=n(124);var c=n(111),l=(n(19),n(110)),f=n(26),h=n(46);n.d(t,"e",function(){return g}),n.d(t,"a",function(){return p}),n.d(t,"c",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"d",function(){return b});function d(e){return Boolean(e&&2===e._version)}var v={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(v,{width:1,height:1},e)}function p(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},v,t),r=n.width,h=n.height;function g(e){if(t.throwOnError)throw new Error(e);return null}if(l.a){var p=t.canvas;e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(Object(u.a)({canvas:p,width:r,height:h,onError:g}),t)}else e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,u=e.onError;if(r&&!i)return u("headless-gl does not support WebGL2");if(!a.c)return u(o);var c=Object(a.c)(t,n,e);return c||u(s)}(Object(i.a)({},t,{width:r,height:h,onError:g}));return e?(function(e){var t=d(e)?"WebGL2":"WebGL1",n=Object(c.a)(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";f.a.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=m(e,t)),e):null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==a.a&&e instanceof a.a)return 2;return 1}(e);var n=t=Object.assign({},v,t),i=n.manageState,o=n.debug;return i&&Object(r.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(5),a=n(29),o=n(64),s=n(67),u=n(19),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id;this.id=n||Object(s.c)(this.constructor.name),this.display=!0,this.position=new a.a,this.rotation=new a.a,this.scale=new a.a(1,1,1),this.matrix=new o.a,this.userData={},this.props={},this._setScenegraphNodeProps(t)}return Object(r.a)(e,[{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:"setPosition",value:function(e){return Object(u.a)(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return Object(u.a)(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return Object(u.a)(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Object(u.a)(e),t=t||this.matrix;var n=new o.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{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)}}]),e}()},function(e,t,n){"use strict";var i=n(0),r=n(36),a=n(4),o=n(5),s=n(10),u=n(9),c=n(66),l=n(11),f=n(43),h=n(201),d=n(19),v={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function g(e,t){var n=(t||{}).attributeMap,i=void 0===n?v:n;return i&&i[e]||e}function p(e,t){var n;switch(e){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2}Object(d.a)(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var m=n(30),y=n(202),b=n(176),_=n(196),x=n(28),w=n(131),O=n(207),P=n(208),S=n(209),j=n(41),k=n.n(j),C=n(46),E={},A=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},T=new Map;k.a.listenFor("luma.gl",function(e){var t=E[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){C.d.__SEER_INITIALIZED__&&(T.has(e)||T.set(e,new Map),T.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();A(i,n,e.value),t.setUniforms(i)}});var M=n(67),L=n(26),I=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),Object(d.a)(Object(m.c)(t));var i=n.id,r=void 0===i?Object(M.c)("base-model"):i;this.id=r,this.gl=t,this.id=n.id||Object(M.c)("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(o.a)(e,[{key:"initialize",value:function(e){this.props={},this.program=this._createProgram(e),this.vertexArray=new y.a(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete E[t],k.a.deleteItem("luma.gl",t)}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.uniforms}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),function(e,t){if(C.d.__SEER_INITIALIZED__&&e){var n=T.get(e);n&&n.forEach(function(e,n){A(t,n,e)})}}(this.id,e),e=this._extractAnimatedUniforms(e),this.program.setUniforms(e),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,s=t.attributes,u=void 0===s?{}:s,c=t.transformFeedback,l=void 0===c?this.transformFeedback:c,f=t.parameters,h=void 0===f?{}:f,d=t.vertexArray,v=void 0===d?this.vertexArray:d,g=t.animationProps;E[(e=this).id]||(E[e.id]=e,k.a.listItem("luma.gl",e.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(g);var p=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&L.a.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,b=m.indexType,_=m.indexOffset,x=this.isInstanced,w=this.instanceCount,O=function(){},P=this.props,S=P.onBeforeRender,j=void 0===S?O:S,C=P.onAfterRender,A=void 0===C?O:C;j(),this._timerQueryStart();var T=this.program.draw(Object.assign({},t,{logPriority:p,uniforms:null,framebuffer:r,parameters:h,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:b,isInstanced:x,instanceCount:w,offset:y?_:0}));return this._timerQueryEnd(),A(),this._logDrawCallEnd(p,v,r),T}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&b.a.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&L.a.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,s=e.defines,u=void 0===s?{}:s,c=e.inject,l=void 0===c?{}:c,f=e.shaderCache,h=void 0===f?null:f,v=e.varyings,g=void 0===v?null:v,p=e.bufferMode,m=void 0===p?35981:p,y=e.program,b=void 0===y?null:y;this.getModuleUniforms=function(e){};var O=this.id;if(!b){n=n||x.a.vs,r=r||x.a.fs;var P=Object(w.a)(this.gl,{vs:n,fs:r,modules:o,inject:l,defines:u,log:L.a});n=P.vs,r=P.fs,b=h?h.getProgram(this.gl,{id:O,vs:n,fs:r}):new _.a(this.gl,{id:O,vs:n,fs:r,varyings:g,bufferMode:m}),this.getModuleUniforms=P.getUniforms||function(e){}}return Object(d.a)(b instanceof _.a,"Model needs a program"),b}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!Object(M.a)(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new b.a(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,L.a.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(L.a.priority>> DRAWING MODEL ".concat(this.id),{collapsed:L.a.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=Object(O.a)({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=Object(P.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,c=Object(P.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),l=c.table;c.count>0&&L.a.log("MISSING UNIFORMS",Object.keys(l))(),u>0&&L.a.log("UNUSED UNIFORMS",Object.keys(s))();var f=Object(S.a)(this.vertexArray.configuration);L.a.table(e,r)(),L.a.table(e,o)(),L.a.table(e+1,f)(),function(e,t){if(k.a.isReady()&&!k.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);k.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),L.a.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}();n.d(t,"a",function(){return R});var R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,t);var i=n.id,o=void 0===i?Object(M.c)("model"):i;return Object(s.a)(this,Object(u.a)(t).call(this,e,Object(r.a)({},n,{id:o})))}return Object(l.a)(t,e),Object(o.a)(t,[{key:"initialize",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Object(d.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){Object(c.a)(Object(u.a)(t.prototype),"delete",this).call(this),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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Object(d.a)(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Object(d.a)(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=function(e,t,n){var i={},a=t.indices;for(var o in t.attributes){var s=t.attributes[o],u=g(o,n);if("indices"===o)a=s;else if(s.constant)i[u]=s.value;else{var c=s.value,l=Object(r.a)({},s);delete l.value,i[u]=[new f.a(e,c),l],p(o,l)}}if(a){var h=a.value||a;Object(d.a)(h instanceof Uint16Array||h instanceof Uint32Array,'attribute array for "indices" must be of integer type');var v={size:1,isIndexed:void 0===a.isIndexed||a.isIndexed};i.indices=[new f.a(e,{data:h,target:34963}),v]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(M.a)(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,r=e.feedbackBuffers,a=e.unbindModels,o=void 0===a?[]:a,s=e.parameters;r&&this._setFeedbackBuffers(r),n&&(s=Object.assign({},s,Object(i.a)({},35977,n))),o.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:s}))}finally{o.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return L.a.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof f.a&&t.delete()}}},{key:"_setAnimationProps",value:function(e){if(this.animated){Object(d.a)(e,"Model.draw(): animated uniforms but no animationProps");var t=this._evaluateAnimateUniforms(e);this.program.setUniforms(t)}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(M.a)(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new h.a(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}}]),t}(I)},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,i))).initialize(i),Object.seal(Object(s.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=Object(v.d)(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,d)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(u.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Object(g.a)(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Object(v.d)(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*d[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(173),r="7.2.0-beta.2",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return h});var i,r,a,o=n(0),s=n(30),u=(i={},Object(o.a)(i,6407,{dataFormat:6407,types:[5121,33635]}),Object(o.a)(i,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(o.a)(i,6406,{dataFormat:6406,types:[5121]}),Object(o.a)(i,6409,{dataFormat:6409,types:[5121]}),Object(o.a)(i,6410,{dataFormat:6410,types:[5121]}),Object(o.a)(i,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(o.a)(i,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(o.a)(i,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(o.a)(i,34836,{dataFormat:6408,types:[5126],gl2:!0}),i),c=(r={},Object(o.a)(r,6403,1),Object(o.a)(r,36244,1),Object(o.a)(r,33319,2),Object(o.a)(r,33320,2),Object(o.a)(r,6407,3),Object(o.a)(r,36248,3),Object(o.a)(r,6408,4),Object(o.a)(r,36249,4),Object(o.a)(r,6402,1),Object(o.a)(r,34041,1),Object(o.a)(r,6406,1),Object(o.a)(r,6409,1),Object(o.a)(r,6410,2),r),l=(a={},Object(o.a)(a,5126,4),Object(o.a)(a,5125,4),Object(o.a)(a,5124,4),Object(o.a)(a,5123,2),Object(o.a)(a,5122,2),Object(o.a)(a,5131,2),Object(o.a)(a,5120,1),Object(o.a)(a,5121,1),a);function f(e,t){var n=u[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=Object(s.d)(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}function h(e,t){var n=u[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},,function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(10),a=n(9),o=n(11),s=n(93),u=n(58),c="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",l=[-1,-1,1,-1,-1,1,1,1],f=function(e){function t(e,n){var o;Object(i.a)(this,t);var s=l.map(function(e){return-1===e?0:e});return(o=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},n,{vs:c,geometry:new u.a({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(l)},aTexCoord:{size:2,value:new Float32Array(s)},aCoordinate:{size:2,value:new Float32Array(s)}}})})))).setVertexCount(4),o}return Object(o.a)(t,e),t}(s.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(177),v=n(70),g=n(112),p=n(147),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.a)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.a)(e,{scissorTest:!0,scissor:l},function(){return Object(g.a)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(p.a)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,mousePosition:e.context.mousePosition,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.a)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i,r=n(0),a=n(30),o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",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"};t.b=(i={},Object(r.a)(i,o.WEBGL2,[function(e){return Object(a.d)(e)}]),Object(r.a)(i,o.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(r.a)(i,o.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(r.a)(i,o.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(r.a)(i,o.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(r.a)(i,o.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(r.a)(i,o.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(r.a)(i,o.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(r.a)(i,o.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(r.a)(i,o.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(r.a)(i,o.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(r.a)(i,o.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(r.a)(i,o.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(r.a)(i,o.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),i)},function(e,t,n){"use strict";function i(e,t){return e===t||Object.keys(e).every(function(n){return Array.isArray(e[n])&&Array.isArray(t[n])?i(e[n],t[n]):e[n]===t[n]})}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(32),o=n(9),s=n(66),u=n(5),c=n(11),l=n(52),f=n(43),h=n(30),d=null;function v(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!d||d.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var u=s.id||s.program&&s.program.id;return(n=Object(r.a)(this,Object(o.a)(t).call(this,e,Object.assign({},s,{id:u})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(s),Object.seal(Object(a.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?Object(h.d)(e)||"Chrome"===function(e){if(!e&&!Object(m.a)())return"Node";if(Object(y.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":p.b.chrome?"Chrome":p.b.safari?"Safari":p.b.mozInnerScreenX?"Firefox":"Unknown"}():Object(h.d)(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Object(g.a)(!1)}}}]),Object(u.a)(t,[{key:"delete",value:function(){Object(s.a)(Object(o.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(g.a)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Object(g.a)(Object(h.d)(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new f.a(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=v(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof a.a)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof a.a)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new a.a(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"e",function(){return c}),n.d(t,"a",function(){return l}),n.d(t,"c",function(){return f}),n.d(t,"d",function(){return h}),n.d(t,"b",function(){return d});var u=new s;function c(e){u.setDefaultShaderModules(e)}function l(){return u.getDefaultShaderModules()}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;u.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(u.defaultShaderModules),v(e=u.resolveModules(e))}function d(e){return u.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,a=t.color,l=void 0===a?null:a,f=t.depth,h=void 0===f?null:f,d=t.stencil,g=void 0===d?null:d,p={};i&&(p.framebuffer=i);var m=0;l&&(m|=c,!0!==l&&(p.clearColor=l)),h&&(m|=s,!0!==h&&(p.clearDepth=h)),g&&(m|=u,!0!==h&&(p.clearStencil=h)),Object(o.a)(0!==m,v),Object(r.a)(e,p,function(){e.clear(m)})}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,s=void 0===n?null:n,u=t.buffer,c=void 0===u?l:u,g=t.drawBuffer,p=void 0===g?0:g,m=t.value,y=void 0===m?[0,0,0,0]:m;Object(a.a)(e),Object(r.a)(e,{framebuffer:s},function(){switch(c){case l:switch(y.constructor){case Int32Array:e.clearBufferiv(c,p,y);break;case Uint32Array:e.clearBufferuiv(c,p,y);break;case Float32Array:default:e.clearBufferfv(c,p,y)}break;case f:e.clearBufferfv(f,0,[y]);break;case h:e.clearBufferiv(h,0,[y]);break;case d:var t=Object(i.a)(y,2),n=t[0],r=t[1];e.clearBufferfi(d,0,n,r);break;default:Object(o.a)(!1,v)}})}},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(129),p=n(93),m=n(58),y=n(21),b=n(85),_=y.experimental.Tesselator,x=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3,padding:3},endPositions:{size:3,padding:3},segmentTypes:{size:1,type:Uint8ClampedArray},startPositions64XyLow:{size:2,padding:2,fp64Only:!0},endPositions64XyLow:{size:2,padding:2,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){var t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t+1:Math.max(0,t-1)}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.startPositions64XyLow,o=n.endPositions64XyLow,s=n.segmentTypes,u=this.fp64,c=t.geometrySize;if(0!==c)for(var l,f,h=this.isClosed(e),d=t.vertexStart,v=0;v=e.length&&(t+=1-e.length/n),[e[t*n],e[t*n+1],3===n?e[t*n+2]:0]}return t>=e.length&&(t+=1-e.length),e[t]}},{key:"isClosed",value:function(e){var t=this.getPathLength(e),n=this.getPointOnPath(e,0),i=this.getPointOnPath(e,t-1);return n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]}}]),t}(_);n.d(t,"a",function(){return S});var w=[0,0,0,255],O={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:w},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},P={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceLeftStartPositions64xyLow;\nattribute vec4 instanceEndRightPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width, vec2 widthPixels\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = !isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0);\n bool isEndCap = isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0);\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(vCornerOffset * widthPixels * isValid, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n return currPoint + vec3(offset.xy / widthPixels * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n vec2 width = billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width, widthPixels\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.worldPosition = instanceStartPositions;\n geometry.worldPositionAlt = instanceEndPositions;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceLeftStartPositions64xyLow.xy, instanceLeftStartPositions64xyLow.zw, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceLeftStartPositions64xyLow.zw, instanceEndRightPositions64xyLow.xy, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceEndRightPositions64xyLow.xy, instanceEndRightPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({startPositions:{size:3,offset:12,transition:P,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{offset:0},instanceStartPositions:{offset:12}}},endPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0,shaderAttributes:{instanceEndPositions:{offset:0},instanceRightPositions:{offset:12}}},instanceLeftStartPositions64xyLow:{size:4,stride:8,update:this.calculateLeftStartPositions64xyLow,noAlloc:!0},instanceEndRightPositions64xyLow:{size:4,stride:8,update:this.calculateEndRightPositions64xyLow,noAlloc:!0},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:P,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:P,defaultValue:w},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new x({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions(),dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),r.dataChanged||a.invalidateAll()}if(r.extensionsChanged){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.a({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateSegmentTypes",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("segmentTypes")}},{key:"calculateLeftStartPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startPositions64XyLow"):new Float32Array(4)}},{key:"calculateEndRightPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("endPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,o=n.pointLights,s=n.directionalLights,u=i||o&&o.length>0||s&&s.length>0;return u?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,o=void 0===r?[]:r,s={};s["lighting_uAmbientLight.color"]=t?a(t):[0,0,0];return i.forEach(function(e,t){s["lighting_uPointLight[".concat(t,"].color")]=a(e),s["lighting_uPointLight[".concat(t,"].position")]=e.position,s["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),s.lighting_uPointLightCount=i.length,o.forEach(function(e,t){s["lighting_uDirectionalLight[".concat(t,"].color")]=a(e),s["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),s.lighting_uDirectionalLightCount=o.length,s}({ambientLight:i,pointLights:o,directionalLights:s}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var c={pointLights:[],directionalLights:[]},l=!0,f=!1,h=void 0;try{for(var d,v=(t.lights||[])[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;switch(g.type){case"ambient":c.ambientLight=g;break;case"directional":c.directionalLights.push(g);break;case"point":c.pointLights.push(g)}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return e({lightSources:c})}return{}},defines:{MAX_LIGHTS:3}},{});function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o});var i=n(57),r={};function a(e){e=Array.isArray(e)?e:[e];var t=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var u=o.value;Object(i.b)(u);var c=!0,l=!1,f=void 0;try{for(var h,d=u.extensions[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;r[v]=u}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}}}catch(e){n=!0,a=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}}function o(){return Object.values(r)}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"d",function(){return s});var i="Failed to deduce GL constant from typed array";function r(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(i)}}function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u=24&&2303741511===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint32(16,u),height:e.getUint32(20,u)}}}],["image/jpeg",{test:function(e){return e.byteLength>=2&&65496===e.getUint16(0,u)},getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,u))return null;var t=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),n=t.tableMarkers,i=t.sofMarkers,r=2;for(;r=10&&1195984440===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint16(6,c),height:e.getUint16(8,c)}}}],["image/bmp",{test:function(e){return e.byteLength>=2&&16973===e.getUint16(0,u)},getSize:function(e){return{width:e.getUint32(18,c),height:e.getUint32(22,c)}}}]]);var f="Invalid MIME type. Supported MIME types are: ".concat(Array.from(l.keys()).join(", "));function h(e){var t=g(e),n=!0,i=!1,r=void 0;try{for(var a,o=l.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=Object(s.a)(a.value,2),c=u[0];if((0,u[1].test)(t))return c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(0,v(t=t||h(e)).getSize)(g(e));if(!n)throw new Error("invalid image data for type: ".concat(t));return n}(e,t=t||h(e));return n.mimeType=t,n}function v(e){var t=l.get(e);if(!t)throw new Error(f);return t}function g(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}n.d(t,"a",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"e",function(){return _}),n.d(t,"c",function(){return x});var p=o.a._parseImageNode||"undefined"!=typeof ImageBitmap;function m(e,t){if(o.a._parseImageNode){var n=d(e).mimeType;return o.a._parseImageNode(e,n,t)}return _(e)}function y(e,t){return b.apply(this,arguments)}function b(){return(b=Object(a.a)(r.a.mark(function e(t,n){var i,a;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof Image){e.next=8;break}return e.next=3,fetch(t,n);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return a=e.sent,e.abrupt("return",m(a));case 8:return e.next=10,x(t,n);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _(e){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var t=new Blob([new Uint8Array(e)]);return createImageBitmap(t)}function x(e,t){return w.apply(this,arguments)}function w(){return(w=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(24),r=n(118),a="void main() {gl_FragColor = vec4(0);}",o="#version 300 es\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}";function s(e,t){t=Array.isArray(t)?t:[t];var n=e.replace(/^\s+/,"").split(/\s+/),r=Object(i.a)(n,3),a=r[0],o=r[1],s=r[2];return t.includes(a)&&o&&s?{qualifier:a,type:o,name:s.split(";")[0]}:null}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var i=n(19),r="";function a(e){r=e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)("string"==typeof e),e=r+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function s(e,t){return Object(i.a)("string"==typeof e),e=r+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i,r=n(110).a&&"undefined"!=typeof document,a=r&&"complete"===document.readyState;function o(){return i||(i=r?new Promise(function(e,t){if(r&&"complete"===document.readyState)return a=!0,void e(document);window.onload=function(){a=!0,e(document)}}):Promise.resolve({})),i}function s(e){var t,n=e.canvas,i=e.width,r=e.height,o=e.onError,s=void 0===o?function(){}:o;return"string"==typeof n?(a||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:s}),t}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(56),l=n(30),f=n(123),h=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.b)(e),(s instanceof Promise||"string"==typeof s)&&(s={data:s}),"string"==typeof s.data&&(s=Object.assign({},s,{data:Object(f.b)(s.data)})),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},s,{target:3553})))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e,t){return c.a.isSupported(e,t)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return u});var i=n(104),r=n(30),a=n(19);function o(e,t){return s(e,t)}function s(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return c(e,t)})}function u(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=Object(r.d)(e),i.b)e.luma.caps[t]=c(e,t);return e.luma.caps}function c(e,t){var n=i.b[t];Object(a.a)(n,t);var o,s=Object(r.d)(e)&&n[1]||n[0];if("function"==typeof s)o=s(e);else if(Array.isArray(s)){o=!0;var u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;o=o&&Boolean(e.getExtension(d))}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}else"string"==typeof s?o=Boolean(e.getExtension(s)):"boolean"==typeof s?o=s:Object(a.a)(!1);return o}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(4),r=function e(){Object(i.a)(this,e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return O});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(184),v=n(22),g=n(83),p=n(136),m=n(81),y=n(82),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,O=void 0===w?b.minZoom:w,P=e.maxZoom,S=void 0===P?b.maxZoom:P,j=e.startPanPosition,k=e.startTarget,C=e.startRotationX,E=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:O,maxZoom:S})))._interactiveState={startPanPosition:j,startTarget:k,startRotationX:C,startRotationOrbit:E,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c=Object.keys(t),l=0;l=0&&n.modules.splice(i,1)}return"inject"in t&&(n.inject=Object.assign({},e.inject,t.inject)),n}var T=n(150),M=n(99),L=n(72),I={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return N(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return R(e,t)}},accessor:{validate:function(e,t){var n=z(e);return"function"===n||n===z(t.value)},equal:function(e,t,n){return"function"==typeof t||R(e,t)}},array:{validate:function(e,t){return t.optional&&!e||N(e)},equal:function(e,t,n){return n.compare?R(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function R(e,t){if(e===t)return!0;if(!N(e)||!N(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=Q,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):Object(L.b)(t)?this._resolveAsyncIterable(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){t=n._postProcessValue(e,t),n._setAsyncPropValue(e,t,r);var i=n.layer.props.onDataLoad;"data"===e&&i&&i(t,{propName:e,layer:n.layer})}).catch(function(e){return C.a.error(e)()})}},{key:"_resolveAsyncIterable",value:function(){var e=Z()(X.a.mark(function e(t,n){var i,r,a,o,s,u,c,l,f,h,d,v;return X.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"data"!==t&&this._setPropValue(t,n),(i=this.asyncProps[t]).pendingLoadCount++,r=i.pendingLoadCount,a=[],o=0,s=!0,u=!1,e.prev=8,l=K()(n);case 10:return e.next=12,l.next();case 12:return f=e.sent,s=f.done,e.next=16,f.value;case 16:if(h=e.sent,s){e.next=26;break}d=h,a=this._postProcessValue(t,d,a),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:o,endRow:a.length}]}),o=a.length,this._setAsyncPropValue(t,a,r);case 23:s=!0,e.next=10;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(8),u=!0,c=e.t0;case 32:if(e.prev=32,e.prev=33,s||null==l.return){e.next=37;break}return e.next=37,l.return();case 37:if(e.prev=37,!u){e.next=40;break}throw c;case 40:return e.finish(37);case 41:return e.finish(32);case 42:(v=this.layer.props.onDataLoad)&&v(a,{propName:t,layer:this.layer});case 44:case"end":return e.stop()}},e,this,[[8,28,32,42],[33,,37,41]])}));return function(t,n){return e.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(e,t,n){var i=(this.component?this.component.props:{}).dataTransform;return"data"!==e?t:i?i(t,n):n?n.concat(t):t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),$=0,ee=function(){function e(){o()(this,e),this.props=function(){for(var e=U(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=e.match(Oe);if(i&&i[0]){var r=function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object(_e.b)(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,i[0]);if(r)return r}var a=function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s.testText&&s.testText(t))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,t);return a||null}var Se=n(116),je=function(e){return e&&e instanceof ArrayBuffer},ke=function(e){return e&&e instanceof Buffer};function Ce(e){if(je(e))return e;if(ke(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){var t=e;return(new TextEncoder).encode(t).buffer}return Object(ge.a)(!1)}var Ee=new Map;function Ae(e,t,n){var i=function(e){var t=Ee.get(e);if(!t){var n=new Blob([e],{type:"application/javascript"});t=URL.createObjectURL(n),Ee.set(e,t)}return new Worker(t)}(e);n=function(e){null!==(e=Object.assign({},e)).log&&delete e.log;return e}(n);var r=function(e,t){return new Promise(function(n,r){i.onmessage=function(e){switch(e.data.type){case"done":n(e.data.result),i.terminate();break;case"error":r(new Error(e.data.message))}};var a=Ce(e);i.postMessage({arraybuffer:a,opts:t},[a])})};return t?r(t,n):r}function Te(e){this.wrapped=e}function Me(e){var t,n;function i(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Te;Promise.resolve(s?o.wrapped:o).then(function(e){s?i("next",e):r(a.done?"return":"normal",e)},function(e){i("throw",e)})}catch(e){r("throw",e)}}function r(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(a,o){var s={key:e,arg:r,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,i(e,r))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(Me.prototype[Symbol.asyncIterator]=function(){return this}),Me.prototype.next=function(e){return this._invoke("next",e)},Me.prototype.throw=function(e){return this._invoke("throw",e)},Me.prototype.return=function(e){return this._invoke("return",e)};n(226);var Le="Cannot convert supplied data type";function Ie(e){return se(e)?e.url:null}function Re(e,t){if(t.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){var n=e.buffer||e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}throw new Error(Le)}function Fe(e,t){return De.apply(this,arguments)}function De(){return(De=oe(re.a.mark(function e(t,n){var i;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(t=e.sent,i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=6;break}return e.abrupt("return",Re(t,n));case 6:if(!ue(t)){e.next=10;break}return e.next=9,me(t);case 9:t=e.sent;case 10:if(!se(t)){e.next=19;break}if(!n.binary){e.next=17;break}return e.next=14,t.arrayBuffer();case 14:e.t0=e.sent,e.next=18;break;case 17:e.t0=t.text();case 18:return e.abrupt("return",e.t0);case 19:throw new Error(Le);case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ne(e,t,n,i){return ze.apply(this,arguments)}function ze(){return(ze=oe(re.a.mark(function e(t,n,i,r){return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=r||Ie(t),e.next=3,Fe(t,n);case 3:if(t=e.sent,!n.parseTextSync||"string"!=typeof t){e.next=7;break}return i.dataType="text",e.abrupt("return",n.parseTextSync(t,i,r,n));case 7:if(!n.parseSync){e.next=9;break}return e.abrupt("return",n.parseSync(t,i,r,n));case 9:if(!n.parse){e.next=13;break}return e.next=12,n.parse(t,i,r,n);case 12:return e.abrupt("return",e.sent);case 13:if(!n.worker){e.next=17;break}return e.next=16,Ae(n.worker,t,i);case 16:return e.abrupt("return",e.sent);case 17:return e.abrupt("return",Object(ge.a)(!1));case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Be(e,t,n,i){return Ue.apply(this,arguments)}function Ue(){return(Ue=oe(re.a.mark(function e(t,n,i,r){var a,o;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||Object(_e.a)(n)||(r=i,i=n,n=null),a=ue(r)?r.name:r,n=n||Object(Se.a)(),o=Array.isArray(n)?Pe(a,t,n):n){e.next=6;break}return e.abrupt("return",null);case 6:return Object(_e.b)(o),i=we(i,o),e.next=10,Ne(t,o,i,a);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ve(){return(Ve=oe(re.a.mark(function e(t,n,i){var r,a,o;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||Object(_e.a)(n)||(i=n,n=null),r=ue(t)?t.name:t,n=n||Object(Se.a)(),a=Array.isArray(n)?Pe(r,null,n):n,i=we(i,a),!a||!a.loadAndParse){e.next=9;break}return e.next=8,a.loadAndParse(t,i);case 8:return e.abrupt("return",e.sent);case 9:if(!ue(o=t)&&"string"!=typeof o){e.next=14;break}return e.next=13,ye(t,i);case 13:o=e.sent;case 14:return e.abrupt("return",Be(o,n,i,r));case 15:case"end":return e.stop()}},e)}))).apply(this,arguments)}n.d(t,"a",function(){return Xe});var Ge=Object.freeze([]),We=new Uint8ClampedArray(0),He={data:{type:"data",value:Ge,async:!0},dataComparator:null,_dataDiff:{type:"function",value:function(e){return e&&e.__diff},compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:function(e,t){return function(e,t,n){return Ve.apply(this,arguments)}(e,t.layer.getLoadOptions())},compare:!1},updateTriggers:{},numInstances:void 0,visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:.8},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:g.a.LNGLAT,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:{},uniforms:{},extensions:[],framebuffer:null,animation:null,getPolygonOffset:{type:"function",value:function(e){return[0,100*-e.layerIndex]},compare:!1},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"color",value:[0,0,128,128]}},Xe=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,[{key:"toString",value:function(){var e=this.constructor.layerName||this.constructor.name;return"".concat(e,"({id: '").concat(this.props.id,"'})")}},{key:"setState",value:function(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}},{key:"setNeedsRedraw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{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:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(T.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(ne.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(T.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){C.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){C.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitPositions",value:function(){return this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return C.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.props.extensions[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=A(e,o.getShaders.call(this,o))}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return e}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();if(t.dataChanged&&n){var i=t.dataChanged;if(Array.isArray(i)){var r=!0,a=!1,o=void 0;try{for(var s,u=i[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;n.invalidateAll(c)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}else n.invalidateAll()}}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(C.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(C.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;this._setModelAttributes(o,e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"_updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}}},{key:"updateTransition",value:function(){var e=this.getAttributeManager();e&&e.updateTransition(this.context.time)}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.numInstances,i=e.value,r=e.size;if(1!==i[0]){var a=We.length/r;if(a2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=Object(O.c)(v),o[2*l+1]=Object(O.c)(g)),s[l]=1,l++}if(h)for(var m=0;m2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(146);n.d(t,"c",function(){return k}),n.d(t,"b",function(){return C}),n.d(t,"a",function(){return E});var w="\n\n".concat(x.a,"\n\n"),O=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),S={},j="precision highp float;\n\n";function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function C(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);S[e]=S[e]||{},S[e][o]=S[e][o]||{},Object(s.a)(!S[e][o][n],"Module injection already created"),S[e][o][n]={injection:i,order:a}}function E(e,t){var n=t.vs,i=t.fs,r=Object(o.d)(t.modules||[]);return{gl:e,vs:A(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:A(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:T(r),modules:M(r)}}function A(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=t.defines,c=void 0===u?{}:u,l=t.inject,f=void 0===l?{}:l,h=t.prologue,v=void 0===h||h,p=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var b=r===a.b,_=i.split("\n"),k=100,C="",E=i;0===_[0].indexOf("#version ")&&(k=300,C=_[0],E=_.slice(1).join("\n"));var A={};o.forEach(function(e){Object.assign(A,e.getDefines())}),Object.assign(A,c);var T=v?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(O[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(O[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(A),"\n").concat(b?"":j,"\n"):"".concat(C,"\n"),M=!1,L={},I={};for(var R in f){var F="string"==typeof f[R]?{injection:f[R],order:0}:f[R];R.match(/^(v|f)s:/)?"#"===R[3]?I[R]=[F]:L[R]=[F]:I[R]=[F]}var D=!0,N=!1,z=void 0;try{for(var B,U=o[Symbol.iterator]();!(D=(B=U.next()).done);D=!0){var V=B.value;switch(V.name){case"inject":M=!0;break;default:if(p&&V.checkDeprecations(E,p),T+=V.getModuleSource(r,k),S[V.name]){var G=S[V.name][r];for(var W in G)W.match(/^(v|f)s:#/)?(I[W]=I[W]||[],I[W].push(G[W])):(L[W]=L[W]||[],L[W].push(G[W]))}}}}catch(e){N=!0,z=e}finally{try{D||null==U.return||U.return()}finally{if(N)throw z}}return T+=w,T+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,L),T+=E,T=Object(x.c)(T,r,I,M)}function T(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function M(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.b)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(22),l=function(e,t){if(!e)throw new Error(t)},f=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t=0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(29),u=n(200),c=n(18),l={position:[0,0,0],lookAt:[0,0,0],up:[0,0,1],rotationX:0,rotationY:0,fov:50,near:1,far:100},f=function(){function e(t){r()(this,e);var n=t.width,i=t.height,a=t.position,o=void 0===a?l.position:a;Object(c.a)(Number.isFinite(n),"`width` must be supplied"),Object(c.a)(Number.isFinite(i),"`height` must be supplied"),this._viewportProps=this._applyConstraints(Object.assign({},t,{position:new s.a(o)}))}return o()(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getDirection",value:function(){return new u.a({bearing:this._viewportProps.bearing,pitch:this._viewportProps.pitch}).toVector3().normalize()}},{key:"getDirectionFromBearing",value:function(e){return new u.a({bearing:e,pitch:90}).toVector3().normalize()}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}()},function(e,t,n){"use strict";function i(e){for(var t=e.data,n=e.getIndex,i=e.dataRange,r=e.replace,a=i.startRow,o=void 0===a?0:a,s=i.endRow,u=void 0===s?1/0:s,c=t.length,l=c,f=c,h=0;hh&&d>=o&&(l=h),d>=u){f=h;break}}for(var v=l,g=f-l!==r.length,p=g&&t.slice(f),m=0;m=t.min)}},array:{validate:function(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function c(e){var t=l(e);return"object"===t?e?"type"in e?Object.assign({},e,u[e.type]):"value"in e?(t=l(e.value),Object.assign({type:t},e,u[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},u[t])}function l(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":Object(s.a)(e)}n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var f=function(){function e(t){var n=t.name,r=t.vs,a=t.fs,s=t.dependencies,u=void 0===s?[]:s,l=t.uniforms,f=t.getUniforms,h=t.deprecations,d=void 0===h?[]:h,v=t.defines,g=void 0===v?{}:v,p=t.vertexShader,m=t.fragmentShader;Object(i.a)(this,e),Object(o.a)("string"==typeof n),this.name=n,this.vs=r||p,this.fs=a||m,this.getModuleUniforms=f,this.dependencies=u,this.deprecations=this._parseDeprecationDefinitions(d),this.defines=g,l&&(this.uniforms=function(e){var t={};for(var n in e){var i=c(e[n]);t[n]=i}return t}(l))}return Object(r.a)(e,[{key:"getModuleSource",value:function(e,t){var n;switch(e){case"vs":n=a(this.vs||"",t,!0);break;case"fs":n=a(this.fs||"",t,!1);break;default:Object(o.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase(),"\n").concat(n,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,t){this.deprecations.forEach(function(n){n.regex.test(e)&&(n.deprecated?t.deprecated(n.old,n.new)():t.removed(n.old,n.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=this.uniforms;for(var i in n){var r=n[i];i in e&&!r.private?(r.validate&&Object(o.a)(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function h(e){if(!e.normalized&&(e.normalized=!0,e.uniforms&&!e.getUniforms)){var t=new f(e);e.getUniforms=t.getUniforms.bind(t)}return e}},function(e,t,n){"use strict";n.d(t,"b",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"a",function(){return g});var i=n(230),r=n.n(i);function a(e){if(e=e&&e.positions||e,!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new Error("invalid polygon")}function o(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(97),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return p}),n.d(t,"c",function(){return m});var i=n(5),r=n(10),a=n(9),o=n(11),s=n(4),u=n(29),c=n(67),l=[255,255,255],f=[0,0,1],h=[0,0,-1],d=[0,0,1],v=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e),this.id=t.id||Object(c.c)("light");var n=t.color,i=void 0===n?l:n;this.color=i;var r=t.intensity,a=void 0===r?1:r;this.intensity=a},g=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="ambient",e}return Object(o.a)(t,e),t}(v),p=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="directional";var i=n.direction,o=void 0===i?h:i;return e.direction=new u.a(o).normalize().toArray(),e}return Object(o.a)(t,e),t}(v),m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="point";var i=n.position,o=void 0===i?d:i;return e.position=o,e.attenuation=e._getAttenuation(n),e}return Object(o.a)(t,e),Object(i.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:f}}]),t}(v)},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=function(e){function t(e){var n;r()(this,t),n=u()(this,l()(t).call(this,e));var i=e._shadow,a=void 0!==i&&i;return n.shadow=a,n}return h()(t,e),o()(t,[{key:"getProjectedLight",value:function(){return this}}]),t}(n(144).b)},function(e,t,n){"use strict";var i,r=n(0),a=n(71),o=n(118);n.d(t,"a",function(){return u}),n.d(t,"c",function(){return h}),n.d(t,"b",function(){return d});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u="__LUMA_INJECT_DECLARATIONS__",c=/void main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,f=[];function h(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),f.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(65),r=n(24),a=n(25);function o(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var s={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(a.a)(t))},blendEquation:function(e,t){t=o(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(a.a)(t))},blendFunc:function(e,t){t=o(t)&&2===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,e.blendFuncSeparate.apply(e,Object(a.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(a.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(a.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(a.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(a.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(a.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(a.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=o(t)?t:[t,t],i=Object(r.a)(n,2),a=i[0],s=i[1];e.stencilMaskSeparate(1028,a),e.stencilMaskSeparate(1029,s)},stencilFunc:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilFuncSeparate(1028,s,u,c),e.stencilFuncSeparate(1029,l,f,h)},stencilOp:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilOpSeparate(1028,s,u,c),e.stencilOpSeparate(1029,l,f,h)},viewport:function(e,t){return e.viewport.apply(e,Object(a.a)(t))}};function u(e,t){for(var n in Object(i.f)(e,t),t){var r=s[n];r&&r(e,t[n],n)}}n.d(t,"a",function(){return u})},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(125),v=n(109),g=n(144),p=n(145),m=n(103),y=n(64),b=n(29),_=n(8),x=n.n(_),w=n(13),O=n.n(w),P=n(102),S=n(95),j=n(60),k=n(70),C=function(e){function t(e,n){var i,a,o;return r()(this,t),(o=u()(this,l()(t).call(this,e,n))).shadowMap=new d.a(e,{width:1,height:1,parameters:(i={},x()(i,10241,9729),x()(i,10240,9729),x()(i,10242,33071),x()(i,10243,33071),i)}),o.depthBuffer=new S.a(e,{format:33189,width:1,height:1}),o.fbo=new j.a(e,{id:"shadowmap",width:1,height:1,attachments:(a={},x()(a,36064,o.shadowMap),x()(a,36096,o.depthBuffer),a)}),o}return h()(t,e),o()(t,[{key:"render",value:function(e){var n=this,i=this.fbo;Object(k.a)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var r=e.viewports[0],a=r.width*n.props.pixelRatio,o=r.height*n.props.pixelRatio;a===i.width&&o===i.height||i.resize({width:a,height:o}),O()(l()(t.prototype),"render",n).call(n,Object.assign(e,{outputBuffer:i}))})}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,drawToShadowMap:!0,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{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)}}]),t}(P.a),E=n(162);n.d(t,"a",function(){return L});var A={color:[255,255,255],intensity:1},T=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],M=[0,0,0,200/255],L=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],n.shadowColor=M,n.shadowPasses=[],n.dummyShadowMaps=[],n.shadow=!1,e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n._applyDefaultLights(),n.directionalLights.some(function(e){return e.shadow})&&(n.shadow=!0,n._addShadowModule()),n}return h()(t,e),o()(t,[{key:"prepare",value:function(e,t){var n=t.layers,i=t.viewports,r=t.onViewportActive,a=t.views,o=t.pixelRatio;if(!this.shadow)return{};var s=this._createLightMatrix();0===this.shadowPasses.length&&this._createShadowPasses(e,o),0===this.dummyShadowMaps.length&&this._createDummyShadowMaps(e);for(var u=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.a)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new g.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(p.a)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(177).a),y=n(138);n.d(t,"a",function(){return b});var b=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(y.b)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=w(t),a=new m(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=w(t,r),s="".concat(n,"-").concat(a);return new m(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return _(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return x(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(16),r=n.n(i),a=n(31),o=n(135),s=n(37),u=n(40),c=n(27);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.n([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.m(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.overAlloc,i=void 0===n?2:n,a=t.poolSize,o=void 0===a?100:a;r()(this,e),this.overAlloc=i,this.poolSize=o,this._pool=[]}return o()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=void 0===i?1:i,a=n.type,o=n.padding,s=void 0===o?0:o,u=n.copy,c=void 0!==u&&u,l=a||e&&e.constructor||Float32Array,f=t*r+s;if(ArrayBuffer.isView(e)){if(f<=e.length)return e;if(f*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new l(e.buffer,0,f)}var h=this._allocate(l,f);return e&&c?h.set(e):h.fill(0,0,4),this._release(e),h}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,t){t=Math.max(Math.ceil(t*this.overAlloc),1);var n=this._pool,i=e.BYTES_PER_ELEMENT*t,r=n.findIndex(function(e){return e.byteLength>=i});return r>=0?new e(n.splice(r,1)[0],0,t):new e(t)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.poolSize&&t.shift()}}}]),e}();t.a=new s},function(e,t){function n(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise(function(r,a){var o=e.apply(t,i);function s(e){n(o,r,a,s,u,"next",e)}function u(e){n(o,r,a,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(32),c=n(24),l=n(55),f=n(27),h=n(20),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(199),p=n(47);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,O=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(f.l)(g);x=Math.max(.75,x);var S=Object(f.g)([d,l],P);S[2]=0;var j=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:O||1.01}),k=Object(f.f)({height:s,center:S,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:k,projectionMatrix:j}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=P,e.center=S,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,,function(e,t,n){"use strict";(function(e){var t=n(97),i=n(141);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return u({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},Object(a.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=s(t),r=o(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}}))},function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return l});var i=n(0),r=n(125),a=n(159),o=n(160),s=n(60),u=n(19);function c(e,t){Object(u.a)(e instanceof r.a||e instanceof a.a||e instanceof o.a);var n=e.constructor,i=e.gl,s=e.width,c=e.height,l=e.format,f=e.type,h=e.dataFormat,d=e.border,v=e.mipmaps;return new n(i,Object.assign({width:s,height:c,format:l,type:f,dataFormat:h,border:d,mipmaps:v},t))}function l(e,t){var n=e.gl,r=e.width,a=e.height,o=e.id;return new s.a(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(i.a)({},36064,e)}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(50),r=n.n(i),a=n(115),o=n(4),s=n(5),u=n(10),c=n(9),l=n(32),f=n(11),h=n(56),d=n(30),v=n(26),g=[34069,34070,34071,34072,34073,34074],p=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,t),Object(d.b)(e),(n=Object(u.a)(this,Object(c.a)(t).call(this,e,Object.assign({},i,{target:34067})))).initialize(i),Object.seal(Object(l.a)(n)),n}return Object(f.a)(t,e),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(a.a)(r.a.mark(function e(t){var n,i,a,o,s,u,c,l,f,h,d,p,m,y=this;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,a=t.pixels,o=t.data,s=t.border,u=void 0===s?0:s,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,p=a||o,e.next=5,Promise.all(g.map(function(e){var t=p[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:m=e.sent,this.bind(),g.forEach(function(e,t){m[t].length>1&&!1!==y.opts.mipmaps&&v.a.warn("".concat(y.id," has mipmap and multiple LODs."))(),m[t].forEach(function(t,r){n&&i?d.texImage2D(e,r,l,n,i,u,l,h,t):d.texImage2D(e,r,l,l,h,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(h.a);p.FACES=g},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(70),l=n(30),f=n(56),h=n(98),d=n(43),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.a)(e),s=Object.assign({depth:1},s,{target:32879,unpackFlipY:!1}),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(s.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,l=void 0===u?1:u,f=e.border,v=void 0===f?0:f,g=e.format,p=e.type,m=void 0===p?5121:p,y=e.offset,b=void 0===y?0:y,_=e.data,x=e.parameters,w=void 0===x?{}:x;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(c.a)(this.gl,w,function(){ArrayBuffer.isView(_)&&t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,_),_ instanceof d.a&&(t.gl.bindBuffer(35052,_.handle),t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,b))}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var O=h.a[this.dataFormat]||4,P=h.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*O*P,"Texture")}return this.loaded=!0,this}}]),t}(f.a)},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(77),r=n.n(i),a=n(16),o=n.n(a),s=n(131),u=n(42),c=n(64),l=n(29),f=n(94),h=n(27),d=Object(f.a)(function(e){var t=e.viewport,n=e.center;return new c.a(t.viewProjectionMatrix).invert().transformVector4(n)}),v=Object(f.a)(function(e){var t=e.viewport,n=e.shadowMatrices,i=[],a=t.pixelUnprojectionMatrix,s=[[0,0],[t.width,0],[0,t.height],[t.width,t.height],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(function(e){return function(e,t){var n=o()(e,3),i=n[0],r=n[1],a=n[2],s=Object(h.h)([i,r,a],t);if(Number.isFinite(a))return s;return[s[0],s[1],0]}(e,a)}),u=!0,f=!1,d=void 0;try{for(var v,g=function(){var e=v.value,n=e.clone().translate(new l.a(t.center).negate()),a=s.map(function(e){return n.transformVector3(e)}),o=(new c.a).ortho({left:Math.min.apply(Math,r()(a.map(function(e){return e[0]}))),right:Math.max.apply(Math,r()(a.map(function(e){return e[0]}))),bottom:Math.min.apply(Math,r()(a.map(function(e){return e[1]}))),top:Math.max.apply(Math,r()(a.map(function(e){return e[1]}))),near:Math.min.apply(Math,r()(a.map(function(e){return-e[2]}))),far:Math.max.apply(Math,r()(a.map(function(e){return-e[2]})))});i.push(o.multiplyRight(e))},p=n[Symbol.iterator]();!(u=(v=p.next()).done);u=!0)g()}catch(e){f=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(f)throw d}}return i});Object(s.b)("shadow",{hook:"vs:DECKGL_FILTER_GL_POSITION",injection:"\nposition = shadow_setVertexPosition(geometry.position);\n "}),Object(s.b)("shadow",{hook:"fs:DECKGL_FILTER_COLOR",injection:"\ncolor = shadow_filterShadowColor(color);\n "});var g=[0,0,0,1],p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];t.a={name:"shadow",dependencies:["project"],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap[max_lights];\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[i], shadow_uShadowMap[i]) * shadow_uColor.a / shadow_uLightCount;\n }\n }\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){var n={},i=e.shadowEnabled;return(void 0===i||i)&&e.shadowMatrices&&e.shadowMatrices.length>0?Object.assign(n,function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||g,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=d({viewport:e.viewport,center:t.project_uCenter}),r=[],a=v({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice(),o=0;o0?n["shadow_uShadowMap[".concat(f,"]")]=e.shadowMaps[f]:n["shadow_uShadowMap[".concat(f,"]")]=e.dummyShadowMaps[0];return n}(e,t)):Object.assign(n,{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}),n}return{}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(164),g=n(171),p=function(e){function t(e){return r()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:v.a})))}return h()(t,e),o()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.a})}}]),t}(d.a);p.displayName="MapView"},function(e,t,n){"use strict";n.d(t,"a",function(){return O});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(87),p=n.n(g),m=n(45),y=n(27),b=n(199),_=n(47),x=n(18),w="Illegal argument to WebMercatorViewport",O=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,O=void 0!==w&&w,P=n.width,S=n.height,j=n.altitude,k=void 0===j?1.5:j;P=P||1,S=S||1,k=Math.max(.75,k);var C=Object(y.e)({width:P,height:S,pitch:d,altitude:k,nearZMultiplier:b,farZMultiplier:x}),E=C.fov,A=C.aspect,T=C.focalDistance,M=C.near,L=C.far,I=Object(y.f)({height:S,pitch:d,bearing:g,altitude:k}),R=Object.assign({},n,{width:P,height:S,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:O,fovyRadians:E,aspect:A,orthographicFocalDistance:T,near:M,far:L});return(e=l()(this,h()(t).call(this,R))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=k,e.orthographic=O,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);O.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(77),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(18),l=n(189),f=n(41),h=n.n(f),d=n(129),v=n(99),g=n(15),p=n(75),m=n(267),y=n(45),b=n(69),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,mousePosition:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l.a({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(83),p=n(136),m=n(22),y=n(29);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(83),v=n(128),g=n(81),p=n(82),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(16),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(13),v=n.n(d),g=n(7),p=n.n(g),m=n(43),y=n(18),b=n(72),_=n(75),x=[],w=[[0,1/0]];var O=n(15),P=n(126),S=n(104),j=n(59),k=n(67),C=n(26),E=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(k.c)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(P.b)(t,S.a.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a),this._setAccessor(e);for(var o=this.elementOffset,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({offset:n.offset,stride:n.stride,normalized:n.normalized},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,T,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"delete",value:function(){v()(h()(t.prototype),"delete",this).call(this),A.a.release(this.userData.allocatedValue)}},{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;if(t.update){Object(y.a)(Number.isFinite(e));var n=Math.max(e,1),i=L(this.type||5126),r=t.allocatedValue,a=t.updateRanges!==w;return this.constant=!1,this.value=A.a.allocate(r,n,{size:this.size,type:i,padding:this.elementOffset,copy:a}),this.buffer&&this.buffer.byteLength=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return n+e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(E);function L(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}var I=n(223);function R(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.a){var l=new Float32Array(r),f=t.getData({}),h=n.size,d=n.constant,v=d?n.getValue():n.getBuffer().getData({}),g=d?function(e,t){return c(v,t)}:function(e,t){return c(v.subarray(e,e+h),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.offset,a=void 0===r?0:r,o=e.getData,s=e.sourceLayout,u=e.targetLayout;if(!Array.isArray(u))return R({source:t,target:n,getData:o}),n;for(var c=a,l=a,f=o&&function(e,t){return o(e+l,t)},h=Math.min(s.length,u.length),d=0;d0),this.needsRedraw=!0;var n=Object.assign({},U,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return H});function G(){}var W={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;O.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;W.savedMessages=[],W.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;W.savedMessages&&W.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-W.timeStart),a="".concat(r,"ms");O.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=W.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;O.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}O.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),W.savedMessages=null}},H=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new V(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(W.onLog=t||G),void 0!==n&&(W.onUpdateStart=n||G),void 0!==i&&(W.onUpdate=i||G),void 0!==r&&(W.onUpdateEnd=r||G)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in W.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h]||t.attributes&&t.attributes[h])||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&W.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&O.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new M(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),O.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&W.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);W.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(129),y=n(191),b=n(93),_=n(229),x=n.n(_),w=n(15),O=n(67),P=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(O.c)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;w.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:j},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:j},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=r.extensionsChanged;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new P({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);w.layerName="ScatterplotLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(22),p=n(83),m=n(136),y=n(153),b=n(55),_=85.05113,x=-85.05113;var w=n(18),O=n(81),P=n(82);n.d(t,"a",function(){return A});var S={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new O.a,transitionInterruption:P.a.BREAK},j={transitionDuration:0},k={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},C={pitch:0,bearing:0,altitude:1.5},E=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?C.bearing:c,d=n.pitch,v=void 0===d?C.pitch:d,g=n.altitude,p=void 0===g?C.altitude:g,m=n.maxZoom,y=void 0===m?k.maxZoom:m,b=n.minZoom,_=void 0===b?k.minZoom:b,x=n.maxPitch,O=void 0===x?k.maxPitch:x,P=n.minPitch,S=void 0===P?k.minPitch:P,j=n.startPanLngLat,E=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,M=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:O,minPitch:S})))._interactiveState={startPanLngLat:j,startZoomLngLat:E,startBearing:A,startPitch:T,startZoom:M},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,E,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return S}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,j,{isDragging:!0,isRotating:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(15),u=n(6),c=n.n(u),l=n(3),f=n.n(l),h=n(13),d=n.n(h),v=n(7),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(102).a),m=n(182),y=n(183),b=n(149),_=n(60);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h,pixelRatio:this.pixelRatio}),m=this.lastPostProcessEffect?this.screenBuffer:_.a.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.a(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.a(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.a.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(34),r=n(174);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(89))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(34);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(89))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(126),f=n(104),h=n(30),d=n(19),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(h.d)(e),i=Object(l.c)(e,f.a.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Object(d.a)(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(s.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(22),u=n(18),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(35),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(102),p=n(70),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.a)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";function i(e){return e&&"undefined"!=typeof window?window.devicePixelRatio:1}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(132),c=n(47),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,r=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,r=void 0===n?16:n,a=t.size,o=void 0===a?1:a,s="[",u=0;u0&&(s+=",".concat(u%o==0?" ":"")),s+=i(e[u],t);var c=e.length>r?"...":"]";return"".concat(s).concat(c)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return r?"0":"0.";if(r)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var a=e.toPrecision(2);return a.indexOf(".0")===a.length-2?a.slice(0,-1):a}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var i=n(114),r="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var a={name:"gouraud-lighting",dependencies:[i.a],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:u},o={name:"phong-lighting",dependencies:[i.a],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:u},s={};function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor.map(function(e){return e/255}),t}(t):{lighting_uEnabled:!1}}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(4),r=n(5),a=n(61),o=n(196),s=n(19),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Object(s.a)(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new a.c(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new a.a(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Object(s.a)(this._compareContexts(e,this.gl)),Object(s.a)("string"==typeof t.vs),Object(s.a)("string"==typeof t.fs),Object(s.a)("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new o.a(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(36),r=n(4),a=n(10),o=n(9),s=n(11),u=n(58),c=n(67),l=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]),f=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]),h=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]),d=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]),v={POSITION:{size:3,value:new Float32Array(f)},NORMAL:{size:3,value:new Float32Array(h)},TEXCOORD_0:{size:2,value:new Float32Array(d)}},g=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.id,s=void 0===n?Object(c.c)("cube-geometry"):n;return Object(a.a)(this,Object(o.a)(t).call(this,Object(i.a)({},e,{id:s,indices:{size:1,value:new Uint16Array(l)},attributes:Object(i.a)({},v,e.attributes)})))}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(11),u=n(127),c={ambient:.35,diffuse:.6,shininess:32,specularColor:[30,30,30]},l=function(e){function t(e){var n;return Object(i.a)(this,t),n=Object(r.a)(this,Object(a.a)(t).call(this,e)),e=Object.assign({},c,e),Object.assign(Object(o.a)(n),e),n}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(129),p=n(15),m=n(75),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){h()(l()(t.prototype),"setState",this).call(this,e),this.setLayerNeedsUpdate()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?Object.assign(t,{object:n.__source.object,index:n.__source.index}):t}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerRow",value:function(e,t,n){return e.__source={parent:this,object:t,index:n},e}},{key:"getSubLayerAccessor",value:function(e){if("function"==typeof e){var t={data:this.props.data,target:[]};return function(n,i){return n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,i)}}return e}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,f=t.coordinateOrigin,h=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,g=t.extensions,p=t._subLayerProps,m={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:v,extensions:g};if(e){var y=p&&p[e.id],b=y&&y.updateTriggers;Object.assign(m,e,y,{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers,b)})}var _=!0,x=!1,w=void 0;try{for(var O,P=g[Symbol.iterator]();!(_=(O=P.next()).done);_=!0){var S=O.value,j=S.getSubLayerProps.call(this,S);Object.assign(m,j,{updateTriggers:Object.assign(m.updateTriggers,j.updateTriggers)})}}catch(e){x=!0,w=e}finally{try{_||null==P.return||P.return()}finally{if(x)throw w}}return m}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?p.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,p.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(g.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(165),l=n(18),f=n(105),h=n(53),d=n(45),v=n(15),g=n(75),p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return u()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i={x:e[0],y:e[1]},r=n.length-1;r>=0;--r){var a=n[r];if(a.containsPixel(i)){var o=e.slice();return o[0]-=a.x,o[1]-=a.y,a.unproject(o,t)}}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(l.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(g.b)(e,{filter:Boolean}).map(function(e){return e instanceof d.a?new h.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(f.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):v.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),m=n(163),y=n(148),b=new y.a,_=function(){function e(){o()(this,e),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return u()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(f.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e,this._createInternalEffects()}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=!0,o=!1,s=void 0;try{for(var u,c=this._internalEffects[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){u.value.cleanup()}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some(function(e){return e instanceof y.a})||this._internalEffects.push(b)}}]),e}(),x=n(103),w=n(172),O=n(60),P=n(80),S=n(183),j=n(182),k={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function C(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,h=-1,d=0,g=0;gf)d+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,h=d)}d+=4}}if(h>=0){var x=t[h+3]-1,w=t.slice(h,h+4),O=n[x];if(O){var P=O.decodePickingColor(w);return{pickedColor:w,pickedLayer:O,pickedObjectIndex:P}}v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return k}function E(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=A({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function A(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var T=function(){function e(t){o()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new j.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return u()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(S.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new O.a(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-(r+1)*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=A({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(l.a)(r),Object(l.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(l.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,u=r.y,c=r.width,f=r.height,h=new Uint8Array(c*f*4);return Object(P.e)(o,{sourceX:s,sourceY:u,sourceWidth:c,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight,o=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-o,c=Math.min(a,n+i+1)-s;return u<=0||c<=0?null:{x:o,y:s,width:u,height:c}}},{key:"callLayerPickingCallbacks",value:function(e,t){var n=[],i=this.pickingEvent;return e.forEach(function(e){if(e.layer){var r=!1;switch(t){case"hover":r=e.layer.onHover(e,i);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}}),n}}]),e}(),M=n(195),L=n(203),I=n(91),R=n(90),F=n(147),D=n(107),N=n(267),z=n(24),B=n(4),U=n(5),V=1,G=2,W=4,H={mousedown:V,mousemove:G,mouseup:W};var X,q,Z=null;"undefined"!=typeof document&&(Z=n(256),X=Z.PointerEventInput,q=X.prototype.handler,X.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&G&&0===e.which&&(t=W),this.pressed&&(t&W&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var Y=Z;var K=Y?[[Y.Rotate,{enable:!1}],[Y.Pinch,{enable:!1}],[Y.Swipe,{enable:!1}],[Y.Pan,{threshold:0,enable:!1}],[Y.Press,{enable:!1}],[Y.Tap,{event:"doubletap",taps:2,enable:!1}],[Y.Tap,{event:"anytap",enable:!1}],[Y.Tap,{enable:!1}]]:null,Q={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},J={doubletap:["tap"]},$={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ee=["keydown","keyup"],te=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],ne=["wheel","mousewheel","DOMMouseScroll"],ie={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",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"},re={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ae=n(119),oe=-1!==ae.b.indexOf("firefox"),se=ne,ue=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=se.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!ae.a&&{passive:!1})})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;ae.c.WheelEvent&&(oe&&e.deltaMode===ae.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=ae.c.devicePixelRatio),e.deltaMode===ae.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ce=te,le=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=ce.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),fe=ee,he=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=fe.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),de=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(U.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ve=1,ge=2,pe=4,me={pointerdown:ve,pointermove:ge,pointerup:pe,mousedown:ve,mousemove:ge,mouseup:pe},ye=1,be=2,_e=3,xe=0,we=1,Oe=2,Pe=1,Se=2,je=4;var ke=function(){function e(t){Object(B.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(U.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(B.a)(this,e),this.options=Object.assign({},Ce,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(U.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||K}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(Q).forEach(function(e){var n=t.manager.get(e);n&&Q[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new ue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new le(e,this._onOtherEvent,{enable:!1}),this.keyInput=new he(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new de(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(z.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=J[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=re[e]||e,o=r.get(a);o||(o=new ke(this),r.set(a,o),o.recognizerName=ie[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=re[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=$[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),Ae=n(31);function Te(){}n.d(t,"a",function(){return Le});var Me={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:Te,onResize:Te,onViewStateChange:Te,onBeforeRender:Te,onAfterRender:Te,onLoad:Te,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Le=function(){function e(t){o()(this,e),t=Object.assign({},Me,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),function(){if(void 0===("undefined"==typeof window?"undefined":r()(window)))return!1;return-1!==((window.navigator||{}).userAgent||"").indexOf("Trident/")}()&&v.a.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new N.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return u()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&v.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&v.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(l.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new L.a({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(I.a)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new m.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.callback=this.props.onHover,t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(R.a)(e,{enable:!0,copyState:!0})),Object(F.a)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new Ee(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Ae.b)this.eventManager.on(t,this._onEvent);this.viewManager=new p({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(l.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new c.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new _,this.deckRenderer=new w.a(e),this.deckPicker=new T(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(F.a)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),v.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=Ae.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){this.stats.get("frameRate").timeEnd(),this.stats.get("frameRate").timeStart();var e=this.animationLoop.stats;this.stats.get("GPU Time").addTime(e.get("GPU Time").lastTiming),this.stats.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){this.metrics.fps=this.stats.get("frameRate").getHz(),this.metrics.setPropsTime=this.stats.get("setProps Time").time,this.metrics.updateAttributesTime=this.stats.get("Update Attributes").time,this.metrics.framesRedrawn=this.stats.get("Redraw Count").count,this.metrics.pickTime=this.stats.get("pickObject Time").time+this.stats.get("pickMultipleObjects Time").time+this.stats.get("pickObjects Time").time,this.metrics.pickCount=this.stats.get("Pick Count").count,this.metrics.gpuTime=this.stats.get("GPU Time").time,this.metrics.cpuTime=this.stats.get("CPU Time").time,this.metrics.gpuTimePerFrame=this.stats.get("GPU Time").getAverageTime(),this.metrics.cpuTimePerFrame=this.stats.get("CPU Time").getAverageTime();var e=D.a.get("Memory Usage");this.metrics.bufferMemory=e.get("Buffer Memory").count,this.metrics.textureMemory=e.get("Texture Memory").count,this.metrics.renderbufferMemory=e.get("Renderbuffer Memory").count,this.metrics.gpuMemory=e.get("GPU Memory").count}}]),e}();Le.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(x.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Le.defaultProps=Me,Le.VERSION=M.a.VERSION},function(e,t,n){"use strict";var i=n(109),r=n(131),a=n(204),o=n(188),s=n(205),u={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n} geometry;\n",fs:"\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n"},c=n(84),l={name:"project32",dependencies:[c.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"};function f(){Object(i.c)([a.a,c.a,l,o.a,o.b,s.a]),Object(i.e)([u,c.a]),Object(r.c)("vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)"),Object(r.c)("fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"),Object(r.b)("picking",{hook:"fs:DECKGL_FILTER_COLOR",order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n"})}n.d(t,"a",function(){return f})},function(e,t,n){"use strict";var i=n(116),r=n(121),a=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],o=(r.a&&r.d,!r.a&&r.b,r.e,{extensions:a,loadAndParse:r.c}),s=n(108),u=n(15);var c={name:"JSON",extensions:["json","geojson"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},l=n(194),f="7.2.0-beta.2";if(s.a.deck&&s.a.deck.VERSION!==f)throw new Error("deck.gl - multiple versions detected: ".concat(s.a.deck.VERSION," vs ").concat(f));s.a.deck||(u.a.log(0,"deck.gl ".concat(f," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),s.a.deck=s.a.deck||{VERSION:f,version:f,log:u.a},Object(i.b)([c,o]),Object(l.a)());t.a=s.a.deck},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(32),s=n(9),u=n(66),c=n(11),l=n(52),f=n(56),h=n(60),d=n(74),v=n(61),g=n(59),p=n(30),m=n(73),y=function(){function e(t){Object(i.a)(this,e),this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}return Object(r.a)(e,[{key:"getAttributeInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var t=this.getAttributeInfo(e);return t?t.location:-1}},{key:"getAttributeAccessor",value:function(e){var t=this.getAttributeInfo(e);return t?t.accessor:null}},{key:"getVaryingInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var t=this.getVaryingInfo();return t?t.location:-1}},{key:"getVaryingAccessor",value:function(e){var t=this.getVaryingInfo();return t?t.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var t=e.gl,n=t.getProgramParameter(e.handle,35721),i=0;i=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(Object(p.d)(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(s.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",P),n._isCached=!1,n.initialize(r),Object.seal(Object(o.a)(n)),n._setId(r.id),n}return Object(c.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new v.c(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new v.a(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,Object(x.a)(this.vs instanceof v.c),Object(x.a)(this.fs instanceof v.a),this.uniforms={},i&&(Object(p.a)(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new y(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,f=void 0!==l&&l,h=e.indexType,d=void 0===h?5123:h,v=e.isInstanced,g=void 0!==v&&v,y=e.instanceCount,O=void 0===y?0:y,P=e.vertexArray,S=void 0===P?null:P,j=e.transformFeedback,k=e.framebuffer,C=e.parameters,E=void 0===C?{}:C,A=e.uniforms,T=e.samplers;if((A||T)&&(w.a.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(A||{})),void 0!==n){var M=k?k.id:"default",L="mode=".concat(Object(_.a)(this.gl,r)," verts=").concat(a," ")+"instances=".concat(O," indexType=").concat(Object(_.a)(this.gl,d)," ")+"isInstanced=".concat(g," isIndexed=").concat(f," ")+"Framebuffer=".concat(M);w.a.log(n,L)()}return Object(x.a)(S),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(S.bindForDraw(a,O,function(){if(void 0!==k&&(E=Object.assign({},E,{framebuffer:k})),j){var e=Object(m.c)(r);j.begin(e)}t._bindTextures(),Object(b.a)(t.gl,E,function(){f&&g?t.gl.drawElementsInstanced(r,a,d,s,O):f&&Object(p.d)(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):f?t.gl.drawElements(r,a,d,s):g?t.gl.drawArraysInstanced(r,s,a,O):t.gl.drawArrays(r,s,a)}),j&&j.end()}),!0)}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=!1,i={};for(var r in e)Object(d.a)(this.uniforms[r],e[r])||(n=!0,i[r]=e[r],this.uniforms[r]=Object(d.c)(e[r]));return n&&(t(),Object(d.b)(i,this.id,this._uniformSetters),this._setUniforms(i)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof h.a)i=i.texture;if(i instanceof f.a)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof h.a&&(n=n.texture),n instanceof f.a)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof h.a&&(n=n.texture),n instanceof f.a){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new v.c({handle:u});break;case 35632:n.fs=new v.a({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Object(O.c)(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),w.a.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),w.a.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||w.a.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1)for(var s=0;s0&&w[1]>0);var O=w[0]/x[0],P=w[1]/x[1],S=(u.right-u.left)/2/O,j=(u.bottom-u.top)/2/P,k=[(_[0]+b[0])/2+S,(_[1]+b[1])/2+j],C=y.unproject(k),E=y.zoom+Math.log2(Math.abs(Math.min(O,P)));return{longitude:C[0],latitude:C[1],zoom:E}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(24),r=n(4),a=n(5),o=n(22),s=n(29),u=n(40),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.g(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(43),f=n(30),h=n(67),d=n(26),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(f.a)(e),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(f.d)(e)}}]),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(h.a)(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,d.a.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof l.a==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(4),r=n(5),a=n(59),o=n(43),s=n(106),u=n(235),c=n(26),l=n(19),f=/^(.+)__LOCATION_([0-9]+)$/,h=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=s.a.isSupported(t)?new s.a(t):s.a.getDefaultArray(t),Object(u.a)(this,"VertexArray","v6.0",h),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new o.a(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof o.a){var a=n;if(r){var s=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,s)}else{var u=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,u)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c.a.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(34),r=n(50),a=n.n(r),o=n(115),s=n(4),u=n(5),c=n(91),l=n(107),f=n(124),h=n(176),d=n(134),v=n(30),g=n(65),p=n(60),m=n(26),y=n(19),b=0,_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e);var n=t.onCreateContext,i=void 0===n?function(e){return Object(c.a)(e)}:n,r=t.onAddHTML,a=void 0===r?null:r,o=t.onInitialize,u=void 0===o?function(){}:o,f=t.onRender,h=void 0===f?function(){}:f,d=t.onFinalize,v=void 0===d?function(){}:d,g=t.gl,p=void 0===g?null:g,y=t.glOptions,_=void 0===y?{}:y,x=t.debug,w=void 0!==x&&x,O=t.createFramebuffer,P=void 0!==O&&O,S=t.autoResizeViewport,j=void 0===S||S,k=t.autoResizeDrawingBuffer,C=void 0===k||k,E=t.stats,A=void 0===E?l.a.get("animation-loop-".concat(b++)):E,T=t.useDevicePixels,M=void 0===T||T;"useDevicePixelRatio"in t&&(m.a.deprecated("useDevicePixelRatio","useDevicePixels")(),M=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:a,onInitialize:u,onRender:h,onFinalize:v,gl:p,glOptions:_,debug:w,createFramebuffer:P},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=A,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:j,autoResizeDrawingBuffer:C,useDevicePixels:M}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(u.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Object(y.a)("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,Object(f.b)().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=h.a.isSupported(e.gl,["timers"])?new h.a(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),Object(d.a)(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(o.a)(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return m.a.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;Object(d.a)(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||Object(d.b)(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(i.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Object(c.c)(this.props.gl,e):this.onCreateContext(e),!Object(v.c)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(g.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Object(c.d)(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new p.a(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()&&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}}]),e}()},function(e,t,n){"use strict";t.a={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}},function(e,t,n){"use strict";var i={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};t.a={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}}},function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(0),r=n(43),a=n(68),o=n(73),s=n(186);function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=c(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),f=t.accessors[s.location];f&&(u="".concat(o,": ").concat(l(s.name,f))),r[u]=c(t,a[o],f,i)}}return r}function c(e,t,n,o){var u,c,l,f,h=e.gl,d="NOT PROVIDED",v="N/A",g="N/A",p="N/A";if(n&&(d=n.type,v=n.size,c=-1!==(d=String(d).replace("Array","")).indexOf("nt")),t instanceof r.a){var m,y,b=t,_=b.getDebugData(),x=_.data;if(l=_.modified?"*":"",f=x,g=(p=b.byteLength)/x.BYTES_PER_ELEMENT/v,n){var w=n.divisor>0;y="".concat(w?"I ":"P "," ").concat(g," (x").concat(v,"=").concat(p," bytes ").concat(Object(a.a)(h,d),")")}else c=!0,y="".concat(p," bytes");return m={},Object(i.a)(m,o,"".concat(l).concat(Object(s.a)(f,{size:v,isInteger:c}))),Object(i.a)(m,"Format ",y),m}return f=t,v=t.length,c=-1!==(d=String(t.constructor.name).replace("Array","")).indexOf("nt"),u={},Object(i.a)(u,o,"".concat(Object(s.a)(f,{size:v,isInteger:c})," (constant)")),Object(i.a)(u,"Format ","".concat(v,"x").concat(d," (constant)")),u}function l(e,t){var n=t.type,i=t.size,r=Object(o.b)(n,i);return r?"".concat(e," (").concat(r.name,")"):e}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(0),r=n(19),a=n(186);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,o=e.program,u=e.uniforms,c=e.undefinedOnly,l=void 0!==c&&c;Object(r.a)(o);var f=o._uniformSetters,h={},d=Object.keys(f).sort(),v=0,g=!0,p=!1,m=void 0;try{for(var y,b=d[Symbol.iterator]();!(g=(y=b.next()).done);g=!0){var _=y.value;_.match(".*_.*")||_.match(".*Matrix")||s({table:h,header:n,uniforms:u,uniformName:_,undefinedOnly:l})&&v++}}catch(e){p=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(p)throw m}}var x=!0,w=!1,O=void 0;try{for(var P,S=d[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;j.match(".*Matrix")&&s({table:h,header:n,uniforms:u,uniformName:j,undefinedOnly:l})&&v++}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}var k=!0,C=!1,E=void 0;try{for(var A,T=d[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h[M]||s({table:h,header:n,uniforms:u,uniformName:M,undefinedOnly:l})&&v++}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}var L=0,I={};if(!l)for(var R in u){var F=u[R];h[R]||(L++,I[R]=Object(i.a)({Type:"NOT USED: ".concat(F)},n,Object(a.a)(F)))}return{table:h,count:v,unusedTable:I,unusedCount:L}}function s(e){var t,n=e.table,r=e.header,o=e.uniforms,s=e.uniformName,u=e.undefinedOnly,c=o[s],l=function(e){return null!=e}(c);return(!u||!l)&&(n[s]=(t={},Object(i.a)(t,r,l?Object(a.a)(c):"N/A"),Object(i.a)(t,"Uniform Type",l?c:"NOT PROVIDED"),t),!0)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(0),r=n(73);function a(e){var t={},n="Accessors for ".concat(e.id),r=!0,a=!1,s=void 0;try{for(var u,c=e.attributeInfos[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var l=u.value;if(l){var f=o(l);t["in ".concat(f)]=Object(i.a)({},n,JSON.stringify(l.accessor))}}}catch(e){a=!0,s=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw s}}var h=!0,d=!1,v=void 0;try{for(var g,p=e.varyingInfos[Symbol.iterator]();!(h=(g=p.next()).done);h=!0){var m=g.value;if(m){var y=o(m);t["out ".concat(y)]=Object(i.a)({},n,JSON.stringify(m.accessor))}}}catch(e){d=!0,v=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw v}}return t}function o(e){var t=e.accessor,n=t.type,i=t.size,a=Object(r.b)(n,i);return a?"".concat(a.name," ").concat(e.name):e.name}},function(e,t,n){"use strict";function i(e){var t=100,n=e.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(25),r=n(4),a=n(5),o=n(10),s=n(9),u=n(66),c=n(11),l=n(64),f=n(26),h=n(92),d=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var i=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===i?[]:i;return f.a.assert(a.every(function(e){return e instanceof h.a}),"every child must an instance of ScenegraphNode"),(e=Object(o.a)(this,Object(s.a)(t).call(this,n))).children=a,e}return Object(c.a)(t,e),Object(a.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new l.a:n,r=new l.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;f instanceof t?f.traverse(e,{worldMatrix:r}):e(f,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return f.a.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(h.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(66),u=n(11),c=n(93),l=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof c.a?(n.model=e,n._setModelNodeProps(r)):n.model=new c.a(e,r),n.managedResources=r.managedResources||[],n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return Object(s.a)(Object(o.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(n(92).a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(200),p=n(64),m=n(166);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(1),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(128),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,O=e.zoom,P=void 0===O?0:O;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:P}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(1),u=n.n(s),c=n(6),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(167),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(190),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.a}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(169).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(191),v=n(72),g=n(192),p=n(130),m=n(113),y=n(139),b=n(137),_=new d.a,x={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags),i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(i&&Array.isArray(n.dataChanged)){var r=this.state.paths.slice(),a=n.dataChanged.map(function(e){return Object(b.a)({data:r,getIndex:function(e){return e.__source.index},dataRange:e,replace:t._getPaths(e)})});this.setState({paths:r,pathsDiff:a})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.data,i=t.getPolygon,r=[],a="XY"===t.positionFormat?2:3,o=e.startRow,s=e.endRow,u=Object(v.a)(n,o,s),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var g,p=c[Symbol.iterator]();!(f=(g=p.next()).done);f=!0){var m=g.value;l.index++;var b=y.c(i(m,l),a),_=b.positions,x=b.holeIndices;if(x)for(var w=0;w<=x.length;w++){var O=_.subarray(x[w-1]||0,x[w]||_.length);r.push(this.getSubLayerRow({path:O},m,l.index))}else r.push(this.getSubLayerRow({path:_},m,l.index))}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}return r}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e._dataDiff,i=e.stroked,r=e.filled,a=e.extruded,o=e.wireframe,s=e.elevationScale,u=e.transitions,c=e.positionFormat,l=this.props,f=l.lineWidthUnits,h=l.lineWidthScale,d=l.lineWidthMinPixels,v=l.lineWidthMaxPixels,g=l.lineJointRounded,y=l.lineMiterLimit,b=l.lineDashJustified,_=this.props,x=_.getFillColor,w=_.getLineColor,O=_.getLineWidth,P=_.getLineDashArray,S=_.getElevation,j=_.getPolygon,k=_.updateTriggers,C=_.material,E=this.state,A=E.paths,T=E.pathsDiff,M=this.getSubLayerClass("fill",p.a),L=this.getSubLayerClass("stroke",m.a),I=this.shouldRenderSubLayer("fill",A)&&new M({_dataDiff:n,extruded:a,elevationScale:s,filled:r,wireframe:o,getElevation:S,getFillColor:x,getLineColor:w,material:C,transitions:u},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:k.getPolygon,getElevation:k.getElevation,getFillColor:k.getFillColor,getLineColor:k.getLineColor}}),{data:t,positionFormat:c,getPolygon:j});return[!a&&I,!a&&i&&this.shouldRenderSubLayer("stroke",A)&&new L({_dataDiff:T&&function(){return T},widthUnits:f,widthScale:h,widthMinPixels:d,widthMaxPixels:v,rounded:g,miterLimit:y,dashJustified:b,transitions:u&&{getWidth:u.getLineWidth,getColor:u.getLineColor,getPath:u.getPolygon},getColor:this.getSubLayerAccessor(w),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:k.getLineWidth,getColor:k.getLineColor,getDashArray:k.getLineDashArray}}),{data:A,positionFormat:c,getPath:function(e){return e.path}}),a&&I]}}]),t}(g.a);w.layerName="PolygonLayer",w.defaultProps=x},function(e,t,n){"use strict";var i="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",r={name:"project2",vs:i,fs:i},a=n(114);t.a={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[r,a.a]}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var r="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",a="".concat(r,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),o={ONE:1};t.a={name:"fp64",vs:a,fs:null,fp64ify:i,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var a=4*n+r;i(e[4*r+n],t,2*a)}return t},getUniforms:function(){return Object.assign({},o)}},"".concat(r)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(129),y=n(93),b=n(58);n.d(t,"a",function(){return w});var _=[0,0,0,255],x={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:_},getTargetColor:{type:"accessor",value:_},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n vec2 source = project_position(geometry.worldPosition, instancePositions64Low.xy).xy;\n vec2 target = project_position(geometry.worldPositionAlt, instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:_},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:_},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]);var O=u(x,d);c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);w.layerName="ArcLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(129),y=n(93),b=n(58);n.d(t,"a",function(){return x});var _={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.), target_commonspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),O=u(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]),c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);x.layerName="LineLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(192),v=n(170),g=n(113),p=n(191),m=n(130),y=n(137),b=n(15);function _(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},r=n.startRow,a=void 0===r?0:r,o=n.endRow,s=void 0===o?e.length:o,u=a;u0;)t=t[0];return t&&Number.isFinite(t[0])}(a,o))switch(a){case"Point":s.push(n({geometry:e},i,r));break;case"MultiPoint":o.forEach(function(e){s.push(n({geometry:{type:"Point",coordinates:e}},i,r))});break;case"LineString":u.push(n({geometry:e},i,r));break;case"MultiLineString":o.forEach(function(e){u.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"Polygon":c.push(n({geometry:e},i,r)),o.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"MultiPolygon":o.forEach(function(e){c.push(n({geometry:{type:"Polygon",coordinates:e}},i,r)),e.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))})})}else b.a.warn("".concat(a," coordinates are malformed"))()}var w={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return j});var O=new p.a,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:O};function S(e){return e.geometry.coordinates}var j=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){var t=e.props,n=e.changeFlags;if(n.dataChanged){var i=function(e){if(Array.isArray(e))return e;switch(b.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return b.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data),r=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var a=this.state.features,o={},s={};for(var u in a)o[u]=a[u].slice(),s[u]=[];var c=!0,l=!1,f=void 0;try{for(var h,d=n.dataChanged[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value,g=_(i,r,v);for(var p in a)s[p].push(Object(y.a)({data:o[p],getIndex:function(e){return e.__source.index},dataRange:v,replace:g[p]}))}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}this.setState({features:o,featuresDiff:s})}else this.setState({features:_(i,r),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var e=this.state,t=e.features,n=e.featuresDiff,i=t.pointFeatures,r=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures,s=this.props,u=s.stroked,c=s.filled,l=s.extruded,f=s.wireframe,h=s.material,d=s.transitions,p=this.props,y=p.lineWidthUnits,b=p.lineWidthScale,_=p.lineWidthMinPixels,x=p.lineWidthMaxPixels,w=p.lineJointRounded,O=p.lineMiterLimit,P=p.pointRadiusScale,j=p.pointRadiusMinPixels,k=p.pointRadiusMaxPixels,C=p.elevationScale,E=p.lineDashJustified,A=this.props,T=A.getLineColor,M=A.getFillColor,L=A.getRadius,I=A.getLineWidth,R=A.getLineDashArray,F=A.getElevation,D=A.updateTriggers,N=this.getSubLayerClass("polygons-fill",m.a),z=this.getSubLayerClass("polygons-stroke",g.a),B=this.getSubLayerClass("line-strings",g.a),U=this.getSubLayerClass("points",v.a),V=this.shouldRenderSubLayer("polygons-fill",a)&&new N({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:l,elevationScale:C,filled:c,wireframe:f,material:h,getElevation:this.getSubLayerAccessor(F),getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),transitions:d&&{getPolygon:d.geometry,getElevation:d.getElevation,getFillColor:d.getFillColor,getLineColor:d.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:D.getElevation,getFillColor:D.getFillColor,getLineColor:D.getLineColor}}),{data:a,getPolygon:S});return[!l&&V,!l&&u&&this.shouldRenderSubLayer("polygons-stroke",o)&&new z({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:o,getPath:S}),this.shouldRenderSubLayer("linestrings",r)&&new B({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:r,getPath:S}),this.shouldRenderSubLayer("points",i)&&new U({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:u,filled:c,radiusScale:P,radiusMinPixels:j,radiusMaxPixels:k,lineWidthUnits:y,lineWidthScale:b,lineWidthMinPixels:_,lineWidthMaxPixels:x,getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),getRadius:this.getSubLayerAccessor(L),getLineWidth:this.getSubLayerAccessor(I),transitions:d&&{getPosition:d.geometry,getFillColor:d.getFillColor,getLineColor:d.getLineColor,getRadius:d.getRadius,getLineWidth:d.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:D.getFillColor,getLineColor:D.getLineColor,getRadius:D.getRadius,getLineWidth:D.getLineWidth}}),{data:i,getPosition:S}),l&&V]}}]),t}(d.a);j.layerName="GeoJsonLayer",j.defaultProps=P},function(e,t,n){"use strict";var i,r=n(4),a=n(5),o=n(0),s=n(146),u=n(122),c=n(206),l=n(30),f=n(43),h=n(80),d=n(125),v=n(158),g=n(201),p=n(60),m=n(210),y=n(19),b=n(26),_=n(67),x=n(93),w="transform_uSampler_",O="transform_uSize_",P="transform_position";function S(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,c={},l=t,f={};if(a>0||i){var h=l.split("\n"),d=h.slice();if(h.forEach(function(e,t,r){if(a>0){var l=function(e,t){var n={},i=function(e){return Object(u.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(w).concat(e),n="".concat(O).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),c=s.samplerName,l=s.sizeName,f=s.uniformDeclerations,h=Object(u.e)(r),d=" ".concat(r," ").concat(a," = transform_getInput(").concat(c,", ").concat(l,").").concat(h,";\n");n[c]=a;var v={"vs:#decl":f,"vs:#main-start":d};return{updatedLine:o,inject:v,samplerTextureMap:n}}return null}(e,n);if(l){var h=l.updatedLine,v=l.inject;d[t]=h,f=Object(s.b)([f,v]),Object.assign(c,l.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(u.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Object(y.a)(r);var v="".concat(O).concat(i),g={"vs:#decl":"uniform vec2 ".concat(v,";\n"),"vs:#main-start":" vec2 ".concat(P," = transform_getPos(").concat(v,");\n gl_Position = vec4(").concat(P,", 0, 1.);\n")};f=Object(s.b)([f,g])}l=d.join("\n")}return{vs:l,targetTextureType:o,inject:f,samplerTextureMap:c}}n.d(t,"a",function(){return k});var j=(i={},Object(o.a)(i,10241,9728),Object(o.a)(i,10240,9728),Object(o.a)(i,10242,33071),Object(o.a)(i,10243,33071),i),k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,e),Object(y.a)(Object(l.d)(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this.resources={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(a.a)(e,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(a.a)(e,[{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof f.a?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Object(y.a)(!n||n===this.targetTextureVarying);var o=Object(h.e)(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,c=Object(u.d)(this.targetTextureType),l=new s(o.length*c/4),f=0,d=0;d0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,s=this.framebuffers[this.currentIndex],Object(y.a)(s),r.viewport=[0,0,s.width,s.height],o&&s.clear({color:!0})),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){b.a.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Object(y.a)(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Object(y.a)(r[o]instanceof f.a||r[o].buffer instanceof f.a);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(j)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Object(y.a)(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(b.a.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(b.a.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,h=e._swapTexture;for(var v in Object(y.a)(a&&(s||n||c)&&o),t||{})Object(y.a)(t[v]instanceof f.a||t[v].buffer instanceof f.a);for(var g in u||{})Object(y.a)(u[g]instanceof d.a);return Object(y.a)(!c||l),Object(y.a)(!h||u[h]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n,0);Object(y.a)(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e,t){var n;if(e instanceof d.a)return e;var i=this.sourceTextures[0][e];if(!i)return null;this._targetRefTexName=e;var r=Object(v.a)(i,{parameters:(n={},Object(o.a)(n,10241,9728),Object(o.a)(n,10240,9728),Object(o.a)(n,10242,33071),Object(o.a)(n,10243,33071),n),pixelStore:Object(o.a)({},37440,!1)}),a="target-texture-".concat(t);return this.resources[a]&&this.resources[a].delete(),this.resources[a]=r,r}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=this._createNewBuffer(r,{byteLength:o,usage:s,accessor:u});this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new f.a(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=n,n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Object(y.a)(this.feedbackBuffers[t][i]instanceof f.a))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new x.a(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){Object(_.a)(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=this._createNewBuffer("elementIDBuffer",{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,l=Object(s.b)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:e._fs||Object(u.b)({version:Object(m.a)(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[c.a].concat(e.modules||[]):e.modules,uniforms:i,inject:l,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return S({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}()},function(e,t,n){"use strict";(function(e){var i=n(34);t.a="undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==Object(i.a)(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(89))},function(e,t,n){var i=n(255);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";(function(e,i){n.d(t,"a",function(){return a});var r=n(180),a="object"!==(void 0===e?"undefined":Object(r.a)(e))||"[object process]"!==String(e)||e.browser;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document}).call(this,n(89),n(78))},function(e,t){e.exports=function(e){var t;if("function"==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(38),a=n.n(r),o=n(120);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(89))},function(e,t,n){var i=n(8);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===S(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(O(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),O(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),O(i),O(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details - */r=[],void 0===(a="function"==typeof(i=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},i={};function r(e,t){var r,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=i[e])?a:(r=o(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(a=n[e])?a:(r=o(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:v;if(t){if(e<0)return g;if(e>=f)return _}else{if(e<=-h)return x;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,n,i){return new e(t,n,i)}e.fromInt=r,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(s(n,8)),o=v,c=0;c>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(p)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,v=0;return d+=(v+=a+(65535&e.low))>>>16,h+=(d+=r+l)>>>16,f+=(h+=i+u)>>>16,f+=n+s,o((d&=65535)<<16|(v&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(t(e)||(e=c(e)),e.isZero())return v;if(this.eq(x))return e.isOdd()?x:v;if(e.eq(x))return this.isOdd()?x:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,y=0;return m+=(y+=s*h)>>>16,p+=(m+=r*h)>>>16,m&=65535,p+=(m+=s*f)>>>16,g+=(p+=i*h)>>>16,p&=65535,g+=(p+=r*f)>>>16,p&=65535,g+=(p+=s*l)>>>16,g+=n*h+i*f+r*l+s*u,o((m&=65535)<<16|(y&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:v;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;r=g}else{if(this.eq(x))return e.eq(p)||e.eq(y)?x:e.eq(x)?p:(n=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?p:y:(i=this.sub(e.mul(n)),r=n.add(i.div(e)));if(e.eq(x))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=v}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(n),f=l.mul(e);f.isNegative()||f.gt(i);)f=(l=a(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=p),r=r.add(l),i=i.sub(f)}return r},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;return e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?i.apply(t,r):i)||(e.exports=a)},function(e,t,n){const i=n(162);Object.assign(i,n(57),n(181),n(183),n(185),n(182),n(186),n(184)),e.exports=i},,function(e,t,n){(function(t){const i=n(1),r=n(19),a=n(178).default,o="undefined"==typeof window?t:window;o.deck=o.deck||{},o.luma=o.luma||{},Object.assign(o.deck,r,{DeckGL:a}),Object.assign(o.luma,i),e.exports=o.deck}).call(this,n(56))},function(e,t){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var i=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(166),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=_;var f="suspendedStart",h="suspendedYield",d="executing",v="completed",g={},p={};p[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==i&&r.call(y,o)&&(p=y);var b=P.prototype=w.prototype=Object.create(p);O.prototype=b.constructor=P,P.constructor=O,P[u]=O.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===O||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,P):(e.__proto__=P,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},S(k.prototype),k.prototype[s]=function(){return this},l.AsyncIterator=k,l.async=function(e,t,n,i){var r=new k(_(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},S(b),b[u]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=T,A.prototype={constructor:A,reset:function(e){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(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;C(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:T(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function _(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new A(i||[]);return a._invoke=function(e,t,n){var i=f;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return L()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=j(o,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function O(){}function P(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function k(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function j(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,j(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; + */r=[],void 0===(a="function"==typeof(i=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},i={};function r(e,t){var r,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=i[e])?a:(r=o(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(a=n[e])?a:(r=o(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:v;if(t){if(e<0)return g;if(e>=f)return _}else{if(e<=-h)return x;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,n,i){return new e(t,n,i)}e.fromInt=r,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(s(n,8)),o=v,c=0;c>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(p)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,v=0;return d+=(v+=a+(65535&e.low))>>>16,h+=(d+=r+l)>>>16,f+=(h+=i+u)>>>16,f+=n+s,o((d&=65535)<<16|(v&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(t(e)||(e=c(e)),e.isZero())return v;if(this.eq(x))return e.isOdd()?x:v;if(e.eq(x))return this.isOdd()?x:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,y=0;return m+=(y+=s*h)>>>16,p+=(m+=r*h)>>>16,m&=65535,p+=(m+=s*f)>>>16,g+=(p+=i*h)>>>16,p&=65535,g+=(p+=r*f)>>>16,p&=65535,g+=(p+=s*l)>>>16,g+=n*h+i*f+r*l+s*u,o((m&=65535)<<16|(y&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:v;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;r=g}else{if(this.eq(x))return e.eq(p)||e.eq(y)?x:e.eq(x)?p:(n=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?p:y:(i=this.sub(e.mul(n)),r=n.add(i.div(e)));if(e.eq(x))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=v}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(n),f=l.mul(e);f.isNegative()||f.gt(i);)f=(l=a(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=p),r=r.add(l),i=i.sub(f)}return r},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;return e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?i.apply(t,r):i)||(e.exports=a)},function(e,t,n){"use strict";function i(e){for(var t in e)return!1;return!0}function r(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(26);function r(e,t,n){var r=n.removedProps,a=void 0===r?{}:r,o=n.deprecatedProps,s=void 0===o?{}:o,u=n.replacedProps,c=void 0===u?{}:u;for(var l in a)if(l in t){var f=a[l]?"".concat(e,".").concat(a[l]):"N/A";i.a.removed("".concat(e,".").concat(l),f)()}for(var h in s)if(h in t){var d=s[h];i.a.deprecated("".concat(e,".").concat(h),"".concat(e,".").concat(d))()}var v=null;for(var g in c)if(g in t){var p=c[g];i.a.deprecated("".concat(e,".").concat(g),"".concat(e,".").concat(p))(),(v=v||Object.assign({},t))[p]=t[g],delete v[g]}return v||t}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(26);function r(e,t,n,r){var a="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),o=Object.getPrototypeOf(e);r.forEach(function(e){o.methodName||(o[e]=function(){throw i.a.removed("Calling removed method ".concat(t,".").concat(e,": "),a)(),new Error(e)})})}},function(e,t,n){"use strict";var i=n(34),r=n(25),a=n(0),o=n(4),s=n(5),u=n(96);var c=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var f={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(e){return"string"==typeof e?f[e.toUpperCase()]||f.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(86);n.d(t,"a",function(){return b});var g={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!1,priority:0};function m(){}var y={};var b=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(243)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var f=new Image;return f.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(f,i,o)))},f.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=h(a),r="[".concat(a,"m").concat(r,"")),o&&(a=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();b.VERSION=u.a},function(e,t,n){const i=n(242);Object.assign(i,n(79),n(261),n(263),n(266),n(262),n(265),n(264)),e.exports=i},,,,,function(e,t,n){(function(t){const i=n(17),r=n(21),a=n(258).default,o="undefined"==typeof window?t:window;o.deck=o.deck||{},o.luma=o.luma||{},Object.assign(o.deck,r,{DeckGL:a}),Object.assign(o.luma,i),e.exports=o.deck}).call(this,n(78))},function(e,t){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var i=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(246),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=_;var f="suspendedStart",h="suspendedYield",d="executing",v="completed",g={},p={};p[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==i&&r.call(y,o)&&(p=y);var b=P.prototype=w.prototype=Object.create(p);O.prototype=b.constructor=P,P.constructor=O,P[u]=O.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===O||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,P):(e.__proto__=P,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},S(j.prototype),j.prototype[s]=function(){return this},l.AsyncIterator=j,l.async=function(e,t,n,i){var r=new j(_(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},S(b),b[u]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=T,A.prototype={constructor:A,reset:function(e){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(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:T(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function _(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new A(i||[]);return a._invoke=function(e,t,n){var i=f;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return M()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function O(){}function P(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function j(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function k(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,k(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; /*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * @@ -14,4 +14,4 @@ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ -!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),f="function",h=Math.round,d=Math.abs,v=Date.now;function g(e,t,n){return setTimeout(w(e,n),t)}function p(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function C(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function M(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==B&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(f=o.pointers,h=i,oe(h[0],h[1],$)/oe(f[0],f[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>z||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,f=re(u,c,l);i=f.x,r=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var f,h;var g=e.element;j(t.srcEvent.target,g)&&(g=t.srcEvent.target);t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?q:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(F(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(F(this.element),this.evWin,this.domHandler)}};var ue={mousedown:B,mousemove:U,mouseup:V},ce="mousedown",le="mousemove mouseup";function fe(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(fe,ee,{handler:function(e){var t=ue[e.type];t&B&&0===e.button&&(this.pressed=!0),t&U&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:B,pointermove:U,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",ge="pointermove pointerup pointercancel";function pe(){this.evEl=ve,this.evWin=ge,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",ge="MSPointerMove MSPointerUp MSPointerCancel"),x(pe,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=he[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=A(t,e.pointerId,"pointerId");r&B&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:B,touchmove:U,touchend:V,touchcancel:G},ye="touchstart",be="touchstart touchmove touchend touchcancel";function _e(){this.evTarget=ye,this.evWin=be,this.started=!1,ee.apply(this,arguments)}x(_e,ee,{handler:function(e){var t=me[e.type];if(t===B&&(this.started=!0),this.started){var n=function(e,t){var n=T(e.touches),i=T(e.changedTouches);t&(V|G)&&(n=L(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:B,touchmove:U,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Oe(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Oe,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=T(e.touches),i=this.targetIds;if(t&(B|U)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=T(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return j(e.target,u)}),t===B)for(r=0;r-1&&i.splice(e,1)},Pe)}}x(ke,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,je.call(this,t)):e&(V|G)&&je.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Be&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return qe.prototype.attrTest.call(this,e)&&(this.state&Ne||!(this.state&Ne)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ye,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Le]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ne)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Ke,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&B)this.reset(),this._timer=g(function(){this.state=Ue,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ue;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ue&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Qe,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Le]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ne)}}),x(Je,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|K)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;k(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:E(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){var i=n(4);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=i(e)););return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return o});var i=n(153),r=n(135);const a={position:"absolute",left:0,top:0,width:"100%",height:"100%"};class o extends r.a{constructor(e={}){if("undefined"==typeof document)throw Error("Deck can only be used in the browser");const{mapCanvas:t,deckCanvas:n}=function(e){let{container:t=document.body}=e;if("string"==typeof t&&(t=document.getElementById(t)),!t)throw Error("Deck: container not found");"static"===window.getComputedStyle(t).position&&(t.style.position="relative");const n=document.createElement("div");t.appendChild(n),Object.assign(n.style,a);const i=document.createElement("canvas");return t.appendChild(i),Object.assign(i.style,a),{container:t,mapCanvas:n,deckCanvas:i}}(e),r=e.initialViewState||function(e){if(!e.viewState&&"latitude"in e&&"longitude"in e&&"zoom"in e){const{latitude:t,longitude:n,zoom:i,pitch:r=0,bearing:a=0}=e;return{latitude:t,longitude:n,zoom:i,pitch:r,bearing:a}}return e.viewState}(e),o=Number.isFinite(r.latitude),{map:s=window.mapboxgl,controller:u=!0}=e;super(Object.assign({},e,{width:"100%",height:"100%",canvas:n,controller:u,initialViewState:r})),s&&s.Map?this._map=o&&new i.a(Object.assign({},e,{viewState:r,container:t,mapboxgl:s})):this._map=s,this._onBeforeRender=(e=>{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(180);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(19),p=n(53),m=n(14),y=n(112),b=n(85),_=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function x(e,t,n){if(Number.isFinite(e[0]))return e;var i=new t(4*e.length);return e.forEach(function(e,t){var r=4*t;i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=Number.isFinite(e[3])?e[3]:n}),i}var w,O=n(9),P=n.n(O),S=n(17),k=n.n(S),j=n(1),E=n(109),C=n(24),A={SUM:1,MEAN:2,MIN:3,MAX:4};function T(e,t){return e+t}function L(e,t){return t>e?t:e}function M(e,t){return t2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(j.isWebGL2)(t)&&Object(j.hasFeatures)(this.gl,j.FEATURES.BLEND_EQUATION_MINMAX,j.FEATURES.COLOR_ATTACHMENT_RGBA32F,j.FEATURES.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.info("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,Z){var r=Z[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},R,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,F)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||V,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},U,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,f=0;f=0&&P=0&&S0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new j.Model(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n pos = floor(pos / cellSize);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?[E.a]:["project32"],shaderCache:n,vertexCount:0,drawMode:0})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new j.Model(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:[j.fp64],shaderCache:t,vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new j.Transform(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,h=a.weights,d=[o,s],v={blend:!0,depthTest:!1,blendFunc:[1,1]},g={viewport:n},p={windowSize:u,cellSize:t,gridSize:d,uProjectionMatrix:i,uProjectionMatrixFP64:X(i),projectPoints:r};for(var m in h){var y=h[m],b=y.needMin,_=y.needMax,x=b&&_&&h[m].combineMaxMin;this.renderToWeightsTexture({id:m,parameters:v,moduleSettings:g,uniforms:p,gridSize:d}),x?this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:z}),gridSize:d,minOrMaxFb:c[m],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:x}):(b&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:D}),gridSize:d,minOrMaxFb:l[m],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:x}),_&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:N}),gridSize:d,minOrMaxFb:f[m],combineMaxMin:x}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(j.withParameters)(c,s,function(){c.clear(16384)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,f=this.gl,h=this.gridAggregationModel,d=l[t].operation;s[t].bind(),f.viewport(0,0,a[0],a[1]);var v=d===A.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(j.withParameters)(f,{clearColor:v},function(){f.clear(16384)});var g={weights:c[t]};if(h.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:g}),s[t].unbind(),d===A.MEAN){var p=this.state,m=p.meanTextures,y=p.textures,b={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(b).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(P()({},36064,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,f=t.equations,h=t.weights,d={width:n,height:i};for(var v in h){var g=h[v],p=g.needMin,m=g.needMax,y=g.combineMaxMin,b=g.operation;r[v]=h[v].aggregationTexture||r[v]||G(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var _=r[v];b===A.MEAN&&(l[v]=l[v]||G(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),_=l[v]),a[v]?a[v].attach(P()({},36064,_)):a[v]=W(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:_}),a[v].resize(d),f[v]=B[b],(p||m)&&(p&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=G(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=W(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(p&&(s[v]||(c["".concat(v,"-min")]=G(this.gl,{id:"".concat(v,"-minTex")}),s[v]=W(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=G(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=W(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof j.Buffer?n[o].setData(u):(a["".concat(o,"-buffer")]=new j.Buffer(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof j.Buffer),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],h()(l()(t.prototype),"getShaders",this).call(this,e)}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:A.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new Y(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&this._updateAggregation(n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||Q,o=this.props.maxColor||J,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,f=u.cellScale,h=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,g={minColor:a,maxColor:o,cellScale:f,colorRange:d,colorDomain:s,shouldUseMinMax:h};Object(j.isWebGL2)(n)?l.bind({target:35345}):g.maxWeight=v,t=Object.assign(g,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(j.isWebGL2)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=Y.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new j.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new j.Geometry({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new j.Buffer(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=K(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(p.a)(t),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var m=v.value;l.index++;var y=n(m,l),b=i(m,l),_=l.index;a[2*_]=y[0],a[2*_+1]=y[1],Array.isArray(b)?(o[3*_]=b[0],o[3*_+1]=b[1],o[3*_+2]=b[2]):o[3*_]=b}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}s.color.values=o,this.setState({positions:a})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(j.isWebGL2)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager();(e.cellSizeChanged||e.viewportChanged)&&(this._updateGridParams(),t.invalidateAll());var n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=A[this.props.aggregation.toUpperCase()]||A.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var f=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),h=f.color.maxData&&Number.isFinite(f.color.maxData[0])?f.color.maxData[0]:0;this.setState({maxWeight:h}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if($.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange,Float32Array,255)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,f=c>l?l:0;r.cellScale=new Float32Array([(c-f)/o*2,-(c-f)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new j.Buffer(r,{byteLength:u,accessor:{size:4,type:5126,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(b.a);te.layerName="ScreenGridLayer",te.defaultProps=ee;var ne=n(134),ie=n(143),re=function(e){return e.length},ae=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:re;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=k()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,P()({},t.i,t))},{})}}]),e}();function oe(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function se(e,t){return function(n){return oe(e,t,n)}}function ue(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var ce=6378e3;function le(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(p.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,f=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}var g=function(e,t){var n=(o=e,o/ce*(180/Math.PI)),i=(r=t,a=e,a/ce*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(g.xOffset<=0||g.yOffset<=0)return{gridHash:{},gridOffset:g};var m={};u.index=-1;var y=!0,b=!1,_=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;u.index++;var P=i(O,u),S=k()(P,2),j=S[0],E=S[1];if(Number.isFinite(E)&&Number.isFinite(j)){var C=Math.floor((E+90)/g.yOffset),A=Math.floor((j+180)/g.xOffset),T="".concat(C,"-").concat(A);m[T]=m[T]||{count:0,points:[]},m[T].count+=1,m[T].points.push(O)}}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}return{gridHash:m,gridOffset:g}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function fe(){}var he={colorDomain:null,colorRange:_,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:fe,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:fe,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,material:new j.PhongMaterial},de=["getColorValue","colorAggregation","getColorWeight"],ve=["getElevationValue","elevationAggregation","getElevationWeight"],ge=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:fe,elevationScaleFunc:fe,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=le(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new ae(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new ae(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=se(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=ue(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.transitions;return new(this.getSubLayerClass("grid-cell",ie.a))({cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(ne.a);ge.layerName="CPUGridLayer",ge.defaultProps=he;var pe=n(117),me=Math.PI/3,ye=[0,me,2*me,3*me,4*me,5*me];function be(e){return e[0]}function _e(e){return e[1]}var xe=function(){var e,t,n,i=0,r=0,a=1,o=1,s=be,u=_e;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var g=l-d,p=d+(ly*y+b*b&&(d=p+(1&h?1:-1)/2,h=m)}var _=d+"-"+h,x=r[_];x?x.push(c):(a.push(x=r[_]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return a}function l(e){var t=0,n=0;return ye.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new ae(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new ae(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=se(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=ue(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.transitions,o=this.state,s=o.angle,u=o.radius;return new(this.getSubLayerClass("hexagon-cell",pe.a))({radius:u,diskResolution:6,elevationScale:t,angle:s,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(ne.a);ke.layerName="HexagonLayer",ke.defaultProps=Oe;var je,Ee=n(20),Ce=n(145),Ae=n(86),Te={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Le=[Te.W,Te.SW,Te.S],Me=[Te.S,Te.SE,Te.E],Ie=[Te.E,Te.NE,Te.N],Fe=[Te.NW,Te.W,Te.N],Re=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],De=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Ne=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],ze=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],Be=[Te.W,Te.SW,Te.SE,Te.E],Ue=[Te.S,Te.SE,Te.NE,Te.N],Ve=[Te.NW,Te.W,Te.E,Te.NE],Ge=[Te.NW,Te.SW,Te.S,Te.N],We=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],He=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],Xe=[Te.NW,Te.SW,Te.SE,Te.NE],qe=[Te.NW,Te.SW,Te.SE,Te.E,Te.N],Ze=[Te.W,Te.SW,Te.SE,Te.NE,Te.N],Ye=[Te.NW,Te.W,Te.S,Te.SE,Te.NE],Ke=[Te.NW,Te.SW,Te.S,Te.E,Te.NE],Qe=[Te.NW,Te.W,[.5,-1/6],[.5,1/6],Te.N],Je=[[-1/6,-.5],[1/6,-.5],Te.E,Te.NE,Te.N],$e=[[-.5,1/6],[-.5,-1/6],Te.S,Te.SE,Te.E],et=[Te.W,Te.SW,Te.S,[1/6,.5],[-1/6,.5]],tt=[Te.NW,Te.W,[-1/6,-.5],[1/6,-.5],Te.N],nt=[[-.5,1/6],[-.5,-1/6],Te.E,Te.NE,Te.N],it=[Te.S,Te.SE,Te.E,[1/6,.5],[-1/6,.5]],rt=[Te.W,Te.SW,Te.S,[.5,-1/6],[.5,1/6]],at=[Te.W,Te.SW,Te.SE,Te.E,[1/6,.5],[-1/6,.5]],ot=[[-.5,1/6],[-.5,-1/6],Te.S,Te.SE,Te.NE,Te.N],st=[Te.NW,Te.W,[-1/6,-.5],[1/6,-.5],Te.E,Te.NE],ut=[Te.NW,Te.SW,Te.S,[.5,-1/6],[.5,1/6],Te.N],ct=[Te.W,Te.SW,Te.S,Te.E,Te.NE,Te.N],lt=[Te.NW,Te.W,Te.S,Te.SE,Te.E,Te.N],ft=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],Te.E,Te.NE,Te.N],ht=[Te.W,Te.SW,Te.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],dt=[Te.NW,Te.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],Te.N],vt=[[-.5,1/6],[-.5,-1/6],Te.S,Te.SE,Te.E,[1/6,.5],[-1/6,.5]],gt=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],pt={0:[],1:[[Te.W,Te.S]],2:[[Te.S,Te.E]],3:[[Te.W,Te.E]],4:[[Te.N,Te.E]],5:{0:[[Te.W,Te.S],[Te.N,Te.E]],1:[[Te.W,Te.N],[Te.S,Te.E]]},6:[[Te.N,Te.S]],7:[[Te.W,Te.N]],8:[[Te.W,Te.N]],9:[[Te.N,Te.S]],10:{0:[[Te.W,Te.N],[Te.S,Te.E]],1:[[Te.W,Te.S],[Te.N,Te.E]]},11:[[Te.N,Te.E]],12:[[Te.W,Te.E]],13:[[Te.S,Te.E]],14:[[Te.W,Te.S]],15:[]};function mt(e){return parseInt(e,4)}var yt=(je={},P()(je,mt("0000"),[]),P()(je,mt("2222"),[]),P()(je,mt("2221"),[Le]),P()(je,mt("2212"),[Me]),P()(je,mt("2122"),[Ie]),P()(je,mt("1222"),[Fe]),P()(je,mt("0001"),[Le]),P()(je,mt("0010"),[Me]),P()(je,mt("0100"),[Ie]),P()(je,mt("1000"),[Fe]),P()(je,mt("2220"),[Re]),P()(je,mt("2202"),[De]),P()(je,mt("2022"),[Ne]),P()(je,mt("0222"),[ze]),P()(je,mt("0002"),[Re]),P()(je,mt("0020"),[De]),P()(je,mt("0200"),[Ne]),P()(je,mt("2000"),[ze]),P()(je,mt("0011"),[Be]),P()(je,mt("0110"),[Ue]),P()(je,mt("1100"),[Ve]),P()(je,mt("1001"),[Ge]),P()(je,mt("2211"),[Be]),P()(je,mt("2112"),[Ue]),P()(je,mt("1122"),[Ve]),P()(je,mt("1221"),[Ge]),P()(je,mt("2200"),[We]),P()(je,mt("2002"),[He]),P()(je,mt("0022"),[We]),P()(je,mt("0220"),[He]),P()(je,mt("1111"),[Xe]),P()(je,mt("1211"),[qe]),P()(je,mt("2111"),[Ze]),P()(je,mt("1112"),[Ye]),P()(je,mt("1121"),[Ke]),P()(je,mt("1011"),[qe]),P()(je,mt("0111"),[Ze]),P()(je,mt("1110"),[Ye]),P()(je,mt("1101"),[Ke]),P()(je,mt("1200"),[Qe]),P()(je,mt("0120"),[Je]),P()(je,mt("0012"),[$e]),P()(je,mt("2001"),[et]),P()(je,mt("1022"),[Qe]),P()(je,mt("2102"),[Je]),P()(je,mt("2210"),[$e]),P()(je,mt("0221"),[et]),P()(je,mt("1002"),[tt]),P()(je,mt("2100"),[nt]),P()(je,mt("0210"),[it]),P()(je,mt("0021"),[rt]),P()(je,mt("1220"),[tt]),P()(je,mt("0122"),[nt]),P()(je,mt("2012"),[it]),P()(je,mt("2201"),[rt]),P()(je,mt("0211"),[at]),P()(je,mt("2110"),[ot]),P()(je,mt("1102"),[st]),P()(je,mt("1021"),[ut]),P()(je,mt("2011"),[at]),P()(je,mt("0112"),[ot]),P()(je,mt("1120"),[st]),P()(je,mt("1201"),[ut]),P()(je,mt("2101"),[ct]),P()(je,mt("0121"),[ct]),P()(je,mt("1012"),[lt]),P()(je,mt("1210"),[lt]),P()(je,mt("0101"),{0:[Le,Ie],1:[ct],2:[ct]}),P()(je,mt("1010"),{0:[Fe,Me],1:[lt],2:[lt]}),P()(je,mt("2121"),{0:[ct],1:[ct],2:[Le,Ie]}),P()(je,mt("1212"),{0:[lt],1:[lt],2:[Fe,Me]}),P()(je,mt("2120"),{0:[ft],1:[ft],2:[Re,Ie]}),P()(je,mt("2021"),{0:[ht],1:[ht],2:[Le,Ne]}),P()(je,mt("1202"),{0:[dt],1:[dt],2:[Fe,De]}),P()(je,mt("0212"),{0:[vt],1:[vt],2:[Me,ze]}),P()(je,mt("0102"),{0:[Re,Ie],1:[ft],2:[ft]}),P()(je,mt("0201"),{0:[Le,Ne],1:[ht],2:[ht]}),P()(je,mt("1020"),{0:[Fe,De],1:[dt],2:[dt]}),P()(je,mt("2010"),{0:[Me,ze],1:[vt],2:[vt]}),P()(je,mt("2020"),{0:[ze,De],1:[gt],2:[Re,Ne]}),P()(je,mt("0202"),{0:[Ne,Re],1:[gt],2:[ze,De]}),je),bt={ISO_LINES:1,ISO_BANDS:2},_t={zIndex:0,zOffset:.005};function xt(e,t){return Array.isArray(t)?e=t?1:0}function wt(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,f=s||u||c||l,h={},d={};s||l?d.top=0:(h.top=t[(i+1)*r+n],d.top=xt(h.top,o)),u||l?d.topRight=0:(h.topRight=t[(i+1)*r+n+1],d.topRight=xt(h.topRight,o)),u||c?d.right=0:(h.right=t[i*r+n+1],d.right=xt(h.right,o)),s||c?d.current=0:(h.current=t[i*r+n],d.current=xt(h.current,o));var v=d.top,g=d.topRight,p=d.right,y=d.current,b=-1;Number.isFinite(o)&&(b=v<<3|g<<2|p<<1|y),Array.isArray(o)&&(b=v<<6|g<<4|p<<2|y);var _=0;return f||(_=xt((h.top+h.topRight+h.right+h.current)/4,o)),{code:b,meanCode:_}}function Ot(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?bt.ISO_LINES:s,c=Object.assign({},_t,e.thresholdData),l=u===bt.ISO_BANDS?yt[a]:pt[a];Array.isArray(l)||(l=l[o]);var f=c.zIndex*c.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+h,g=t[1]+d;if(u===bt.ISO_BANDS){var p=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=g+e[1]*n[1];t.push([i,r,f])}),p.push(t)}),p}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=g+e[1]*n[1];m.push([t,i,f])})}),m}var Pt=n(81),St=n(27),kt=g.experimental.count,jt=j.fp64.fp64LowPart,Et=6378e3;function Ct(e){return Number.isFinite(e)?e:0}function At(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,f=void 0===l?St.a.LNGLAT:l,h=e.viewport,d=void 0===h?null:h,v=e.boundingBox,g=void 0===v?null:v,y={};o.dataChanged&&(g=(y=function(e,t,n){var i,r,a=kt(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,f=-1/0,h={};for(var d in n)h[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(p.a)(e),g=v.iterable,m=v.objectInfo,y=!0,b=!1,_=void 0;try{for(var x,w=g[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;m.index++;var P=t(O,m),S=m.index;for(var k in r=P[0],i=P[1],o[2*S]=r,o[2*S+1]=i,s[2*S]=jt(r),s[2*S+1]=jt(i),n){var j=n[k].getWeight(O);Array.isArray(j)?(h[k].values[3*S]=j[0],h[k].values[3*S+1]=j[1],h[k].values[3*S+2]=j[2]):h[k].values[3*S]=j}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rf?r:f)}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var E={xMin:Ct(l),xMax:Ct(f),yMin:Ct(u),yMax:Ct(c)};return{positions:o,positions64xyLow:s,weights:h,boundingBox:E}}(t,n,s)).boundingBox);var b=[i,i],_=[0,0];switch(m.a.assert(f===St.a.LNGLAT||f===St.a.IDENTITY),f){case St.a.LNGLAT:case St.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/Et*(180/Math.PI)),i=(r=t,a=e,a/Et*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(g,i);b=[x.xOffset,x.yOffset],_=[-180,-90];break;case St.a.IDENTITY:_=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=Tt(o-i[0],n[0])+i[0],c=Tt(r-i[1],n[1])+i[1],l=(new Pt.a).translate([-1*u,-1*c,0]),f=[u,c],h=s-o+n[0],d=a-r+n[1],v=[Math.ceil(h/n[0]),Math.ceil(d/n[1])];return{gridOrigin:f,gridSize:v,width:h,height:d,gridTransformMatrix:l}}({boundingBox:g,cellSize:b,worldOrigin:_});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:b,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:b,boundingBox:g}}function Tt(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Lt=[255,255,255,255],Mt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},It=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new Y(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ce.a(this._getLineLayerProps()),r&&new Ae.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=At({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:f,gridOrigin:h,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking",j.fp64]})}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new j.Model(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new j.CubeGeometry,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,f=n.gridOffset,h=n.elevationRange,d=[Object(Ft.c)(l[0]),Object(Ft.c)(l[1])],v=[Object(Ft.c)(f[0]),Object(Ft.c)(f[1])],g=this.getDomainUniforms(),p={colorMaxMinBuffer:i.color.maxMinBuffer,elevationMaxMinBuffer:i.elevation.maxMinBuffer},m=x(this.props.colorRange,Float32Array,255);this.bindUniformBuffers(p),this.state.model.setUniforms(Object.assign({},t,g,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:d,gridOffset:f,gridOffsetLow:v,colorRange:m,elevationRange:h})).draw(),this.unbindUniformBuffers(p)}},{key:"bindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.bind({target:35345,index:0}),n.bind({target:35345,index:1})}},{key:"unbindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.unbind({target:35345,index:0}),n.unbind({target:35345,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(b.a);Nt.layerName="GPUGridCellLayer",Nt.defaultProps=Dt;var zt={colorDomain:null,colorRange:_,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new j.PhongMaterial,gpuAggregation:!0},Bt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=Y.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new Y(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=Y.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=Y.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,f=c.getPosition,h=this.state.gridHash;if(!h)h=le(l,this.props.cellSize,f).gridHash,this.setState({gridHash:h});var d=h[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,f=At({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:A[s]||A[zt.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:A[c]||A[zt.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),h=f.weights,d=f.gridSize,v=f.gridOrigin,g=f.cellSize,p=f.boundingBox;this.setState({weights:h,gridSize:d,gridOrigin:v,cellSize:g,boundingBox:p})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.elevationRange,s=e.colorDomain,u=e.elevationDomain,c=this.state,l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=x(this.props.colorRange,Float32Array,255);return new(this.getSubLayerClass("gpu-grid-cell",Nt))({gridSize:f,gridOrigin:h,gridOffset:d,colorRange:v,elevationRange:o,colorDomain:s,elevationDomain:u,cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:l,numInstances:f[0]*f[1]})}}]),t}(ne.a);Bt.layerName="GPUGridLayer",Bt.defaultProps=zt;var Ut=Object.assign({},Bt.defaultProps,ge.defaultProps,{gpuAggregation:!1}),Vt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",Bt):this.getSubLayerClass("CPU",ge))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!Y.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(ne.a);Vt.layerName="GridLayer",Vt.defaultProps=Ut,n.d(t,"experimental",function(){return Gt}),n.d(t,"ScreenGridLayer",function(){return te}),n.d(t,"CPUGridLayer",function(){return ge}),n.d(t,"HexagonLayer",function(){return ke}),n.d(t,"ContourLayer",function(){return It}),n.d(t,"GridLayer",function(){return Vt}),n.d(t,"GPUGridLayer",function(){return Bt}),n.d(t,"AGGREGATION_OPERATION",function(){return A}),n.d(t,"_GPUGridAggregator",function(){return Y});var Gt={BinSorter:ae,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:ue,quantizeScale:oe,getQuantizeScale:se,defaultColorRange:_}},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(7),u=n.n(s),c=n(4),l=n.n(c),f=n(15),h=n.n(f),d=n(8),v=n.n(d),g=n(53),p=n(62),m=n(85),y=n(1),b=Math.PI/180,_=new Float32Array(16),x=new Float32Array(12);function w(e,t,n){var i=t[0]*b,r=t[1]*b,a=t[2]*b,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),f=Math.cos(r),h=n[0],d=n[1],v=n[2];e[0]=h*f*l,e[1]=h*u*l,e[2]=h*-s,e[3]=d*(-u*c+f*s*o),e[4]=d*(f*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+f*s*c),e[7]=v*(-f*o+u*s*c),e[8]=v*l*c}function O(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var P={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),f=l&&16===c.length,h=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),p=f||!l&&Boolean(c(a[0]));e.constant=p?f:d&&h&&v;var m=e.value;if(e.constant){var y;if(p)_.set(c),y=O(_);else w(y=x,o,s),y.set(u,9);e.value=new Float32Array(y)}else{var b=n*e.size,P=Object(g.a)(a,n,i),S=P.iterable,k=P.objectInfo,j=!0,E=!1,C=void 0;try{for(var A,T=S[Symbol.iterator]();!(j=(A=T.next()).done);j=!0){var L=A.value;k.index++;var M=void 0;if(p)_.set(f?c:c(L,k)),M=O(_);else w(M=x,d?o:o(L,k),h?s:s(L,k)),M.set(v?u:u(L,k),9);m[b++]=M[0],m[b++]=M[1],m[b++]=M[2],m[b++]=M[3],m[b++]=M[4],m[b++]=M[5],m[b++]=M[6],m[b++]=M[7],m[b++]=M[8],m[b++]=M[9],m[b++]=M[10],m[b++]=M[11]}}catch(e){E=!0,C=e}finally{try{j||null==T.return||T.return()}finally{if(E)throw C}}}}};function S(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function k(e){if(e.attributes)return S(e.attributes),e instanceof y.Geometry?e:new y.Geometry(e);if(e.positions||e.POSITION)return S(e),new y.Geometry({attributes:e});throw Error("Invalid mesh")}var j={mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},wireframe:!1,material:new y.PhongMaterial,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},E=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=Object(y.isWebGL2)(this.context.gl),n=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n",i=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor / 255., color.a);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform vec4 color;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor / 255.;\n vec3 lightColor = lighting_getLightColor(color.rgb * 255., cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor / 255., color.a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";return h()(l()(t.prototype),"getShaders",this).call(this,{vs:n,fs:i,modules:["project32","phong-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{transition:!0,size:this.props.colorFormat.length,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:P}),this.setState({emptyTexture:new y.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||r.extensionsChanged){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new y.Model(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:k(e),isInstanced:!0,shaderCache:this.context.shaderCache})),n=this.state,i=n.texture,r=n.emptyTexture;return t.setUniforms({sampler:i||r,hasTexture:Boolean(i)}),t}},{key:"setTexture",value:function(e){var t=this.context.gl,n=this.state,i=n.emptyTexture,r=n.model;this.state.texture&&this.state.texture.delete();var a=e?function(e,t,n){return t instanceof y.Texture2D?t:new y.Texture2D(e,Object.assign({data:t},n))}(t,e):null;this.setState({texture:a}),r&&r.setUniforms({sampler:a||i,hasTexture:Boolean(a)})}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);E.layerName="SimpleMeshLayer",E.defaultProps=j;var C=n(34),A=n.n(C),T=n(5),L=n(6),M=n(81),I=n(11),F=n(10),R=n(12),D=n(89),N=n(20),z=n(13);var B=n(35),U=n(32);function V(){var e=new z.a(4);return z.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function G(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function W(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=i*l+o*s+r*c-a*u,e[1]=r*l+o*u+a*s-i*c,e[2]=a*l+o*c+i*u-r*s,e[3]=o*l-i*s-r*u-a*c,e}function H(e,t,n,i){var r,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=n[0],v=n[1],g=n[2],p=n[3];return(a=c*d+l*v+f*g+h*p)<0&&(a=-a,d=-d,v=-v,g=-g,p=-p),1-a>z.b?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,u=Math.sin(i*r)/o):(s=1-i,u=i),e[0]=s*c+u*d,e[1]=s*l+u*v,e[2]=s*f+u*g,e[3]=s*h+u*p,e}function X(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*n,n=.5/n,e[3]=(t[3*a+o]-t[3*o+a])*n,e[a]=(t[3*a+r]+t[3*r+a])*n,e[o]=(t[3*o+r]+t[3*r+o])*n}return e}U.b,U.g,U.c;var q,Z,Y,K,Q,J,$,ee=U.l,te=U.a,ne=U.k,ie=U.d,re=U.i,ae=U.h,oe=U.m,se=U.j,ue=(U.f,U.e,q=B.b(),Z=B.e(1,0,0),Y=B.e(0,1,0),function(e,t,n){var i=B.d(t,n);return i<-.999999?(B.c(q,Z,t),B.f(q)<1e-6&&B.c(q,Y,t),B.i(q,q),G(e,q,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(B.c(q,t,n),e[0]=q[0],e[1]=q[1],e[2]=q[2],e[3]=1+i,se(e,e))}),ce=(K=V(),Q=V(),J=new z.a(9),z.a!=Float32Array&&(J[1]=0,J[2]=0,J[3]=0,J[5]=0,J[6]=0,J[7]=0),J[0]=1,J[4]=1,J[8]=1,$=J,[0,0,0,1]);var le=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(T.a)(this,t),e=Object(I.a)(this,Object(F.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,a),e}return Object(R.a)(t,e),Object(L.a)(t,[{key:"fromMatrix3",value:function(e){return X(this,e),this.check()}},{key:"fromValues",value:function(e,t,n,i){return this.set(e,t,n,i)}},{key:"identity",value:function(){var e;return(e=this)[0]=0,e[1]=0,e[2]=0,e[3]=1,this.check()}},{key:"length",value:function(){return ae(this)}},{key:"squaredLength",value:function(e){return oe(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ie(this,e)}},{key:"rotationTo",value:function(e,t){return ue(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return te(this,e),this.check()}},{key:"calculateW",value:function(){var e,t,n,i,r;return e=this,n=(t=this)[0],i=t[1],r=t[2],e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),this.check()}},{key:"conjugate",value:function(){var e,t;return t=this,(e=this)[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],this.check()}},{key:"invert",value:function(){var e,t,n,i,r,a,o,s;return e=this,n=(t=this)[0],i=t[1],r=t[2],a=t[3],s=(o=n*n+i*i+r*r+a*a)?1/o:0,e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=a*s,this.check()}},{key:"lerp",value:function(e,t,n){return re(this,e,t,n),this.check()}},{key:"multiply",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.multiply only takes one argument");return W(this,this,e),this.check()}},{key:"normalize",value:function(){return se(this,this),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+o*s,e[1]=r*u+a*s,e[2]=a*u-r*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u-a*s,e[1]=r*u+o*s,e[2]=a*u+i*s,e[3]=o*u-r*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return ne(this,this,e),this.check()}},{key:"set",value:function(e,t,n,i){return ee(this,e,t,n,i),this.check()}},{key:"setAxisAngle",value:function(e,t){return G(this,e,t),this.check()}},{key:"slerp",value:function(e){var t=e.start;return H(this,void 0===t?ce:t,e.target,e.ratio),this.check()}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=Object(N.a)(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=Object(N.a)(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(N.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(N.a)(e)}}]),t}(D.a),fe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},he={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function de(e){if(!e._animation){var t=he[e.componentType],n=fe[e.type],i=n*e.count,r=e.bufferView.data,a=new t(r.buffer,r.byteOffset+(e.byteOffset||0),i);if(1===n)e._animation=Array.from(a);else{for(var o=[],s=0;s=s}),c=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:y.log.warn("Bad animation path ".concat(i))()}Object(y.assert)(n[i].length===o[c].length);var l=r[c],f=r[u];switch(a){case"STEP":!function(e,t,n){for(var i=0;il){var h=(s-l)/(f-l);!function(e,t,n,i,r){if("rotation"===t){ge.slerp({start:n,target:i,ratio:r});for(var a=0;al){var d=(s-l)/(f-l),v=f-l;!function(e,t,n){for(var i=n.p0,r=n.outTangent0,a=n.inTangent1,o=n.p1,s=n.tDiff,u=n.ratio,c=0;c2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},r=new y.Texture2D(this.gl,{id:e.name||e.id,parameters:i,pixelStore:Object(_e.a)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1),data:e.texture.source.getImageAsync()});this.uniforms[t]=r,this.defineIfPresent(n,n),this.generatedTextures.push(r)}},{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 t=e.metallicFactor,n=void 0===t?1:t,i=e.roughnessFactor,r=void 0===i?1:i;this.uniforms.u_MetallicRoughnessValues=[n,r]}},{key:"parseMaterial",value:function(e){if(e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,n=void 0===t?1:t;this.uniforms.u_NormalScale=n}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,r=void 0===i?1:i;this.uniforms.u_OcclusionStrength=r}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(y.log.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]}))}}]),e}(),we="\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n",Oe="\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n";function Pe(e,t){return Object(y.isWebGL2)(e)?"#version 300 es\n".concat(t):t}var Se={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ke={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},je=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(T.a)(this,e),this.gl=t,this.options=Object.assign({},ke,n)}return Object(L.a)(e,[{key:"instantiate",value:function(e){var t=this;return this.gltf=e,(e.scenes||[]).map(function(e){return t.createScene(e)})}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new ye(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new y.GroupNode({id:e.name||e.id,children:n})}},{key:"createNode",value:function(e){var t=this;if(!e._node){var n=(e.children||[]).map(function(e){return t.createNode(e)});e.mesh&&n.push(this.createMesh(e.mesh));var i=new y.GroupNode({id:e.name||e.id,children:n});if(e.matrix)i.setMatrix(e.matrix);else{if(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation){var r=(new M.a).fromQuaternion(e.rotation);i.matrix.multiplyRight(r)}e.scale&&i.matrix.scale(e.scale)}e._node=i}return e._node}},{key:"createMesh",value:function(e){var t=this;if(!e._mesh){var n=(e.primitives||[]).map(function(n,i){return t.createPrimitive(n,i,e)}),i=new y.GroupNode({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){y.log.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,t,n){return function(e,t){var n=t.id,i=t.drawMode,r=t.vertexCount,a=t.attributes,o=t.modelOptions,s=new xe(e,t);y.log.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,Object(be.a)(s.generatedTextures)),u.push.apply(u,Object(be.a)(Object.values(a).map(function(e){return e.buffer})));var c=new y.ModelNode(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[y.pbr],defines:s.defines,parameters:s.parameters,vs:Pe(e,we),fs:Pe(e,Oe),managedResources:u},o));return c.setProps({attributes:a}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:e.name||"".concat(n.name||n.id,"-primitive-").concat(t),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))}},{key:"createAttributes",value:function(e,t){var n=this,i={};return Object.keys(e).forEach(function(t){i[t]=n.createAccessor(e[t],n.createBuffer(e[t],n.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),y.log.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}},{key:"createBuffer",value:function(e,t){e.bufferView||(e.bufferView={});var n=e.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new y.Buffer(this.gl,{id:"from-".concat(n.id),data:n.data||e.value,target:t})),n.lumaBuffers[t]}},{key:"createAccessor",value:function(e,t){return new y._Accessor({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Se[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();var Ee=n(31),Ce=n.n(Ee),Ae=n(104),Te=n.n(Ae);function Le(){return(Le=Te()(Ce.a.mark(function e(t){var n;return Ce.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach(function(e){e.traverse(function(e){Object.values(e.model.program.uniforms).forEach(function(e){!1===e.loaded&&n.push(e)})})}),e.next=4,Me(function(){return n.some(function(e){return!e.loaded})});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function Me(e){return Ie.apply(this,arguments)}function Ie(){return(Ie=Te()(Ce.a.mark(function e(t){return Ce.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise(function(e){return requestAnimationFrame(e)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}var Fe=[255,255,255,255],Re={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"===A()(e.scene)?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:Fe},_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:[]}},De=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{size:this.props.colorFormat.length,accessor:"getColor",defaultValue:Fe,transition:!0},instanceModelMatrix:P})}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;n.scenegraph!==i.scenegraph?this._updateScenegraph(n):n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t,n=this,i=this.context.gl;if(e.scenegraph instanceof y.ScenegraphNode)t={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,a=function(e,t,n){var i=new je(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(i,r,this.getLoadOptions());t=Object.assign({gltf:r},a),function(e){return Le.apply(this,arguments)}(a).then(function(){return n.setNeedsRedraw()})}else y.log.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader"),t=e.scenegraph;var o={layer:this,gl:i},s=e.getScene(t,o),u=e.getAnimator(t,o);s instanceof y.ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&y.log.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).sort().forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r0)return e;e=function(e){var t=e.padEnd(16,"0");return O.a.fromString(t,16)}(e)}return x.S2.S2Cell.toHilbertQuadkey(e.toString())}function j(e){var t=k(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],f=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,S*Math.pow(2,-c)),d=0;d<4;d++)for(var v=f[d].slice(0),g=f[d+1],p=(g[0]-v[0])/h,m=(g[1]-v[1])/h,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(M.g)([r[0],r[3]],e.scale).map(F),o=_()(a,2),s=o[0],u=o[1],c=Object(M.g)([r[2],r[1]],e.scale).map(F),l=_()(c,2),f=l[0],h=l[1];s=Math.max(0,Math.floor(s)),f=Math.min(e.scale,Math.ceil(f)),u=Math.max(0,Math.floor(u)),h=Math.min(e.scale,Math.ceil(h));for(var d=[],v=s;vt?d.push(R({x:v,y:g,z:i},t)):d.push({x:v,y:g,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),N={renderSubLayers:{type:"function",value:function(e){return new A.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},z=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new D({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new D({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var f=i.viewport,h=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==f.id&&this.state.tileCache.update(f,function(e){var n=e.filter(function(e){return e.z===h}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"color.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){h()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),h()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),f=Object(U.a)(a,n,i),h=f.iterable,d=f.objectInfo,v=0,g=0;g180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function Q(e,t,n){var i=e(t,n),r=Object(G.h3ToGeo)(i),a=_()(r,2),o=a[0];return[a[1],o]}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(G.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(G.h3ToGeo)(e),r=_()(i,2),a=r[0],o=r[1],s=t.length;K(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(G.edgeLength)(i,G.UNITS.km):0,hasPentagon:r})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(G.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(G.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=J(a),u=Object(G.h3ToGeo)(a),c=_()(u,2),l=c[0],f=c[1],h=e.projectFlat([f,l]),d=_()(h,2),v=d[0],g=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-g)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.material,i=e.coverage,r=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getColor,d=e.getFillColor,v=e.getElevation,g=e.getLineColor,p=e.getLineWidth,m=e.updateTriggers;return{elevationScale:t,extruded:r,coverage:i,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:n,getElevation:v,getFillColor:h||d,getLineColor:g,getLineWidth:p,updateTriggers:{getFillColor:m.getColor||m.getFillColor,getElevation:m.getElevation,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===q()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return J(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",Y.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Q.bind(null,n)})}}]),t}(m.a);ee.defaultProps=$,ee.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return p}),n.d(t,"S2Layer",function(){return C}),n.d(t,"TileLayer",function(){return z}),n.d(t,"TripsLayer",function(){return V}),n.d(t,"H3ClusterLayer",function(){return H}),n.d(t,"H3HexagonLayer",function(){return ee})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(34),u=n.n(s);var c=n(111),l=n(140),f=n(141),h=n(142),d=n(7),v=n.n(d),g=n(4),p=n.n(g),m=n(8),y=n.n(m),b={fetch:function(e){return JSON.parse(e)},configuration:[]},_=function(e){function t(){return r()(this,t),v()(this,p()(t).apply(this,arguments))}return y()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layers:[]}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps;(e.changeFlags.dataChanged||t.configuration!==n.configuration)&&(this.state.layers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t){var n={};for(var i in e){var r=e[i];i.startsWith("get")?n[i]=D(r,t):n[i]=r}return n}(e,t);return r.fetch=N,i&&new i(r)})}(t.data,t.configuration))}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(134).a);function x(e,t){var n=function(e){if("string"==typeof e){var t=O[e];return t||(t=e.split("."),O[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=w(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function w(e){return null!==e&&"object"===u()(e)}_.layerName="JSONLayer",_.defaultProps=b;var O={};var P={},S={},k=34,j=10,E=13;function C(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var A=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return S;if(c)return c=!1,P;var t,i,r=o;if(e.charCodeAt(r)===k){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===j?c=!0:i===E&&(c=!0,e.charCodeAt(o)===j&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u]);Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var z=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=R(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return z}),n.d(t,"_JSONLayer",function(){return _})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(135);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},f=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":t="pointermove",i=e._onPointerMove;break;case"mouseout":t="pointerleave",i=e._onPointerMove;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv().firstChild,i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),f=new google.maps.Point(0,0),h=a.fromContainerPixelToLatLng(f),d=a.fromLatLngToDivPixel(h),v=(c.x-l.x)/i,g=Math.log2(v)+e.getZoom()-1,p=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(p),y=m.lat(),b=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:g,pitch:e.getTilt(),latitude:y,longitude:b}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,f=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:f?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return f})},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(135),u=n(112);function c(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[770,771,1,771],blendEquation:32774},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:l(t)}),i=new s.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:l(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=h(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[f(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function l(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new u.a(Object.assign({x:0,y:0,width:e.width,height:e.height},l(t),n?{nearZMultiplier:e.height?1/e.height:1,farZMultiplier:1}:{nearZMultiplier:.1,farZMultiplier:10}))}function h(e,t){return e.layerManager.getLayers().filter(t)}function d(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function v(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var g=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=c({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),v(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),v(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&v(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=f(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:h(n,function(e){return d(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return g})},function(e,t,n){"use strict";var i=n(29),r=n(23),a=n(0),o=n(5),s=n(6),u=n(68);var c=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var f={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(e){return"string"==typeof e?f[e.toUpperCase()]||f.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(63);n.d(t,"a",function(){return b});var g={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!1,priority:0};function m(){}var y={};var b=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(163)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var f=new Image;return f.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(f,i,o)))},f.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=h(a),r="[".concat(a,"m").concat(r,"")),o&&(a=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();b.VERSION=u.a},function(e,t,n){"use strict";var i=n(5),r=n(6),a=n(63),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()}])}); +!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),f="function",h=Math.round,d=Math.abs,v=Date.now;function g(e,t,n){return setTimeout(w(e,n),t)}function p(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function L(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==B&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(f=o.pointers,h=i,oe(h[0],h[1],$)/oe(f[0],f[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>z||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,f=re(u,c,l);i=f.x,r=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var f,h;var g=e.element;k(t.srcEvent.target,g)&&(g=t.srcEvent.target);t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?q:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(R(this.element),this.evWin,this.domHandler)}};var ue={mousedown:B,mousemove:U,mouseup:V},ce="mousedown",le="mousemove mouseup";function fe(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(fe,ee,{handler:function(e){var t=ue[e.type];t&B&&0===e.button&&(this.pressed=!0),t&U&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:B,pointermove:U,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",ge="pointermove pointerup pointercancel";function pe(){this.evEl=ve,this.evWin=ge,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",ge="MSPointerMove MSPointerUp MSPointerCancel"),x(pe,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=he[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=A(t,e.pointerId,"pointerId");r&B&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:B,touchmove:U,touchend:V,touchcancel:G},ye="touchstart",be="touchstart touchmove touchend touchcancel";function _e(){this.evTarget=ye,this.evWin=be,this.started=!1,ee.apply(this,arguments)}x(_e,ee,{handler:function(e){var t=me[e.type];if(t===B&&(this.started=!0),this.started){var n=function(e,t){var n=T(e.touches),i=T(e.changedTouches);t&(V|G)&&(n=M(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:B,touchmove:U,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Oe(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Oe,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=T(e.touches),i=this.targetIds;if(t&(B|U)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=T(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return k(e.target,u)}),t===B)for(r=0;r-1&&i.splice(e,1)},Pe)}}x(je,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,ke.call(this,t)):e&(V|G)&&ke.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Be&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return qe.prototype.attrTest.call(this,e)&&(this.state&Ne||!(this.state&Ne)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ye,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ne)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Ke,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&B)this.reset(),this._timer=g(function(){this.state=Ue,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ue;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ue&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Qe,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ne)}}),x(Je,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|K)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;j(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:C(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return o});var i=n(228),r=n(193);const a={position:"absolute",left:0,top:0,width:"100%",height:"100%"};class o extends r.a{constructor(e={}){if("undefined"==typeof document)throw Error("Deck can only be used in the browser");const{mapCanvas:t,deckCanvas:n}=function(e){let{container:t=document.body}=e;if("string"==typeof t&&(t=document.getElementById(t)),!t)throw Error("Deck: container not found");"static"===window.getComputedStyle(t).position&&(t.style.position="relative");const n=document.createElement("div");t.appendChild(n),Object.assign(n.style,a);const i=document.createElement("canvas");return t.appendChild(i),Object.assign(i.style,a),{container:t,mapCanvas:n,deckCanvas:i}}(e),r=e.initialViewState||function(e){if(!e.viewState&&"latitude"in e&&"longitude"in e&&"zoom"in e){const{latitude:t,longitude:n,zoom:i,pitch:r=0,bearing:a=0}=e;return{latitude:t,longitude:n,zoom:i,pitch:r,bearing:a}}return e.viewState}(e),o=Number.isFinite(r.latitude),{map:s=window.mapboxgl,controller:u=!0}=e;super(Object.assign({},e,{width:"100%",height:"100%",canvas:n,controller:u,initialViewState:r})),s&&s.Map?this._map=o&&new i.a(Object.assign({},e,{viewState:r,container:t,mapboxgl:s})):this._map=s,this._onBeforeRender=(e=>{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(260);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(21),p=n(72),m=n(15),y=n(164),b=n(129),_=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function x(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(Number.isFinite(e[0]))t=new i(e);else{t=new i(4*e.length);for(var r=0,a=0;ae?t:e}function U(e,t){return t1&&void 0!==arguments[1]?arguments[1]:{},n=t.width,i=void 0===n?1:n,r=t.height,a=void 0===r?1:r,o=t.data,s=void 0===o?null:o,u=t.unpackFlipY,c=void 0===u||u,l=t.parameters,f=void 0===l?ee:l;return new J.a(e,{data:s,format:34836,type:5126,border:0,mipmaps:!1,parameters:f,dataFormat:6408,width:i,height:a,unpackFlipY:c})}function ne(e,t){var n=t.id,i=t.width,r=void 0===i?1:i,a=t.height,o=void 0===a?1:a,s=t.texture;return new $.a(e,{id:n,width:r,height:o,attachments:P()({},36064,s)})}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(C.d)(t)&&Object(E.c)(this.gl,A.a.BLEND_EQUATION_MINMAX,A.a.COLOR_ATTACHMENT_RGBA32F,A.a.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.info("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,oe){var r=oe[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},H,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,W)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||Q,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},K,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,f=0;f=0&&P=0&&S0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new L.a(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n pos = floor(pos / cellSize);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?[F.a]:["project32"],shaderCache:n,vertexCount:0,drawMode:0})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new L.a(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:[k.a],shaderCache:t,vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new I.a(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,h=a.weights,d=[o,s],v={blend:!0,depthTest:!1,blendFunc:[1,1]},g={viewport:n},p={windowSize:u,cellSize:t,gridSize:d,uProjectionMatrix:i,uProjectionMatrixFP64:re(i),projectPoints:r};for(var m in h){var y=h[m],b=y.needMin,_=y.needMax,x=b&&_&&h[m].combineMaxMin;this.renderToWeightsTexture({id:m,parameters:v,moduleSettings:g,uniforms:p,gridSize:d}),x?this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:Z}),gridSize:d,minOrMaxFb:c[m],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:x}):(b&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:X}),gridSize:d,minOrMaxFb:l[m],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:x}),_&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:q}),gridSize:d,minOrMaxFb:f[m],combineMaxMin:x}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(R.a)(c,s,function(){c.clear(16384)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,f=this.gl,h=this.gridAggregationModel,d=l[t].operation;s[t].bind(),f.viewport(0,0,a[0],a[1]);var v=d===N.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(R.a)(f,{clearColor:v},function(){f.clear(16384)});var g={weights:c[t]};if(h.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:g}),s[t].unbind(),d===N.MEAN){var p=this.state,m=p.meanTextures,y=p.textures,b={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(b).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(P()({},36064,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,f=t.equations,h=t.weights,d={width:n,height:i};for(var v in h){var g=h[v],p=g.needMin,m=g.needMax,y=g.combineMaxMin,b=g.operation;r[v]=h[v].aggregationTexture||r[v]||te(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var _=r[v];b===N.MEAN&&(l[v]=l[v]||te(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),_=l[v]),a[v]?a[v].attach(P()({},36064,_)):a[v]=ne(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:_}),a[v].resize(d),f[v]=Y[b],(p||m)&&(p&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=te(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=ne(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(p&&(s[v]||(c["".concat(v,"-min")]=te(this.gl,{id:"".concat(v,"-minTex")}),s[v]=ne(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=te(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=ne(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof T.a?n[o].setData(u):(a["".concat(o,"-buffer")]=new T.a(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof T.a),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],h()(l()(t.prototype),"getShaders",this).call(this,e)}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:N.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new se(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&this._updateAggregation(n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||le,o=this.props.maxColor||fe,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,f=u.cellScale,h=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,g={minColor:a,maxColor:o,cellScale:f,colorRange:d,colorDomain:s,shouldUseMinMax:h};Object(C.d)(n)?l.bind({target:35345}):g.maxWeight=v,t=Object.assign(g,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(C.d)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=se.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new ue.a({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new T.a(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=ce(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(p.a)(t),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var m=v.value;l.index++;var y=n(m,l),b=i(m,l),_=l.index;a[2*_]=y[0],a[2*_+1]=y[1],Array.isArray(b)?(o[3*_]=b[0],o[3*_+1]=b[1],o[3*_+2]=b[2]):o[3*_]=b}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}s.color.values=o,this.setState({positions:a})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(C.d)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager();(e.cellSizeChanged||e.viewportChanged)&&(this._updateGridParams(),t.invalidateAll());var n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=N[this.props.aggregation.toUpperCase()]||N.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var f=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),h=f.color.maxData&&Number.isFinite(f.color.maxData[0])?f.color.maxData[0]:0;this.setState({maxWeight:h}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if(he.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,f=c>l?l:0;r.cellScale=new Float32Array([(c-f)/o*2,-(c-f)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new T.a(r,{byteLength:u,accessor:{size:4,type:5126,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(b.a);ve.layerName="ScreenGridLayer",ve.defaultProps=de;var ge=n(191),pe=n(192),me=n(216),ye=function(e){return e.length},be=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=j()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,P()({},t.i,t))},{})}}]),e}();function _e(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function xe(e,t){return function(n){return _e(e,t,n)}}function we(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var Oe=6378e3;function Pe(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(p.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,f=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}var g=function(e,t){var n=(o=e,o/Oe*(180/Math.PI)),i=(r=t,a=e,a/Oe*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(g.xOffset<=0||g.yOffset<=0)return{gridHash:{},gridOffset:g};var m={};u.index=-1;var y=!0,b=!1,_=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;u.index++;var P=i(O,u),S=j()(P,2),k=S[0],C=S[1];if(Number.isFinite(C)&&Number.isFinite(k)){var E=Math.floor((C+90)/g.yOffset),A=Math.floor((k+180)/g.xOffset),T="".concat(E,"-").concat(A);m[T]=m[T]||{count:0,points:[]},m[T].count+=1,m[T].points.push(O)}}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}return{gridHash:m,gridOffset:g}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function Se(){}var je={colorDomain:null,colorRange:_,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:Se,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:Se,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,material:new ge.a},ke=["getColorValue","colorAggregation","getColorWeight"],Ce=["getElevationValue","elevationAggregation","getElevationWeight"],Ee=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:Se,elevationScaleFunc:Se,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=Pe(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.transitions;return new(this.getSubLayerClass("grid-cell",me.a))({cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(pe.a);Ee.layerName="CPUGridLayer",Ee.defaultProps=je;var Ae=n(169),Te=Math.PI/3,Me=[0,Te,2*Te,3*Te,4*Te,5*Te];function Le(e){return e[0]}function Ie(e){return e[1]}var Re=function(){var e,t,n,i=0,r=0,a=1,o=1,s=Le,u=Ie;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var g=l-d,p=d+(ly*y+b*b&&(d=p+(1&h?1:-1)/2,h=m)}var _=d+"-"+h,x=r[_];x?x.push(c):(a.push(x=r[_]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return a}function l(e){var t=0,n=0;return Me.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.transitions,o=this.state,s=o.angle,u=o.radius;return new(this.getSubLayerClass("hexagon-cell",Ae.a))({radius:u,diskResolution:6,elevationScale:t,angle:s,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(pe.a);Be.layerName="HexagonLayer",Be.defaultProps=De;var Ue,Ve=n(22),Ge=n(221),We=n(130),He={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Xe=[He.W,He.SW,He.S],qe=[He.S,He.SE,He.E],Ze=[He.E,He.NE,He.N],Ye=[He.NW,He.W,He.N],Ke=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],Qe=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Je=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],$e=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],et=[He.W,He.SW,He.SE,He.E],tt=[He.S,He.SE,He.NE,He.N],nt=[He.NW,He.W,He.E,He.NE],it=[He.NW,He.SW,He.S,He.N],rt=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],at=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],ot=[He.NW,He.SW,He.SE,He.NE],st=[He.NW,He.SW,He.SE,He.E,He.N],ut=[He.W,He.SW,He.SE,He.NE,He.N],ct=[He.NW,He.W,He.S,He.SE,He.NE],lt=[He.NW,He.SW,He.S,He.E,He.NE],ft=[He.NW,He.W,[.5,-1/6],[.5,1/6],He.N],ht=[[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],dt=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E],vt=[He.W,He.SW,He.S,[1/6,.5],[-1/6,.5]],gt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.N],pt=[[-.5,1/6],[-.5,-1/6],He.E,He.NE,He.N],mt=[He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],yt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6]],bt=[He.W,He.SW,He.SE,He.E,[1/6,.5],[-1/6,.5]],_t=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.NE,He.N],xt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.E,He.NE],wt=[He.NW,He.SW,He.S,[.5,-1/6],[.5,1/6],He.N],Ot=[He.W,He.SW,He.S,He.E,He.NE,He.N],Pt=[He.NW,He.W,He.S,He.SE,He.E,He.N],St=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],jt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],kt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],He.N],Ct=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],Et=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],At={0:[],1:[[He.W,He.S]],2:[[He.S,He.E]],3:[[He.W,He.E]],4:[[He.N,He.E]],5:{0:[[He.W,He.S],[He.N,He.E]],1:[[He.W,He.N],[He.S,He.E]]},6:[[He.N,He.S]],7:[[He.W,He.N]],8:[[He.W,He.N]],9:[[He.N,He.S]],10:{0:[[He.W,He.N],[He.S,He.E]],1:[[He.W,He.S],[He.N,He.E]]},11:[[He.N,He.E]],12:[[He.W,He.E]],13:[[He.S,He.E]],14:[[He.W,He.S]],15:[]};function Tt(e){return parseInt(e,4)}var Mt=(Ue={},P()(Ue,Tt("0000"),[]),P()(Ue,Tt("2222"),[]),P()(Ue,Tt("2221"),[Xe]),P()(Ue,Tt("2212"),[qe]),P()(Ue,Tt("2122"),[Ze]),P()(Ue,Tt("1222"),[Ye]),P()(Ue,Tt("0001"),[Xe]),P()(Ue,Tt("0010"),[qe]),P()(Ue,Tt("0100"),[Ze]),P()(Ue,Tt("1000"),[Ye]),P()(Ue,Tt("2220"),[Ke]),P()(Ue,Tt("2202"),[Qe]),P()(Ue,Tt("2022"),[Je]),P()(Ue,Tt("0222"),[$e]),P()(Ue,Tt("0002"),[Ke]),P()(Ue,Tt("0020"),[Qe]),P()(Ue,Tt("0200"),[Je]),P()(Ue,Tt("2000"),[$e]),P()(Ue,Tt("0011"),[et]),P()(Ue,Tt("0110"),[tt]),P()(Ue,Tt("1100"),[nt]),P()(Ue,Tt("1001"),[it]),P()(Ue,Tt("2211"),[et]),P()(Ue,Tt("2112"),[tt]),P()(Ue,Tt("1122"),[nt]),P()(Ue,Tt("1221"),[it]),P()(Ue,Tt("2200"),[rt]),P()(Ue,Tt("2002"),[at]),P()(Ue,Tt("0022"),[rt]),P()(Ue,Tt("0220"),[at]),P()(Ue,Tt("1111"),[ot]),P()(Ue,Tt("1211"),[st]),P()(Ue,Tt("2111"),[ut]),P()(Ue,Tt("1112"),[ct]),P()(Ue,Tt("1121"),[lt]),P()(Ue,Tt("1011"),[st]),P()(Ue,Tt("0111"),[ut]),P()(Ue,Tt("1110"),[ct]),P()(Ue,Tt("1101"),[lt]),P()(Ue,Tt("1200"),[ft]),P()(Ue,Tt("0120"),[ht]),P()(Ue,Tt("0012"),[dt]),P()(Ue,Tt("2001"),[vt]),P()(Ue,Tt("1022"),[ft]),P()(Ue,Tt("2102"),[ht]),P()(Ue,Tt("2210"),[dt]),P()(Ue,Tt("0221"),[vt]),P()(Ue,Tt("1002"),[gt]),P()(Ue,Tt("2100"),[pt]),P()(Ue,Tt("0210"),[mt]),P()(Ue,Tt("0021"),[yt]),P()(Ue,Tt("1220"),[gt]),P()(Ue,Tt("0122"),[pt]),P()(Ue,Tt("2012"),[mt]),P()(Ue,Tt("2201"),[yt]),P()(Ue,Tt("0211"),[bt]),P()(Ue,Tt("2110"),[_t]),P()(Ue,Tt("1102"),[xt]),P()(Ue,Tt("1021"),[wt]),P()(Ue,Tt("2011"),[bt]),P()(Ue,Tt("0112"),[_t]),P()(Ue,Tt("1120"),[xt]),P()(Ue,Tt("1201"),[wt]),P()(Ue,Tt("2101"),[Ot]),P()(Ue,Tt("0121"),[Ot]),P()(Ue,Tt("1012"),[Pt]),P()(Ue,Tt("1210"),[Pt]),P()(Ue,Tt("0101"),{0:[Xe,Ze],1:[Ot],2:[Ot]}),P()(Ue,Tt("1010"),{0:[Ye,qe],1:[Pt],2:[Pt]}),P()(Ue,Tt("2121"),{0:[Ot],1:[Ot],2:[Xe,Ze]}),P()(Ue,Tt("1212"),{0:[Pt],1:[Pt],2:[Ye,qe]}),P()(Ue,Tt("2120"),{0:[St],1:[St],2:[Ke,Ze]}),P()(Ue,Tt("2021"),{0:[jt],1:[jt],2:[Xe,Je]}),P()(Ue,Tt("1202"),{0:[kt],1:[kt],2:[Ye,Qe]}),P()(Ue,Tt("0212"),{0:[Ct],1:[Ct],2:[qe,$e]}),P()(Ue,Tt("0102"),{0:[Ke,Ze],1:[St],2:[St]}),P()(Ue,Tt("0201"),{0:[Xe,Je],1:[jt],2:[jt]}),P()(Ue,Tt("1020"),{0:[Ye,Qe],1:[kt],2:[kt]}),P()(Ue,Tt("2010"),{0:[qe,$e],1:[Ct],2:[Ct]}),P()(Ue,Tt("2020"),{0:[$e,Qe],1:[Et],2:[Ke,Je]}),P()(Ue,Tt("0202"),{0:[Je,Ke],1:[Et],2:[$e,Qe]}),Ue),Lt={ISO_LINES:1,ISO_BANDS:2},It={zIndex:0,zOffset:.005};function Rt(e,t){return Array.isArray(t)?e=t?1:0}function Ft(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,f=s||u||c||l,h={},d={};s||l?d.top=0:(h.top=t[(i+1)*r+n],d.top=Rt(h.top,o)),u||l?d.topRight=0:(h.topRight=t[(i+1)*r+n+1],d.topRight=Rt(h.topRight,o)),u||c?d.right=0:(h.right=t[i*r+n+1],d.right=Rt(h.right,o)),s||c?d.current=0:(h.current=t[i*r+n],d.current=Rt(h.current,o));var v=d.top,g=d.topRight,p=d.right,y=d.current,b=-1;Number.isFinite(o)&&(b=v<<3|g<<2|p<<1|y),Array.isArray(o)&&(b=v<<6|g<<4|p<<2|y);var _=0;return f||(_=Rt((h.top+h.topRight+h.right+h.current)/4,o)),{code:b,meanCode:_}}function Dt(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?Lt.ISO_LINES:s,c=Object.assign({},It,e.thresholdData),l=u===Lt.ISO_BANDS?Mt[a]:At[a];Array.isArray(l)||(l=l[o]);var f=c.zIndex*c.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+h,g=t[1]+d;if(u===Lt.ISO_BANDS){var p=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=g+e[1]*n[1];t.push([i,r,f])}),p.push(t)}),p}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=g+e[1]*n[1];m.push([t,i,f])})}),m}var Nt=n(64),zt=n(31),Bt=g.experimental.count,Ut=k.a.fp64LowPart,Vt=6378e3;function Gt(e){return Number.isFinite(e)?e:0}function Wt(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,f=void 0===l?zt.a.LNGLAT:l,h=e.viewport,d=void 0===h?null:h,v=e.boundingBox,g=void 0===v?null:v,y={};o.dataChanged&&(g=(y=function(e,t,n){var i,r,a=Bt(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,f=-1/0,h={};for(var d in n)h[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(p.a)(e),g=v.iterable,m=v.objectInfo,y=!0,b=!1,_=void 0;try{for(var x,w=g[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;m.index++;var P=t(O,m),S=m.index;for(var j in r=P[0],i=P[1],o[2*S]=r,o[2*S+1]=i,s[2*S]=Ut(r),s[2*S+1]=Ut(i),n){var k=n[j].getWeight(O);Array.isArray(k)?(h[j].values[3*S]=k[0],h[j].values[3*S+1]=k[1],h[j].values[3*S+2]=k[2]):h[j].values[3*S]=k}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rf?r:f)}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var C={xMin:Gt(l),xMax:Gt(f),yMin:Gt(u),yMax:Gt(c)};return{positions:o,positions64xyLow:s,weights:h,boundingBox:C}}(t,n,s)).boundingBox);var b=[i,i],_=[0,0];switch(m.a.assert(f===zt.a.LNGLAT||f===zt.a.IDENTITY),f){case zt.a.LNGLAT:case zt.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/Vt*(180/Math.PI)),i=(r=t,a=e,a/Vt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(g,i);b=[x.xOffset,x.yOffset],_=[-180,-90];break;case zt.a.IDENTITY:_=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=Ht(o-i[0],n[0])+i[0],c=Ht(r-i[1],n[1])+i[1],l=(new Nt.a).translate([-1*u,-1*c,0]),f=[u,c],h=s-o+n[0],d=a-r+n[1],v=[Math.ceil(h/n[0]),Math.ceil(d/n[1])];return{gridOrigin:f,gridSize:v,width:h,height:d,gridTransformMatrix:l}}({boundingBox:g,cellSize:b,worldOrigin:_});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:b,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:b,boundingBox:g}}function Ht(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Xt=[255,255,255,255],qt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},Zt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new se(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ge.a(this._getLineLayerProps()),r&&new We.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:f,gridOrigin:h,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking",k.a]})}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new Kt.a,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,f=n.gridOffset,h=n.elevationRange,d=[Object(Yt.c)(l[0]),Object(Yt.c)(l[1])],v=[Object(Yt.c)(f[0]),Object(Yt.c)(f[1])],g=this.getDomainUniforms(),p={colorMaxMinBuffer:i.color.maxMinBuffer,elevationMaxMinBuffer:i.elevation.maxMinBuffer},m=x(this.props.colorRange);this.bindUniformBuffers(p),this.state.model.setUniforms(Object.assign({},t,g,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:d,gridOffset:f,gridOffsetLow:v,colorRange:m,elevationRange:h})).draw(),this.unbindUniformBuffers(p)}},{key:"bindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.bind({target:35345,index:0}),n.bind({target:35345,index:1})}},{key:"unbindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.unbind({target:35345,index:0}),n.unbind({target:35345,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(b.a);$t.layerName="GPUGridCellLayer",$t.defaultProps=Jt;var en={colorDomain:null,colorRange:_,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new ge.a,gpuAggregation:!0},tn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=se.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new se(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,f=c.getPosition,h=this.state.gridHash;if(!h)h=Pe(l,this.props.cellSize,f).gridHash,this.setState({gridHash:h});var d=h[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,f=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:N[s]||N[en.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:N[c]||N[en.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),h=f.weights,d=f.gridSize,v=f.gridOrigin,g=f.cellSize,p=f.boundingBox;this.setState({weights:h,gridSize:d,gridOrigin:v,cellSize:g,boundingBox:p})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.elevationRange,s=e.colorDomain,u=e.elevationDomain,c=this.state,l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=x(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",$t))({gridSize:f,gridOrigin:h,gridOffset:d,colorRange:v,elevationRange:o,colorDomain:s,elevationDomain:u,cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:l,numInstances:f[0]*f[1]})}}]),t}(pe.a);tn.layerName="GPUGridLayer",tn.defaultProps=en;var nn=Object.assign({},tn.defaultProps,Ee.defaultProps,{gpuAggregation:!1}),rn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",tn):this.getSubLayerClass("CPU",Ee))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!se.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(pe.a);rn.layerName="GridLayer",rn.defaultProps=nn;var an=new Float32Array(12);function on(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=0,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0)for(var u=o.value,c=0;c 0.5) {\n discard;\n }\n gl_FragColor.rgb = weightsTexture.rgb * gaussianKDE(2. * dist);\n gl_FragColor.a = 1.0;\n}\n",modules:["project32"],elementCount:1,_targetTexture:n,_targetTextureVarying:"weightsTexture"});this.state={textureSize:t,weightsTexture:n,maxWeightsTexture:i,weightsTransform:r,model:r.model,maxWeightTransform:new I.a(e,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:n},_targetTexture:i,_targetTextureVarying:"outTexture",vs:"#version 300 es\nin vec4 inTexture;\nout vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\n}\n",elementCount:t*t}),zoom:null,triPositionBuffer:new T.a(e,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new T.a(e,{byteLength:48,accessor:{size:2}})}}},{key:"_updateMaxWeightValue",value:function(){this.state.maxWeightTransform.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}},{key:"_updateBounds",value:function(){var e,t,n,i,r,a,o,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0],u=this.state.textureSize,c=this.context.viewport,l=[c.unproject([0,0]),c.unproject([c.width,0]),c.unproject([c.width,c.height]),c.unproject([0,c.height])],f=(t=(e=l).map(function(e){return e[0]}),n=e.map(function(e){return e[1]}),i=Math.min.apply(null,t),r=Math.max.apply(null,t),[i,Math.min.apply(null,n),r,Math.max.apply(null,n)]),h=this._worldToCommonBounds(f),d={visibleWorldBounds:f,viewportCorners:l},v=!1;if(s||!this.state.worldBounds||(a=this.state.worldBounds,!((o=f)[0]>=a[0]&&o[2]<=a[2]&&o[1]>=a[1]&&o[3]<=a[3]))){var g=sn(h,2*u,2*u),p=this._commonToWorldBounds(g);this.props.coordinateSystem===zt.a.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 m=this._worldToCommonBounds(p,{scaleToAspect:!0,normalize:!0,width:2*u,height:2*u});d.worldBounds=p,d.normalizedCommonBounds=m,v=!0}return this.setState(d),v}},{key:"_updateTextureRenderingBounds",value:function(){var e=this.state,t=e.triPositionBuffer,n=e.triTexCoordBuffer,i=e.normalizedCommonBounds,r=e.viewportCorners,a=this.context.viewport,o=i.map(function(e){return e*a.scale});t.subData(on(r,3));var s=r.map(function(e){return t=a.projectPosition(e),n=o,i=j()(n,4),r=i[0],s=i[1],u=i[2],c=i[3],[(t[0]-r)/(u-r),(t[1]-s)/(c-s)];var t,n,i,r,s,u,c});n.subData(on(s,2))}},{key:"_updateColorTexture",value:function(e){var t=e.props.colorRange,n=this.state.colorTexture,i=x(t,!0);n?n.setImageData({data:i,width:t.length}):n=te(this.context.gl,{data:i,width:t.length,parameters:hn}),this.setState({colorTexture:n})}},{key:"_updateWeightmap",value:function(){var e=this.props.radiusPixels,t=this.state,n=t.weightsTransform,i=t.worldBounds,r=t.textureSize;this._updateAttributes(this.props);var a=Object.assign(Object.create(this.props),{viewport:this.context.viewport,pickingActive:0}),o=this._worldToCommonBounds(i,{useLayerCoordinateSystem:!0,scaleToAspect:!0,width:2*r,height:2*r}),s=Object.assign({},n.model.getModuleUniforms(a),{radiusPixels:e,commonBounds:o,textureWidth:r});n.update({elementCount:this.getNumInstances()}),n.run({uniforms:s,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0}),this._updateMaxWeightValue(),this.setState({lastUpdate:Date.now()})}},{key:"_debouncedUpdateWeightmap",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.state.updateTimer,n=Date.now()-this.state.lastUpdate;e&&(t=null),n>=500?(this._updateBounds(!0),this._updateWeightmap(),this._updateTextureRenderingBounds()):t||(t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),500-n)),this.setState({updateTimer:t})}},{key:"_worldToCommonBounds",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.useLayerCoordinateSystem,a=void 0!==r&&r,o=i.scaleToAspect,s=void 0!==o&&o,u=i.width,c=i.height,l=j()(e,4),f=l[0],h=l[1],d=l[2],v=l[3],g=this.context.viewport;a?(t=this.projectPosition([f,v,0]),n=this.projectPosition([d,h,0])):(t=g.projectPosition([f,v,0]),n=g.projectPosition([d,h,0]));var p=t.slice(0,2).concat(n.slice(0,2));return s&&(p=sn(p,u,c)),i.normalize&&(p=p.map(function(e){return e/g.scale})),p}},{key:"_commonToWorldBounds",value:function(e){var t=j()(e,4),n=t[0],i=t[1],r=t[2],a=t[3],o=this.context.viewport,s=o.unprojectPosition([n,a]),u=o.unprojectPosition([r,i]);return s.slice(0,2).concat(u.slice(0,2))}}]),t}(pe.a);vn.layerName="HeatmapLayer",vn.defaultProps=dn,n.d(t,"experimental",function(){return gn}),n.d(t,"ScreenGridLayer",function(){return ve}),n.d(t,"CPUGridLayer",function(){return Ee}),n.d(t,"HexagonLayer",function(){return Be}),n.d(t,"ContourLayer",function(){return Zt}),n.d(t,"GridLayer",function(){return rn}),n.d(t,"GPUGridLayer",function(){return tn}),n.d(t,"AGGREGATION_OPERATION",function(){return N}),n.d(t,"HeatmapLayer",function(){return vn}),n.d(t,"_GPUGridAggregator",function(){return se});var gn={BinSorter:be,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:we,quantizeScale:_e,getQuantizeScale:xe,defaultColorRange:_}},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(129),y=n(125),b=n(58),_=n(191),x=n(30),w=n(93),O=Math.PI/180,P=new Float32Array(16),S=new Float32Array(12);function j(e,t,n){var i=t[0]*O,r=t[1]*O,a=t[2]*O,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),f=Math.cos(r),h=n[0],d=n[1],v=n[2];e[0]=h*f*l,e[1]=h*u*l,e[2]=h*-s,e[3]=d*(-u*c+f*s*o),e[4]=d*(f*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+f*s*c),e[7]=v*(-f*o+u*s*c),e[8]=v*l*c}function k(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var C={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),f=l&&16===c.length,h=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),p=f||!l&&Boolean(c(a[0]));e.constant=p?f:d&&h&&v;var m=e.value;if(e.constant){var y;if(p)P.set(c),y=k(P);else j(y=S,o,s),y.set(u,9);e.value=new Float32Array(y)}else{var b=n*e.size,_=Object(g.a)(a,n,i),x=_.iterable,w=_.objectInfo,O=!0,C=!1,E=void 0;try{for(var A,T=x[Symbol.iterator]();!(O=(A=T.next()).done);O=!0){var M=A.value;w.index++;var L=void 0;if(p)P.set(f?c:c(M,w)),L=k(P);else j(L=S,d?o:o(M,w),h?s:s(M,w)),L.set(v?u:u(M,w),9);m[b++]=L[0],m[b++]=L[1],m[b++]=L[2],m[b++]=L[3],m[b++]=L[4],m[b++]=L[5],m[b++]=L[6],m[b++]=L[7],m[b++]=L[8],m[b++]=L[9],m[b++]=L[10],m[b++]=L[11]}}catch(e){C=!0,E=e}finally{try{O||null==T.return||T.return()}finally{if(C)throw E}}}}};function E(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function A(e){if(e.attributes)return E(e.attributes),e instanceof b.a?e:new b.a(e);if(e.positions||e.POSITION)return E(e),new b.a({attributes:e});throw Error("Invalid mesh")}var T={mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},wireframe:!1,material:new _.a,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},M=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=Object(x.d)(this.context.gl),n=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n",i=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor, color.a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";return h()(l()(t.prototype),"getShaders",this).call(this,{vs:n,fs:i,modules:["project32","phong-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:C}),this.setState({emptyTexture:new y.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||r.extensionsChanged){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new w.a(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:A(e),isInstanced:!0,shaderCache:this.context.shaderCache})),n=this.state,i=n.texture,r=n.emptyTexture;return t.setUniforms({sampler:i||r,hasTexture:Boolean(i)}),t}},{key:"setTexture",value:function(e){var t=this.context.gl,n=this.state,i=n.emptyTexture,r=n.model;this.state.texture&&this.state.texture.delete();var a=e?function(e,t,n){return t instanceof y.a?t:new y.a(e,Object.assign({data:t},n))}(t,e):null;this.setState({texture:a}),r&&r.setUniforms({sampler:a||i,hasTexture:Boolean(a)})}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);M.layerName="SimpleMeshLayer",M.defaultProps=T;var L=n(35),I=n.n(L),R=n(92),F=n(26),D=n(218),N=n(4),z=n(5),B=n(64),U=n(211),V=n(43),G=n(59),W=n(19),H=n(10),X=n(9),q=n(11),Z=n(133),Y=n(22),K=n(12);var Q=n(40),J=n(37);function $(){var e=new K.a(4);return K.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ee(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function te(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=i*l+o*s+r*c-a*u,e[1]=r*l+o*u+a*s-i*c,e[2]=a*l+o*c+i*u-r*s,e[3]=o*l-i*s-r*u-a*c,e}function ne(e,t,n,i){var r,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=n[0],v=n[1],g=n[2],p=n[3];return(a=c*d+l*v+f*g+h*p)<0&&(a=-a,d=-d,v=-v,g=-g,p=-p),1-a>K.b?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,u=Math.sin(i*r)/o):(s=1-i,u=i),e[0]=s*c+u*d,e[1]=s*l+u*v,e[2]=s*f+u*g,e[3]=s*h+u*p,e}function ie(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*n,n=.5/n,e[3]=(t[3*a+o]-t[3*o+a])*n,e[a]=(t[3*a+r]+t[3*r+a])*n,e[o]=(t[3*o+r]+t[3*r+o])*n}return e}J.b,J.g,J.c;var re,ae,oe,se,ue,ce,le,fe=J.l,he=J.a,de=J.k,ve=J.d,ge=J.i,pe=J.h,me=J.m,ye=J.j,be=(J.f,J.e,re=Q.b(),ae=Q.e(1,0,0),oe=Q.e(0,1,0),function(e,t,n){var i=Q.d(t,n);return i<-.999999?(Q.c(re,ae,t),Q.f(re)<1e-6&&Q.c(re,oe,t),Q.i(re,re),ee(e,re,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Q.c(re,t,n),e[0]=re[0],e[1]=re[1],e[2]=re[2],e[3]=1+i,ye(e,e))}),_e=(se=$(),ue=$(),ce=new K.a(9),K.a!=Float32Array&&(ce[1]=0,ce[2]=0,ce[3]=0,ce[5]=0,ce[6]=0,ce[7]=0),ce[0]=1,ce[4]=1,ce[8]=1,le=ce,[0,0,0,1]);var xe=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(N.a)(this,t),e=Object(H.a)(this,Object(X.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,a),e}return Object(q.a)(t,e),Object(z.a)(t,[{key:"fromMatrix3",value:function(e){return ie(this,e),this.check()}},{key:"fromValues",value:function(e,t,n,i){return this.set(e,t,n,i)}},{key:"identity",value:function(){var e;return(e=this)[0]=0,e[1]=0,e[2]=0,e[3]=1,this.check()}},{key:"length",value:function(){return pe(this)}},{key:"squaredLength",value:function(e){return me(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ve(this,e)}},{key:"rotationTo",value:function(e,t){return be(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return he(this,e),this.check()}},{key:"calculateW",value:function(){var e,t,n,i,r;return e=this,n=(t=this)[0],i=t[1],r=t[2],e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),this.check()}},{key:"conjugate",value:function(){var e,t;return t=this,(e=this)[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],this.check()}},{key:"invert",value:function(){var e,t,n,i,r,a,o,s;return e=this,n=(t=this)[0],i=t[1],r=t[2],a=t[3],s=(o=n*n+i*i+r*r+a*a)?1/o:0,e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=a*s,this.check()}},{key:"lerp",value:function(e,t,n){return ge(this,e,t,n),this.check()}},{key:"multiply",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.multiply only takes one argument");return te(this,this,e),this.check()}},{key:"normalize",value:function(){return ye(this,this),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+o*s,e[1]=r*u+a*s,e[2]=a*u-r*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u-a*s,e[1]=r*u+o*s,e[2]=a*u+i*s,e[3]=o*u-r*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return de(this,this,e),this.check()}},{key:"set",value:function(e,t,n,i){return fe(this,e,t,n,i),this.check()}},{key:"setAxisAngle",value:function(e,t){return ee(this,e,t),this.check()}},{key:"slerp",value:function(e){var t=e.start;return ne(this,void 0===t?_e:t,e.target,e.ratio),this.check()}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=Object(Y.a)(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=Object(Y.a)(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(Y.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(Y.a)(e)}}]),t}(Z.a),we={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Oe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Pe(e){if(!e._animation){var t=Oe[e.componentType],n=we[e.type],i=n*e.count,r=e.bufferView.data,a=new t(r.buffer,r.byteOffset+(e.byteOffset||0),i);if(1===n)e._animation=Array.from(a);else{for(var o=[],s=0;s=s}),c=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:F.a.warn("Bad animation path ".concat(i))()}Object(W.a)(n[i].length===o[c].length);var l=r[c],f=r[u];switch(a){case"STEP":!function(e,t,n){for(var i=0;il){var h=(s-l)/(f-l);!function(e,t,n,i,r){if("rotation"===t){je.slerp({start:n,target:i,ratio:r});for(var a=0;al){var d=(s-l)/(f-l),v=f-l;!function(e,t,n){for(var i=n.p0,r=n.outTangent0,a=n.inTangent1,o=n.p1,s=n.tDiff,u=n.ratio,c=0;c2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},r=new y.a(this.gl,{id:e.name||e.id,parameters:i,pixelStore:Object(Me.a)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1),data:e.texture.source.getImageAsync()});this.uniforms[t]=r,this.defineIfPresent(n,n),this.generatedTextures.push(r)}},{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 t=e.metallicFactor,n=void 0===t?1:t,i=e.roughnessFactor,r=void 0===i?1:i;this.uniforms.u_MetallicRoughnessValues=[n,r]}},{key:"parseMaterial",value:function(e){if(e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,n=void 0===t?1:t;this.uniforms.u_NormalScale=n}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,r=void 0===i?1:i;this.uniforms.u_OcclusionStrength=r}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(F.a.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]}))}}]),e}(),Ie="\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n",Re="\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n";function Fe(e,t){return Object(x.d)(e)?"#version 300 es\n".concat(t):t}var De={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ne={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},ze=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(N.a)(this,e),this.gl=t,this.options=Object.assign({},Ne,n)}return Object(z.a)(e,[{key:"instantiate",value:function(e){var t=this;return this.gltf=e,(e.scenes||[]).map(function(e){return t.createScene(e)})}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new Ee(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new U.a({id:e.name||e.id,children:n})}},{key:"createNode",value:function(e){var t=this;if(!e._node){var n=(e.children||[]).map(function(e){return t.createNode(e)});e.mesh&&n.push(this.createMesh(e.mesh));var i=new U.a({id:e.name||e.id,children:n});if(e.matrix)i.setMatrix(e.matrix);else{if(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation){var r=(new B.a).fromQuaternion(e.rotation);i.matrix.multiplyRight(r)}e.scale&&i.matrix.scale(e.scale)}e._node=i}return e._node}},{key:"createMesh",value:function(e){var t=this;if(!e._mesh){var n=(e.primitives||[]).map(function(n,i){return t.createPrimitive(n,i,e)}),i=new U.a({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){F.a.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,t,n){return function(e,t){var n=t.id,i=t.drawMode,r=t.vertexCount,a=t.attributes,o=t.modelOptions,s=new Le(e,t);F.a.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,Object(Ae.a)(s.generatedTextures)),u.push.apply(u,Object(Ae.a)(Object.values(a).map(function(e){return e.buffer})));var c=new Te.a(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[D.a],defines:s.defines,parameters:s.parameters,vs:Fe(e,Ie),fs:Fe(e,Re),managedResources:u},o));return c.setProps({attributes:a}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:e.name||"".concat(n.name||n.id,"-primitive-").concat(t),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))}},{key:"createAttributes",value:function(e,t){var n=this,i={};return Object.keys(e).forEach(function(t){i[t]=n.createAccessor(e[t],n.createBuffer(e[t],n.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),F.a.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}},{key:"createBuffer",value:function(e,t){e.bufferView||(e.bufferView={});var n=e.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new V.a(this.gl,{id:"from-".concat(n.id),data:n.data||e.value,target:t})),n.lumaBuffers[t]}},{key:"createAccessor",value:function(e,t){return new G.a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:De[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();var Be=n(50),Ue=n.n(Be),Ve=n(152),Ge=n.n(Ve);function We(){return(We=Ge()(Ue.a.mark(function e(t){var n;return Ue.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach(function(e){e.traverse(function(e){Object.values(e.model.program.uniforms).forEach(function(e){!1===e.loaded&&n.push(e)})})}),e.next=4,He(function(){return n.some(function(e){return!e.loaded})});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function He(e){return Xe.apply(this,arguments)}function Xe(){return(Xe=Ge()(Ue.a.mark(function e(t){return Ue.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise(function(e){return requestAnimationFrame(e)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}var qe=[255,255,255,255],Ze={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"===I()(e.scene)?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:qe},_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:[]}},Ye=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:qe,transition:!0},instanceModelMatrix:C})}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;n.scenegraph!==i.scenegraph?this._updateScenegraph(n):n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t,n=this,i=this.context.gl;if(e.scenegraph instanceof R.a)t={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,a=function(e,t,n){var i=new ze(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(i,r,this.getLoadOptions());t=Object.assign({gltf:r},a),function(e){return We.apply(this,arguments)}(a).then(function(){return n.setNeedsRedraw()})}else F.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader"),t=e.scenegraph;var o={layer:this,gl:i},s=e.getScene(t,o),u=e.getAnimator(t,o);s instanceof R.a?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&F.a.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).sort().forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r0)return e;e=function(e){var t=e.padEnd(16,"0");return O.a.fromString(t,16)}(e)}return x.S2.S2Cell.toHilbertQuadkey(e.toString())}function k(e){var t=j(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],f=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,S*Math.pow(2,-c)),d=0;d<4;d++)for(var v=f[d].slice(0),g=f[d+1],p=(g[0]-v[0])/h,m=(g[1]-v[1])/h,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(L.g)([r[0],r[3]],e.scale).map(R),o=_()(a,2),s=o[0],u=o[1],c=Object(L.g)([r[2],r[1]],e.scale).map(R),l=_()(c,2),f=l[0],h=l[1];s=Math.max(0,Math.floor(s)),f=Math.min(e.scale,Math.ceil(f)),u=Math.max(0,Math.floor(u)),h=Math.min(e.scale,Math.ceil(h));for(var d=[],v=s;vt?d.push(F({x:v,y:g,z:i},t)):d.push({x:v,y:g,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),N={renderSubLayers:{type:"function",value:function(e){return new A.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},z=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new D({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new D({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var f=i.viewport,h=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==f.id&&this.state.tileCache.update(f,function(e){var n=e.filter(function(e){return e.z===h}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"color.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){h()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),h()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),f=Object(U.a)(a,n,i),h=f.iterable,d=f.objectInfo,v=0,g=0;g180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function Q(e,t,n){var i=e(t,n),r=Object(G.h3ToGeo)(i),a=_()(r,2),o=a[0];return[a[1],o]}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(G.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(G.h3ToGeo)(e),r=_()(i,2),a=r[0],o=r[1],s=t.length;K(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(G.edgeLength)(i,G.UNITS.km):0,hasPentagon:r})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(G.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(G.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=J(a),u=Object(G.h3ToGeo)(a),c=_()(u,2),l=c[0],f=c[1],h=e.projectFlat([f,l]),d=_()(h,2),v=d[0],g=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-g)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.material,i=e.coverage,r=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getColor,d=e.getFillColor,v=e.getElevation,g=e.getLineColor,p=e.getLineWidth,m=e.updateTriggers;return{elevationScale:t,extruded:r,coverage:i,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:n,getElevation:v,getFillColor:h||d,getLineColor:g,getLineWidth:p,updateTriggers:{getFillColor:m.getColor||m.getFillColor,getElevation:m.getElevation,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===q()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return J(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",Y.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Q.bind(null,n)})}}]),t}(m.a);ee.defaultProps=$,ee.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return p}),n.d(t,"S2Layer",function(){return E}),n.d(t,"TileLayer",function(){return z}),n.d(t,"TripsLayer",function(){return V}),n.d(t,"H3ClusterLayer",function(){return H}),n.d(t,"H3HexagonLayer",function(){return ee})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(35),u=n.n(s);var c=n(163),l=n(213),f=n(214),h=n(215),d=n(6),v=n.n(d),g=n(3),p=n.n(g),m=n(7),y=n.n(m),b={fetch:function(e){return JSON.parse(e)},configuration:[]},_=function(e){function t(){return r()(this,t),v()(this,p()(t).apply(this,arguments))}return y()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layers:[]}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps;(e.changeFlags.dataChanged||t.configuration!==n.configuration)&&(this.state.layers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t){var n={};for(var i in e){var r=e[i];i.startsWith("get")?n[i]=D(r,t):n[i]=r}return n}(e,t);return r.fetch=N,i&&new i(r)})}(t.data,t.configuration))}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(192).a);function x(e,t){var n=function(e){if("string"==typeof e){var t=O[e];return t||(t=e.split("."),O[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=w(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function w(e){return null!==e&&"object"===u()(e)}_.layerName="JSONLayer",_.defaultProps=b;var O={};var P={},S={},j=34,k=10,C=13;function E(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var A=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return S;if(c)return c=!1,P;var t,i,r=o;if(e.charCodeAt(r)===j){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===k?c=!0:i===C&&(c=!0,e.charCodeAt(o)===k&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u]);Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var z=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=F(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return z}),n.d(t,"_JSONLayer",function(){return _})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(193),u=n(164);function c(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[770,771,1,771],blendEquation:32774},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:l(t)}),i=new s.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:l(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=h(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[f(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function l(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new u.a(Object.assign({x:0,y:0,width:e.width,height:e.height},l(t),n?{nearZMultiplier:e.height?1/e.height:1,farZMultiplier:1}:{nearZMultiplier:.1,farZMultiplier:10}))}function h(e,t){return e.layerManager.getLayers().filter(t)}function d(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function v(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var g=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=c({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),v(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),v(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&v(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=f(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:h(n,function(e){return d(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return g})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(193);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},f=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":t="pointermove",i=e._onPointerMove;break;case"mouseout":t="pointerleave",i=e._onPointerMove;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv().firstChild,i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),f=new google.maps.Point(0,0),h=a.fromContainerPixelToLatLng(f),d=a.fromLatLngToDivPixel(h),v=(c.x-l.x)/i,g=Math.log2(v)+e.getZoom()-1,p=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(p),y=m.lat(),b=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:g,pitch:e.getTilt(),latitude:y,longitude:b}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,f=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:f?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return f})},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(86),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()}])}); From 1e4d5d8fc4b90124d0a1445693b5df5bff2ac628 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Wed, 7 Aug 2019 08:10:43 +1000 Subject: [PATCH 09/24] heatmap example --- R/map_layer_heatmap.R | 11 ++++++++--- inst/htmlwidgets/lib/heatmap/heatmap.js | 18 +++++++++--------- man/add_heatmap.Rd | 13 ++++++++++--- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/R/map_layer_heatmap.R b/R/map_layer_heatmap.R index 4dc2c520..c7d32a59 100644 --- a/R/map_layer_heatmap.R +++ b/R/map_layer_heatmap.R @@ -13,8 +13,13 @@ mapdeckHeatmapDependency <- function() { #' Add Heatmap #' -#' The Screen Grid Layer takes in an array of latitude and longitude coordinated points, -#' aggregates them into histogram bins and renders as a grid +#' The Heatmap Layer can be used to visualise spatial distribution of data. +#' It implements Gaussian Kernel Density Estimation to render the heatmaps. +#' +#' @section note: +#' +#' The current version of this layer is supported only for WebGL2 enabled browswers +#' So you may find it doesn't render in the RStudio viewer. #' #' @inheritParams add_polygon #' @param lon column containing longitude values @@ -41,7 +46,7 @@ mapdeckHeatmapDependency <- function() { #' #' mapdeck( style = mapdeck_style('dark'), pitch = 45 ) %>% #' add_heatmap( -#' data = df[1:1000, ] +#' data = df #' , lat = "lat" #' , lon = "lng" #' , weight = "weight", diff --git a/inst/htmlwidgets/lib/heatmap/heatmap.js b/inst/htmlwidgets/lib/heatmap/heatmap.js index 711e9d08..33f92985 100644 --- a/inst/htmlwidgets/lib/heatmap/heatmap.js +++ b/inst/htmlwidgets/lib/heatmap/heatmap.js @@ -2,19 +2,19 @@ function add_heatmap_geo( map_id, map_type, heatmap_data, layer_id, colour_range const heatmapLayer = new deck.HeatmapLayer({ map_id: map_id, - id: 'screengrid-'+layer_id, + id: 'heatmap-'+layer_id, data: heatmap_data, - pickable: true, + //pickable: true, radiusPixels: 30, intensity: 1, - enhanceFactor: 20, + threshold: 0.05, colorRange: md_to_rgba( colour_range ), getPosition: d => md_get_point_coordinates( d ), - getWeight: d => d.properties.weight, + getWeight: d => d.properties.weight - onClick: info => md_layer_click( map_id, "heatmap", info ), + //onClick: info => md_layer_click( map_id, "heatmap", info ), }); @@ -32,19 +32,19 @@ function add_heatmap_polyline( map_id, map_type, heatmap_data, layer_id, colour_ const heatmapLayer = new deck.HeatmapLayer({ map_id: map_id, - id: 'screengrid-'+layer_id, + id: 'heatmap-'+layer_id, data: heatmap_data, - pickable: true, + //pickable: true, radiusPixels: 30, intensity: 1, - enhanceFactor: 20, + threshold: 0.05, colorRange: md_to_rgba( colour_range ), getPosition: d => md_get_point_coordinates( d ), getWeight: d => d.properties.weight, - onClick: info => md_layer_click( map_id, "heatmap", info ), + //onClick: info => md_layer_click( map_id, "heatmap", info ), }); if( map_type == "google_map") { md_update_overlay( map_id, 'heatmap-'+layer_id, heatmapLayer ); diff --git a/man/add_heatmap.Rd b/man/add_heatmap.Rd index e5ef1d4b..393f221b 100644 --- a/man/add_heatmap.Rd +++ b/man/add_heatmap.Rd @@ -34,12 +34,19 @@ to conflict and not plot correctly} \item{focus_layer}{logical indicating if the map should update the bounds to only include this layer} } \description{ -The Screen Grid Layer takes in an array of latitude and longitude coordinated points, -aggregates them into histogram bins and renders as a grid +The Heatmap Layer can be used to visualise spatial distribution of data. +It implements Gaussian Kernel Density Estimation to render the heatmaps. } \details{ \code{add_heatmap} supports POINT and MULTIPOINT sf objects } +\section{note}{ + + +The current version of this layer is supported only for WebGL2 enabled browswers +So you may find it doesn't render in the RStudio viewer. +} + \section{data}{ @@ -66,7 +73,7 @@ df$weight <- sample(1:10, size = nrow(df), replace = T) mapdeck( style = mapdeck_style('dark'), pitch = 45 ) \%>\% add_heatmap( - data = df[1:1000, ] + data = df , lat = "lat" , lon = "lng" , weight = "weight", From b7f177ba19fd71cca59c7d8f9f9310ca7facfc50 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Wed, 7 Aug 2019 08:37:17 +1000 Subject: [PATCH 10/24] tests --- tests/testthat/test-map_layers.R | 1 + tests/testthat/test-mapdeck_tokens.R | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/tests/testthat/test-map_layers.R b/tests/testthat/test-map_layers.R index 1bbeb293..c010b92e 100644 --- a/tests/testthat/test-map_layers.R +++ b/tests/testthat/test-map_layers.R @@ -9,6 +9,7 @@ test_that("layerId includes all layers", { , "geojson" , "greatcircle" , "grid" + , "heatmap" , "hexagon" , "line" , "mesh" diff --git a/tests/testthat/test-mapdeck_tokens.R b/tests/testthat/test-mapdeck_tokens.R index fd29bfa1..da663394 100644 --- a/tests/testthat/test-mapdeck_tokens.R +++ b/tests/testthat/test-mapdeck_tokens.R @@ -2,6 +2,11 @@ context("tokens") test_that("tokens accessed",{ + testthat::skip_on_appveyor() + testthat::skip_on_cran() + testthat::skip_on_travis() + testthat::skip("run these manually") + mapdeck::clear_tokens() expect_null( mapdeck:::get_access_token() ) From 0cf5bf03f5d2a2ce63ec9de21c574ba6b06467b8 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Fri, 9 Aug 2019 13:56:35 +1000 Subject: [PATCH 11/24] deck.gl v7.2.0-beta.3 --- inst/htmlwidgets/lib/deckgl.min.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/htmlwidgets/lib/deckgl.min.js b/inst/htmlwidgets/lib/deckgl.min.js index ea307ef5..312323e2 100644 --- a/inst/htmlwidgets/lib/deckgl.min.js +++ b/inst/htmlwidgets/lib/deckgl.min.js @@ -1,9 +1,9 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("h3"),require("S2"));else if("function"==typeof define&&define.amd)define(["h3","S2"],t);else{var n="object"==typeof exports?t(require("h3"),require("S2")):t(e.h3,e.S2);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=237)}([function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return i})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},i=g.b[t];if(Object(m.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in y)return y[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),y[t]=s,s}var _=n(59),x=n(43),w=n(61),O=n(196),P=n(60),S=n(95),j=n(125),k=n(159),C=n(112),E=n(80),A=n(176),T=n(160),M=n(201),L=n(106),I=n(202),R=n(4),F=n(5),D=n(73),N=5126,z=5124,B=5125,U=function(){function e(t){var n;for(var i in Object(R.a)(this,e),this.layout={},this.size=0,t)this._addUniform(i,t[i]);this.size+=(4-this.size%4)%4;var r=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,N,r),Object(c.a)(n,z,new Int32Array(r.buffer)),Object(c.a)(n,B,new Uint32Array(r.buffer)),n)}return Object(F.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[N]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Object(m.a)(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Object(D.a)(t);Object(m.a)(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}(),V=n(123),G=n(26),W=n(67),H=n(46);n.d(t,"S",function(){return r.a}),n.d(t,"A",function(){return a.a}),n.d(t,"B",function(){return a.b}),n.d(t,"V",function(){return a.d}),n.d(t,"X",function(){return a.e}),n.d(t,"N",function(){return o.c}),n.d(t,"O",function(){return o.d}),n.d(t,"w",function(){return s.a}),n.d(t,"J",function(){return u.b}),n.d(t,"I",function(){return u.a}),n.d(t,"E",function(){return v}),n.d(t,"H",function(){return d}),n.d(t,"F",function(){return h}),n.d(t,"D",function(){return f.a}),n.d(t,"c",function(){return g.a}),n.d(t,"L",function(){return p.b}),n.d(t,"M",function(){return p.c}),n.d(t,"G",function(){return p.a}),n.d(t,"t",function(){return b}),n.d(t,"a",function(){return _.a}),n.d(t,"b",function(){return x.a}),n.d(t,"i",function(){return w.b}),n.d(t,"q",function(){return w.c}),n.d(t,"d",function(){return w.a}),n.d(t,"f",function(){return O.a}),n.d(t,"e",function(){return P.a}),n.d(t,"h",function(){return S.a}),n.d(t,"j",function(){return j.a}),n.d(t,"l",function(){return k.a}),n.d(t,"u",function(){return C.a}),n.d(t,"v",function(){return C.b}),n.d(t,"T",function(){return E.e}),n.d(t,"U",function(){return E.f}),n.d(t,"x",function(){return E.b}),n.d(t,"y",function(){return E.c}),n.d(t,"z",function(){return E.d}),n.d(t,"s",function(){return E.a}),n.d(t,"g",function(){return A.a}),n.d(t,"k",function(){return T.a}),n.d(t,"m",function(){return M.a}),n.d(t,"p",function(){return L.a}),n.d(t,"o",function(){return I.a}),n.d(t,"n",function(){return U}),n.d(t,"Y",function(){return V.c}),n.d(t,"P",function(){return V.a}),n.d(t,"Q",function(){return V.b}),n.d(t,"R",function(){return G.a}),n.d(t,"r",function(){return m.a}),n.d(t,"Z",function(){return W.c}),n.d(t,"W",function(){return H.c}),n.d(t,"ab",function(){return H.d}),n.d(t,"K",function(){return H.b}),n.d(t,"C",function(){return H.a})},function(e,t,n){"use strict";var i=n(236);t.a=new i.a({id:"deck"}).enable()},function(e,t,n){var i=n(252),r=n(253),a=n(254);e.exports=function(e,t){return i(e)||r(e,t)||a()}},function(e,t,n){"use strict";n.r(t);var i=n(14),r=n(51),a=n(58),o=n(127),s=n(144),u=n(203),c=n(24),l=new Uint8Array([0,0,0]);function f(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function h(e){var t=Object(c.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function d(){return l}var v=n(93),g=n(223),p=n(101),m=n(189),y=n(34),b=n(4),_=n(5),x=n(124),w=n(134),O=n(19),P=n(26);var S=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.onInitialize,r=void 0===i?function(){}:i,a=n.onFinalize,o=void 0===a?function(){}:a,s=n.useDevicePixels,u=void 0===s||s,c=n.autoResizeDrawingBuffer,l=void 0===c||c;this.props={onInitialize:r,onFinalize:o},this.setProps({autoResizeDrawingBuffer:l,useDevicePixels:u}),Object(O.a)(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(_.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.onmessage=function(n){var i,r,a,o=n.data;switch(o.command){case"start":i=t,r=o.opts.canvas,a=new Map,r.addEventListener=function(e,t){i.postMessage({command:"addEventListener",type:e}),a.has(e)||a.set(e,[]),a.get(e).push(t)},r.removeEventListener=function(e,t){i.postMessage({command:"removeEventListener",type:e});var n=a.get(e);n&&n.splice(n.indexOf(t),1)},r.dispatchEvent=function(e,t){var n=a.get(e);n&&n.forEach(function(e){return e(t)})},i.canvas=r,e.start(o.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=o.width,t.canvas.height=o.height;break;case"event":t.canvas.dispatchEvent(o.type,o.event)}}}}}]),Object(_.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,Object(x.b)().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=Object(w.b)(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(Object(w.a)(this._animationFrameId),this._animationFrameId=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(y.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._animationFrameId=Object(w.b)(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=Object(x.a)(e);t.transferControlToOffscreen||P.a.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),j=n(10),k=n(9),C=n(11),E=n(60),A=n(70),T=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.id,r=void 0===i?"pass":i;this.id=r,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(_.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=E.a.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),Object(A.a)(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),M=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(T),L=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(b.a)(this,e),this.gl=t,this.framebuffer1=new E.a(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new E.a(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(_.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),I=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),i=Array.isArray(i)?{passes:i}:i,(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"multi-pass"},i)))).renderState=new L(e,i),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(M),R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){var e=this.gl,t=this.props.clearBits,n=void 0===t?16640:t;e.clear(n)}}]),t}(T),F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(T),D="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",N=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},i)))).clipspace=new p.a(e,{id:"copy-pass",fs:D}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),z="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",B=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,t),n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"texture-pass"},i)));var r=i.texture,a=i.opacity,o=void 0===a?1:a;return n.clipspace=new p.a(e,{id:"texture-pass",fs:z,uniforms:{uDiffuseSampler:r,uOpacity:o}}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),U=n(138),V=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),G=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(b.a)(this,t);var a="".concat(n.name,"-pass");Object(U.b)(n);var o=function(e,t,n,i){if(t.filter||t.sampler){var r=q(t),a=new V(e,{id:n,model:W(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=q(t,r),s="".concat(n,"-").concat(o.length+1);return new V(e,Object.assign({id:s,model:W(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,a,r);return(i=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:a,passes:o},r)))).module=n,i}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.props.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1;var l=c.props,f=l.uniforms,h=l.model;f&&h.setUniforms(f),h.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(M);function W(e,t,n,i,r){var a=new p.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var H=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},X=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return H(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return X(i)}return null}var Z=n(36),Y=n(67),K={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Q=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("truncated-code-geometry"):n,r=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,O=x(b),P=_(b),S=v?-2:0,j=l+(p?2:0),k=u+1,C=new Uint16Array(u*(l+m)*6),E=K[h],A=new Float32Array(3*y),T=new Float32Array(3*y),M=new Float32Array(2*y),L=0,I=0,R=S;R<=j;R++){var F=R/l,D=o*F,N=void 0;R<0?(D=0,F=1,N=n):R>l?(D=o,F=1,N=r):N=n+R/l*(r-n),-2!==R&&R!==l+2||(N=0,F=0),D-=o/2;for(var z=0;zl?0:B*O,T[L+E[1]]=R<0?-1:R>l?1:P,T[L+E[2]]=R<0||R>l?0:U*O,M[I+0]=z/u,M[I+1]=F,I+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cone-geometry"):n,r=e.radius,a=void 0===r?1:r,o=e.cap,s=void 0===o||o;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,topRadius:0,topCap:Boolean(s),bottomCap:Boolean(s),bottomRadius:a})))}return Object(C.a)(t,e),t}(Q),$=n(190),ee=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cylinder-geometry"):n,r=e.radius,a=void 0===r?1:r;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,bottomRadius:a,topRadius:a})))}return Object(C.a)(t,e),t}(Q),te=n(29),ne=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],ie=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],re=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("ico-sphere-geometry"):n,r=function(e){var t=e.iterations,n=void 0===t?0:t,i=Math.PI,r=2*i,a=[].concat(ne),o=[].concat(ie);a.push(),o.push();for(var s=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,r=t>n?t:n,o="".concat(i,"|").concat(r);if(o in e)return e[o];var s=a[t],u=a[t+1],c=a[t+2],l=a[n],f=a[n+1],h=a[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,a.push(d,v,g),e[o]=a.length/3-1}}(),u=0;u=0;p-=3){var m=o[p+0],y=o[p+1],b=o[p+2],_=3*m,x=3*y,w=3*b,O=2*m,P=2*y,S=2*b,j=a[_+0],k=a[_+1],C=a[_+2],E=Math.acos(C/Math.sqrt(j*j+k*k+C*C)),A=Math.atan2(k,j)+i,T=E/i,M=1-A/r,L=a[x+0],I=a[x+1],R=a[x+2],F=Math.acos(R/Math.sqrt(L*L+I*I+R*R)),D=Math.atan2(I,L)+i,N=F/i,z=1-D/r,B=a[w+0],U=a[w+1],V=a[w+2],G=Math.acos(V/Math.sqrt(B*B+U*U+V*V)),W=Math.atan2(U,B)+i,H=G/i,X=1-W/r,q=[B-L,U-I,V-R],Z=[j-L,k-I,C-R],Y=new te.a(q).cross(Z).normalize(),K=void 0;(0===M||0===z||0===X)&&(0===M||M>.5)&&(0===z||z>.5)&&(0===X||X>.5)&&(a.push(a[_+0],a[_+1],a[_+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=T,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[x+0],a[x+1],a[x+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=N,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[w+0],a[w+1],a[w+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=H,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z),v[_+0]=v[x+0]=v[w+0]=Y.x,v[_+1]=v[x+1]=v[w+1]=Y.y,v[_+2]=v[x+2]=v[w+2]=Y.z,g[O+0]=M,g[O+1]=T,g[P+0]=z,g[P+1]=N,g[S+0]=X,g[S+1]=H}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(g)}}}}(e),a=r.indices,o=r.attributes;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,indices:a,attributes:Object(Z.a)({},o,e.attributes)})))}return Object(C.a)(t,e),t}(a.a);var ae=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("plane-geometry"):n,r=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")]||1,f=e["".concat(c[1],"len")]||1,h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,O=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=O,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*O-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*O-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*O-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}y+=2,b+=3}for(var P=h+1,S=new Uint16Array(h*d*6),j=0;j0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("sphere-geometry"):n,r=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,O=s*y,P=Math.sin(w),S=Math.cos(w),j=Math.sin(O),k=Math.cos(O),C=S*j,E=k,A=P*j,T=o(C,E,A,m,y);f[x+0]=T*C,f[x+1]=T*E,f[x+2]=T*A,h[x+0]=C,h[x+1]=E,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var M=n+1,L=0;L0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.a)(this,t),(e=Object(j.a)(this,Object(k.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(C.a)(t,e),t}(ce.a),de=n(28);n.d(t,"isWebGL",function(){return i.N}),n.d(t,"isWebGL2",function(){return i.O}),n.d(t,"lumaStats",function(){return i.S}),n.d(t,"createGLContext",function(){return i.A}),n.d(t,"destroyGLContext",function(){return i.B}),n.d(t,"resizeGLContext",function(){return i.V}),n.d(t,"setGLContextDefaults",function(){return i.X}),n.d(t,"getContextInfo",function(){return i.E}),n.d(t,"getGLContextInfo",function(){return i.H}),n.d(t,"getContextLimits",function(){return i.F}),n.d(t,"FEATURES",function(){return i.c}),n.d(t,"hasFeature",function(){return i.L}),n.d(t,"hasFeatures",function(){return i.M}),n.d(t,"getFeatures",function(){return i.G}),n.d(t,"canCompileGLGSExtension",function(){return i.t}),n.d(t,"cloneTextureFrom",function(){return i.w}),n.d(t,"getKeyValue",function(){return i.J}),n.d(t,"getKey",function(){return i.I}),n.d(t,"setContextDefaults",function(){return i.X}),n.d(t,"glGetDebugInfo",function(){return i.D}),n.d(t,"trackContextState",function(){return r.g}),n.d(t,"resetParameters",function(){return r.d}),n.d(t,"getParameter",function(){return r.b}),n.d(t,"getParameters",function(){return r.c}),n.d(t,"setParameter",function(){return r.e}),n.d(t,"setParameters",function(){return r.f}),n.d(t,"withParameters",function(){return r.h}),n.d(t,"getModifiedParameters",function(){return r.a}),n.d(t,"Buffer",function(){return i.b}),n.d(t,"Shader",function(){return i.i}),n.d(t,"VertexShader",function(){return i.q}),n.d(t,"FragmentShader",function(){return i.d}),n.d(t,"Program",function(){return i.f}),n.d(t,"Framebuffer",function(){return i.e}),n.d(t,"Renderbuffer",function(){return i.h}),n.d(t,"Texture2D",function(){return i.j}),n.d(t,"TextureCube",function(){return i.l}),n.d(t,"clear",function(){return i.u}),n.d(t,"clearBuffer",function(){return i.v}),n.d(t,"readPixelsToArray",function(){return i.T}),n.d(t,"readPixelsToBuffer",function(){return i.U}),n.d(t,"copyToDataUrl",function(){return i.x}),n.d(t,"copyToImage",function(){return i.y}),n.d(t,"copyToTexture",function(){return i.z}),n.d(t,"blit",function(){return i.s}),n.d(t,"Query",function(){return i.g}),n.d(t,"Texture3D",function(){return i.k}),n.d(t,"TransformFeedback",function(){return i.m}),n.d(t,"VertexArrayObject",function(){return i.p}),n.d(t,"VertexArray",function(){return i.o}),n.d(t,"UniformBufferLayout",function(){return i.n}),n.d(t,"setPathPrefix",function(){return i.Y}),n.d(t,"loadFile",function(){return i.P}),n.d(t,"loadImage",function(){return i.Q}),n.d(t,"_Accessor",function(){return i.a}),n.d(t,"_clearBuffer",function(){return i.v}),n.d(t,"Geometry",function(){return a.a}),n.d(t,"Material",function(){return o.a}),n.d(t,"AmbientLight",function(){return s.a}),n.d(t,"DirectionalLight",function(){return s.b}),n.d(t,"PointLight",function(){return s.c}),n.d(t,"AnimationLoop",function(){return u.a}),n.d(t,"encodePickingColor",function(){return f}),n.d(t,"decodePickingColor",function(){return h}),n.d(t,"getNullPickingColor",function(){return d}),n.d(t,"Model",function(){return v.a}),n.d(t,"Transform",function(){return g.a}),n.d(t,"ClipSpace",function(){return p.a}),n.d(t,"_ShaderCache",function(){return m.a}),n.d(t,"_AnimationLoopProxy",function(){return S}),n.d(t,"_MultiPassRenderer",function(){return I}),n.d(t,"_RenderState",function(){return L}),n.d(t,"_Pass",function(){return T}),n.d(t,"_CompositePass",function(){return M}),n.d(t,"_ClearPass",function(){return R}),n.d(t,"_RenderPass",function(){return F}),n.d(t,"_CopyPass",function(){return N}),n.d(t,"_TexturePass",function(){return B}),n.d(t,"_ShaderModulePass",function(){return G}),n.d(t,"ConeGeometry",function(){return J}),n.d(t,"CubeGeometry",function(){return $.a}),n.d(t,"CylinderGeometry",function(){return ee}),n.d(t,"IcoSphereGeometry",function(){return re}),n.d(t,"PlaneGeometry",function(){return ae}),n.d(t,"SphereGeometry",function(){return oe}),n.d(t,"TruncatedConeGeometry",function(){return Q}),n.d(t,"PhongMaterial",function(){return se.a}),n.d(t,"PBRMaterial",function(){return ue}),n.d(t,"ScenegraphNode",function(){return ce.a}),n.d(t,"GroupNode",function(){return le.a}),n.d(t,"ModelNode",function(){return fe.a}),n.d(t,"CameraNode",function(){return he}),n.d(t,"registerShaderModules",function(){return de.v}),n.d(t,"setDefaultShaderModules",function(){return de.w}),n.d(t,"getDefaultShaderModules",function(){return de.l}),n.d(t,"assembleShaders",function(){return de.c}),n.d(t,"createShaderHook",function(){return de.g}),n.d(t,"createModuleInjection",function(){return de.f}),n.d(t,"combineInjects",function(){return de.d}),n.d(t,"normalizeShaderModule",function(){return de.q}),n.d(t,"fp32",function(){return de.j}),n.d(t,"fp64",function(){return de.k}),n.d(t,"project",function(){return de.u}),n.d(t,"lights",function(){return de.p}),n.d(t,"dirlight",function(){return de.i}),n.d(t,"picking",function(){return de.t}),n.d(t,"diffuse",function(){return de.h}),n.d(t,"gouraudlighting",function(){return de.o}),n.d(t,"phonglighting",function(){return de.s}),n.d(t,"pbr",function(){return de.r}),n.d(t,"_transform",function(){return de.b}),n.d(t,"MODULAR_SHADERS",function(){return de.a}),n.d(t,"getQualifierDetails",function(){return de.n}),n.d(t,"getPassthroughFS",function(){return de.m}),n.d(t,"typeToChannelSuffix",function(){return de.y}),n.d(t,"typeToChannelCount",function(){return de.x}),n.d(t,"convertToVec4",function(){return de.e}),n.d(t,"log",function(){return i.R}),n.d(t,"assert",function(){return i.r}),n.d(t,"uid",function(){return i.Z}),n.d(t,"self",function(){return i.W}),n.d(t,"window",function(){return i.ab}),n.d(t,"global",function(){return i.K}),n.d(t,"document",function(){return i.C})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return g}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return b});var i=n(12);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],g=t[13],p=t[14],m=t[15],y=n*s-i*o,b=n*u-r*o,_=n*c-a*o,x=i*u-r*s,w=i*c-a*s,O=r*c-a*u,P=l*g-f*v,S=l*p-h*v,j=l*m-d*v,k=f*p-h*g,C=f*m-d*g,E=h*m-d*p,A=y*E-b*C+_*k+x*j-w*S+O*P;return A?(A=1/A,e[0]=(s*E-u*C+c*k)*A,e[1]=(r*C-i*E-a*k)*A,e[2]=(g*O-p*w+m*x)*A,e[3]=(h*w-f*O-d*x)*A,e[4]=(u*j-o*E-c*S)*A,e[5]=(n*E-r*j+a*S)*A,e[6]=(p*_-v*O-m*b)*A,e[7]=(l*O-h*_+d*b)*A,e[8]=(o*C-s*j+c*P)*A,e[9]=(i*j-n*C-a*P)*A,e[10]=(v*w-g*_+m*y)*A,e[11]=(f*_-l*w-d*y)*A,e[12]=(s*S-o*k-u*P)*A,e[13]=(n*k-i*S+r*P)*A,e[14]=(g*b-v*x-p*y)*A,e[15]=(l*x-f*b+h*y)*A,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],v=e[13],g=e[14],p=e[15];return(t*o-n*a)*(f*p-h*g)-(t*s-i*a)*(l*p-h*v)+(t*u-r*a)*(l*g-f*v)+(n*s-i*o)*(c*p-h*d)-(n*u-r*o)*(c*g-f*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],g=t[12],p=t[13],m=t[14],y=t[15],b=n[0],_=n[1],x=n[2],w=n[3];return e[0]=b*i+_*s+x*f+w*g,e[1]=b*r+_*u+x*h+w*p,e[2]=b*a+_*c+x*d+w*m,e[3]=b*o+_*l+x*v+w*y,b=n[4],_=n[5],x=n[6],w=n[7],e[4]=b*i+_*s+x*f+w*g,e[5]=b*r+_*u+x*h+w*p,e[6]=b*a+_*c+x*d+w*m,e[7]=b*o+_*l+x*v+w*y,b=n[8],_=n[9],x=n[10],w=n[11],e[8]=b*i+_*s+x*f+w*g,e[9]=b*r+_*u+x*h+w*p,e[10]=b*a+_*c+x*d+w*m,e[11]=b*o+_*l+x*v+w*y,b=n[12],_=n[13],x=n[14],w=n[15],e[12]=b*i+_*s+x*f+w*g,e[13]=b*r+_*u+x*h+w*p,e[14]=b*a+_*c+x*d+w*m,e[15]=b*o+_*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,f,h,d,v,g=n[0],p=n[1],m=n[2];return t===e?(e[12]=t[0]*g+t[4]*p+t[8]*m+t[12],e[13]=t[1]*g+t[5]*p+t[9]*m+t[13],e[14]=t[2]*g+t[6]*p+t[10]*m+t[14],e[15]=t[3]*g+t[7]*p+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=v,e[12]=i*g+s*p+f*m+t[12],e[13]=r*g+u*p+h*m+t[13],e[14]=a*g+c*p+d*m+t[14],e[15]=o*g+l*p+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,f,h,d,v,g,p,m,y,b,_,x,w,O,P,S,j,k,C,E=r[0],A=r[1],T=r[2],M=Math.sqrt(E*E+A*A+T*T);return M0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=Ce.a,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return u()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64,a=e.dataChanged;if(this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,Array.isArray(a)){var o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;this._rebuildGeometry(f)}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(je.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.opts=t}return u()(e,[{key:"equals",value:function(e){return this===e||this.constructor===e.constructor&&Object(Le.a)(this.opts,e.opts)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var t=e.constructor.defaultProps,n=void 0===t?{}:t,i={updateTriggers:{}};for(var r in n)if(r in this.props){var a=n[r],o=this.props[r];i[r]=o,a&&"accessor"===a.type&&(i.updateTriggers[r]=this.props.updateTriggers[r],"function"==typeof o&&(i[r]=this.getSubLayerAccessor(o,!0)))}return i}},{key:"initializeState",value:function(e,t){}},{key:"updateState",value:function(e,t){}},{key:"finalizeState",value:function(e){}}]),e}();n.d(t,"experimental",function(){return Re}),n.d(t,"COORDINATE_SYSTEM",function(){return i.a}),n.d(t,"LightingEffect",function(){return r.a}),n.d(t,"PointLight",function(){return m}),n.d(t,"DirectionalLight",function(){return y.a}),n.d(t,"_CameraLight",function(){return _}),n.d(t,"_SunLight",function(){return F}),n.d(t,"PostProcessEffect",function(){return D.a}),n.d(t,"_LayersPass",function(){return N.a}),n.d(t,"Deck",function(){return z.a}),n.d(t,"LayerManager",function(){return B.a}),n.d(t,"AttributeManager",function(){return U.a}),n.d(t,"Layer",function(){return V.a}),n.d(t,"CompositeLayer",function(){return G.a}),n.d(t,"DeckRenderer",function(){return W.a}),n.d(t,"Viewport",function(){return H.a}),n.d(t,"WebMercatorViewport",function(){return X.a}),n.d(t,"project",function(){return q.a}),n.d(t,"project64",function(){return Z.a}),n.d(t,"View",function(){return Y.a}),n.d(t,"MapView",function(){return K.a}),n.d(t,"FirstPersonView",function(){return Q.a}),n.d(t,"ThirdPersonView",function(){return te}),n.d(t,"OrbitView",function(){return ne.a}),n.d(t,"PerspectiveView",function(){return ae}),n.d(t,"OrthographicView",function(){return oe.a}),n.d(t,"Controller",function(){return se.a}),n.d(t,"MapController",function(){return ue.a}),n.d(t,"_FirstPersonController",function(){return ce.a}),n.d(t,"_OrbitController",function(){return le.b}),n.d(t,"_OrthographicController",function(){return fe.a}),n.d(t,"Effect",function(){return he.a}),n.d(t,"TRANSITION_EVENTS",function(){return de.a}),n.d(t,"LinearInterpolator",function(){return ve.a}),n.d(t,"FlyToInterpolator",function(){return Oe}),n.d(t,"log",function(){return Pe.a}),n.d(t,"createIterable",function(){return je.a}),n.d(t,"fp64LowPart",function(){return ke.c}),n.d(t,"AmbientLight",function(){return Me.AmbientLight}),n.d(t,"LayerExtension",function(){return Ie});var Re={Tesselator:Ee,flattenVertices:Se.c,fillArray:Se.a,count:Ae.a,memoize:Te.a}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"e",function(){return d});var i={};function r(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function a(e){return Math.round(e/i.EPSILON)*i.EPSILON}function o(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function O(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.h([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function S(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function j(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){"use strict";var i=n(109),r=n(131),a=n(146),o=n(138),s=n(122),u=n(204),c=n(219),l=n(64),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h={modelMatrix:f,viewMatrix:f,projectionMatrix:f,cameraPositionWorld:[0,0,0]};var d="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",v={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new l.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(d,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(d)},g=n(114),p={lightDirection:new Float32Array([1,1,2])};var m={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[v]},y=n(205),b={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var _={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},x=n(188),w=n(218),O=n(206);n.d(t,"a",function(){return P}),n.d(t,"v",function(){return i.c}),n.d(t,"w",function(){return i.e}),n.d(t,"l",function(){return i.a}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.b}),n.d(t,"q",function(){return o.b}),n.d(t,"n",function(){return s.c}),n.d(t,"m",function(){return s.b}),n.d(t,"y",function(){return s.e}),n.d(t,"x",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u.a}),n.d(t,"k",function(){return c.a}),n.d(t,"u",function(){return v}),n.d(t,"p",function(){return g.a}),n.d(t,"i",function(){return m}),n.d(t,"t",function(){return y.a}),n.d(t,"h",function(){return _}),n.d(t,"o",function(){return x.a}),n.d(t,"s",function(){return x.b}),n.d(t,"r",function(){return w.a}),n.d(t,"b",function(){return O.a});var P={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",uniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(132),c=n(22),l=n(40),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.c(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.j(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.k(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.l(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,n,i){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e[3]=s+i*(n[3]-s),e}function g(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}function p(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function m(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=i.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-u)<=i.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=i.b*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var y,b;y=new i.a(4),i.a!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),b=y},function(e,t,n){e.exports=n(259)()},,function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"g",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"n",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return v}),n.d(t,"a",function(){return g}),n.d(t,"m",function(){return m}),n.d(t,"f",function(){return y});var i=n(12);function r(){var e=new i.a(3);return i.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function l(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function f(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function v(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function g(e,t){var n=o(e[0],e[1],e[2]),i=o(t[0],t[1],t[2]);u(n,n),u(i,i);var r=c(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var p,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},y=a;p=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={LNG_LAT:1,LNGLAT_AUTO_OFFSET:4,METER_OFFSETS:2,LNGLAT_OFFSETS:3,IDENTITY:0}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(32),u=n(11),c=n(52),l=n(59),f=n(30),h=n(117),d=n(234),v=n(19),g=n(26),p={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"},m={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:p},y={removedProps:p},b=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(s.a)(n)),n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=Object(d.a)("Buffer",e,m),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=Object(d.a)("Buffer",e,y))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new l.a(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Object(v.a)(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(Object(f.a)(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return Object(f.a)(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;Object(f.a)(this.gl);var c,l,d=Object(h.c)(this.accessor.type||5126,{clamped:!1}),g=this._getAvailableElementCount(r),p=o;n?c=(l=n.length)-p:l=p+(c=Math.min(g,u||g));var m=Math.min(g,c);return u=u||m,Object(v.a)(u<=m),n=n||new d(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Object(v.a)(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=Object(h.b)(e);return Object(v.a)(i),this.setAccessor(new l.a(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/Object(h.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new l.a(this.accessor,{type:Object(h.b)(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return g.a.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return g.a.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new l.a(this.accessor,e),this}},{key:"type",get:function(){return g.a.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return g.a.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(c.a)},,function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(15),l=n(85),f=n(22),h=n(64),d=n(29),v=n(20),g=n(27),p=n(18),m=Math.PI/180,y=Object(l.a)(),b=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Object(o.b)(t);var r=n.id,a=n.userData,s=void 0===a?{}:a;this.gl=t,this.id=r||Object(u.c)(this.constructor.name),this.userData=s,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=Object(o.d)(this.gl),u={},c=n||Object.keys(r),l=!0,f=!1,h=void 0;try{for(var d,v=c[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value,p=r[g];if(p&&(!("webgl2"in p)||a)&&(!("extension"in p)||this.gl.getExtension(p.extension))){var m=i?Object(s.a)(this.gl,g):g;u[m]=this.getParameter(g,e),i&&"GLenum"===p.type&&(u[m]=Object(s.a)(this.gl,u[m]))}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return u}},{key:"setParameter",value:function(e,t){e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Object(s.b)(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return Object(l.a)(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(f)}},{key:"_deleteHandle",value:function(){throw new Error(f)}},{key:"_bindHandle",value:function(){throw new Error(f)}},{key:"_getOptsFromHandle",value:function(){throw new Error(f)}},{key:"_getParameter",value:function(e,t){throw new Error(f)}},{key:"_setParameter",value:function(e,t){throw new Error(f)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=a.a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;a.a.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=a.a.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=a.a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}()},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(45),l=/([0-9]+\.?[0-9]*)(%|px)/;function f(e){switch(r()(e)){case"number":return{position:e,relative:!1};case"string":var t=e.match(l);if(t&&t.length>=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(105),v=n(18);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,O=t.modelMatrix,P=void 0===O?null:O,S=t.viewportInstance,j=void 0===S?null:S,k=t.type,C=void 0===k?c.a:k;Object(v.a)(!j||j instanceof c.a),this.viewportInstance=j,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(34),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(78),n(89))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(37);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.n([],t,e);return i.k(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(0),r=n(4),a=n(10),o=n(9),s=n(5),u=n(11),c=n(52),l=n(43),f=n(98),h=n(70),d=n(30),v=n(49),g=n(67),p=n(26),m=n(19),y=[9729,9728],b=function(e){function t(e,n){var i;Object(r.a)(this,t);var s=n.id,u=void 0===s?Object(g.c)("texture"):s,c=n.handle,l=n.target;return(i=Object(a.a)(this,Object(o.a)(t).call(this,e,{id:u,handle:c}))).target=l,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&Object(f.d)(e,n))&&(!i||Object(f.e)(e,n))),r}}]),Object(s.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var r=t.pixels,a=void 0===r?null:r,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,v=t.pixelStore,g=void 0===v?{}:v,m=t.textureUnit,y=void 0===m?void 0:m,b=t.unpackFlipY,_=void 0===b||b,x=t.mipmaps,w=void 0===x||x;n||(n=a);var O=t.width,P=t.height,S=t.dataFormat,j=t.type,k=t.depth,C=void 0===k?0:k,E=this._deduceParameters({format:s,type:j,dataFormat:S,compressed:!1,data:n,width:O,height:P});O=E.width,P=E.height,S=E.dataFormat,j=E.type,this.width=O,this.height=P,this.depth=C,this.format=s,this.type=j,this.dataFormat=S,this.border=c,this.textureUnit=y,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var A=Object(i.a)({},37440,_),T=Object.assign({},A,g);return w&&this._isNPOT()&&(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),w=!1,this._updateForNPOT(d)),this.mipmaps=w,this.setImageData({data:n,width:O,height:P,depth:C,format:s,type:j,dataFormat:S,border:c,mipmaps:w,parameters:T}),w&&this.generateMipmap(),this.setParameters(d),f&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.height,n=e.width,i=e.mipmaps,r=void 0!==i&&i;return n!==this.width||t!==this.height?this.initialize({width:n,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,v=e.offset,g=void 0===v?0:v,p=e.parameters,y=void 0===p?{}:p,b=e.data,_=void 0===b?null:b,x=e.type,w=void 0===x?this.type:x,O=e.width,P=void 0===O?this.width:O,S=e.height,j=void 0===S?this.height:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E;_||(_=r);var T=this._deduceParameters({format:u,type:w,dataFormat:C,compressed:A,data:_,width:P,height:j});w=T.type,C=T.dataFormat,A=T.compressed,P=T.width,j=T.height;var M=this.gl;M.bindTexture(this.target,this.handle);var L,I=this._getDataType({data:_,compressed:A});if(_=I.data,L=I.dataType,Object(h.a)(this.gl,y,function(){switch(L){case"null":M.texImage2D(n,o,u,P,j,l,C,w,_);break;case"typed-array":M.texImage2D(n,o,u,P,j,l,C,w,_,g);break;case"buffer":Object(d.a)(M),M.bindBuffer(35052,_.handle||_),M.texImage2D(n,o,u,P,j,l,C,w,g),M.bindBuffer(35052,null);break;case"browser-object":Object(d.d)(M)?M.texImage2D(n,o,u,P,j,l,C,w,_):M.texImage2D(n,o,u,C,w,_);break;case"compressed":M.compressedTexImage2D(n,o,u,P,j,l,_);break;default:Object(m.a)(!1,"Unknown image data type")}}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var R=f.a[this.dataFormat]||4,F=f.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,f=e.y,g=void 0===f?0:f,p=e.width,y=void 0===p?this.width:p,b=e.height,_=void 0===b?this.height:b,x=e.level,w=void 0===x?0:x,O=e.format,P=void 0===O?this.format:O,S=e.type,j=void 0===S?this.type:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E,T=e.offset,M=void 0===T?0:T,L=e.border,I=(void 0===L&&this.border,e.parameters),R=void 0===I?{}:I,F=this._deduceParameters({format:P,type:j,dataFormat:C,compressed:A,data:s,width:y,height:_});if(j=F.type,C=F.dataFormat,A=F.compressed,y=F.width,_=F.height,Object(m.a)(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var D=s;s=D.data,y=D.shape[0],_=D.shape[1]}s instanceof l.a&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,R,function(){A?t.gl.compressedTexSubImage2D(i,w,c,g,y,_,P,s):null===s?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s,M):s instanceof v.b?(Object(d.a)(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,w,c,g,y,_,C,j,M),t.gl.bindBuffer(35052,null)):Object(d.d)(t.gl)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s):t.gl.texSubImage2D(i,w,c,g,C,j,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p.a.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof l.a?{data:t.handle,dataType:"buffer"}:t instanceof v.b?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=f.b[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},Object(m.a)(i,"Could not deduced texture size"),Object(m.a)(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Object(m.a)(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Object(m.a)(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Object(d.d)(this.gl)&&(!(!this.width||!this.height)&&(!Object(g.b)(this.width)||!Object(g.b)(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===y.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(c.a)},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){for(var t=1;t0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(36),r=n(4),a=n(5),o=n(67),s=n(19),u={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,e);var n=t.id,i=void 0===n?Object(o.c)("geometry"):n,a=t.drawMode,s=void 0===a?u.TRIANGLES:a,c=t.attributes,l=void 0===c?{}:c,f=t.indices,h=void 0===f?null:f,d=t.vertexCount,v=void 0===d?null:d;this.id=i,this.drawMode=0|s,this.attributes={},this.userData={},this._setAttributes(l,h),this.vertexCount=v||this._calculateVertexCount(this.attributes,this.indices)}return Object(a.a)(e,null,[{key:"DRAW_MODE",get:function(){return u}}]),Object(a.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?Object(i.a)({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Object(s.a)(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||i.size||(i.size=3),"indices"===n?(Object(s.a)(!this.indices),this.indices=i):this.attributes[n]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}return Object(s.a)(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}()},function(e,t,n){"use strict";var i=n(175);function r(e,t,n){return(r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Object(i.a)(a,n.prototype),a}).apply(null,arguments)}var a=n(4),o=n(5),s=n(117),u=n(19),c=n(234);n.d(t,"a",function(){return h});var l={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},f={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},h=function(){function e(){var t=this;Object(a.a)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=Object(c.a)("Accessor",e,f)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(0),r=n(24),a=n(4),o=n(10),s=n(9),u=n(32),c=n(5),l=n(11),f=n(52),h=n(125),d=n(95),v=n(112),g=n(80),p=n(126),m=n(30),y=n(68),b=n(19),_=n(26),x=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this,t),(n=Object(o.a)(this,Object(s.a)(t).call(this,e,i))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(i),Object.seal(Object(u.a)(n)),n}return Object(l.a)(t,e),Object(c.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(c.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(Object(b.a)(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Object(b.a)(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&_.a.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,a=void 0!==i&&i,o=n.resizeAttachments,s=void 0===o||o,u={};a&&Object.keys(this.attachments).forEach(function(e){u[e]=null}),Object.assign(u,e);var c=this.gl.bindFramebuffer(36160,this.handle);for(var l in u){Object(b.a)(void 0!==l,"Misspelled framebuffer binding point?");var f=Number(l),h=u[f],v=h;if(v)if(v instanceof d.a)this._attachRenderbuffer({attachment:f,renderbuffer:v});else if(Array.isArray(h)){var g=Object(r.a)(h,3),p=g[0],m=g[1],y=void 0===m?0:m,_=g[2],x=void 0===_?0:_;v=p,this._attachTexture({attachment:f,texture:p,layer:y,level:x})}else this._attachTexture({attachment:f,texture:v,layer:0,level:0});else this._unattach(f);s&&v&&v.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(w(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&Object(v.a)(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){Object(v.b)({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;Object(m.a)(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Object(y.a)(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?Object(y.a)(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>_.a.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Object(g.b)(this,{maxHeight:100});return _.a.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,r,a){var o,s=null;e&&((s=s||{})[36064]=new h.a(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:r,height:a,mipmaps:!1,parameters:(o={},Object(i.a)(o,10241,9729),Object(i.a)(o,10240,9729),Object(i.a)(o,10242,33071),Object(i.a)(o,10243,33071),o)}));return t&&n?(s=s||{})[33306]=new d.a(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:r,height:111}):t?(s=s||{})[36096]=new d.a(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:r,height:a}):n&&Object(b.a)(!1),s}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof d.a?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Object(b.a)(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;Object(m.d)(t)?t.readBuffer(e):Object(b.a)(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(Object(m.d)(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Object(b.a)(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=Object(p.a)(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(f.a);function w(e){return(x.STATUS||{})[e]||"Framebuffer error ".concat(e)}x.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(9),o=n(5),s=n(11),u=n(161),c=35632,l=35633;function f(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Object(u.a)(t)||"(unnamed)",f="".concat(function(e){switch(e){case c:return"fragment";case l:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),v=0;v1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=d(a,r-o);return s+n+e})}(t);return{shaderName:f,errors:h(a,b),warnings:h(o,b)}}function h(e,t){for(var n="",i=0;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(132).a),p=n(20),m=n(47),y=n(40),b=n(37);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.n(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.n(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.n(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.n(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.n(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(62),r=n(197),a=n(142);function o(e,t,n){var r=i.c[t],o=r?r(e,Number(t)):e.getParameter(Number(t)),s=i.d[t];return Object(a.a)("function"==typeof s),s(e,n,Number(t)),o}function s(e,t){var n={};for(var r in t){var a=Number(r),o=i.d[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],a))}var s=e.state&&e.state.cache;if(s){var u=Object.assign({},s,t);for(var c in n){(0,i.a[c])(e,u)}}}function u(e,t){var n=i.c[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function c(e,t){t=t||i.b;var n=Array.isArray(t)?t:Object.keys(t),r={},a=!0,o=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;r[f]=u(e,f)}}catch(e){o=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return r}function l(e){s(e,Object.assign({},i.b,{}))}function f(e){var t=c(e,Object.keys(i.b)),n={};for(var a in i.b)Object(r.a)(t[a],i.b[a])||(n[a]=t[a]);return n}},function(e,t,n){"use strict";var i=n(9);function r(e,t,n){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(i.a)(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i=n(19),r={};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";r[e]=r[e]||1;var t=r[e]++;return"".concat(e,"-").concat(t)}function o(e){return Object(i.a)("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function s(e){var t=!0;for(var n in e){t=!1;break}return t}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var i=n(19);function r(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var r=e[t=t.replace(/^.*\./,"")];return Object(i.a)(void 0!==r,"Accessing undefined constant GL.".concat(t)),r}function a(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(77),r=n.n(i),a=n(41),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(90),r=n(147),a=n(233),o=n(142);function s(e,t,n){if(Object(a.a)(t))return n(e);var s,u=t.nocatch,c=void 0===u||u;if(Object(o.a)(!t.frameBuffer),Object(i.c)(e),Object(r.a)(e,t),c)s=n(e),Object(i.b)(e);else try{s=n(e)}finally{Object(i.b)(e)}return s}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});var i="vs",r="fs"},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}function o(e){return e&&e[Symbol.asyncIterator]}},function(e,t,n){"use strict";n.d(t,"c",function(){return _}),n.d(t,"a",function(){return x}),n.d(t,"b",function(){return w});var i,r=n(24),a=n(0),o=n(19),s=5120,u=5121,c=5122,l=5123,f=0,h=1,d=2,v=3,g=4,p=5,m=6,y=5126,b=(i={},Object(a.a)(i,y,[y,1,"float"]),Object(a.a)(i,35664,[y,2,"vec2"]),Object(a.a)(i,35665,[y,3,"vec3"]),Object(a.a)(i,35666,[y,4,"vec4"]),Object(a.a)(i,5124,[5124,1,"int"]),Object(a.a)(i,35667,[5124,2,"ivec2"]),Object(a.a)(i,35668,[5124,3,"ivec3"]),Object(a.a)(i,35669,[5124,4,"ivec4"]),Object(a.a)(i,5125,[5125,1,"uint"]),Object(a.a)(i,36294,[5125,2,"uvec2"]),Object(a.a)(i,36295,[5125,3,"uvec3"]),Object(a.a)(i,36296,[5125,4,"uvec4"]),Object(a.a)(i,35670,[y,1,"bool"]),Object(a.a)(i,35671,[y,2,"bvec2"]),Object(a.a)(i,35672,[y,3,"bvec3"]),Object(a.a)(i,35673,[y,4,"bvec4"]),Object(a.a)(i,35674,[y,8,"mat2"]),Object(a.a)(i,35685,[y,8,"mat2x3"]),Object(a.a)(i,35686,[y,8,"mat2x4"]),Object(a.a)(i,35675,[y,12,"mat3"]),Object(a.a)(i,35687,[y,12,"mat3x2"]),Object(a.a)(i,35688,[y,12,"mat3x4"]),Object(a.a)(i,35676,[y,16,"mat4"]),Object(a.a)(i,35689,[y,16,"mat4x2"]),Object(a.a)(i,35690,[y,16,"mat4x3"]),i);function _(e){switch(e){case f:return f;case h:case v:case d:return h;case g:case p:case m:return g;default:return Object(o.a)(!1),0}}function x(e){var t=b[e];if(!t)return null;var n=Object(r.a)(t,2);return{type:n[0],components:n[1]}}function w(e,t){switch(e){case s:case u:case c:case l:e=y}for(var n in b){var i=Object(r.a)(b[n],3),a=i[0],o=i[1],f=i[2];if(a===e&&o===t)return{glType:n,name:f}}return null}},function(e,t,n){"use strict";n.d(t,"e",function(){return y}),n.d(t,"d",function(){return b}),n.d(t,"b",function(){return _}),n.d(t,"a",function(){return w}),n.d(t,"c",function(){return O});var i,r=n(0),a=n(60),o=n(95),s=n(56),u=n(26),c=(i={},Object(r.a)(i,5126,function(e,t,n){return e.uniform1fv(t,g(n,1))}),Object(r.a)(i,35664,function(e,t,n){return e.uniform2fv(t,g(n,2))}),Object(r.a)(i,35665,function(e,t,n){return e.uniform3fv(t,g(n,3))}),Object(r.a)(i,35666,function(e,t,n){return e.uniform4fv(t,g(n,4))}),Object(r.a)(i,5124,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35667,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35668,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35669,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35670,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35671,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35672,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35673,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,g(n,4))}),Object(r.a)(i,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,g(n,9))}),Object(r.a)(i,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,g(n,16))}),Object(r.a)(i,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,5125,function(e,t,n){return e.uniform1uiv(t,m(n,1))}),Object(r.a)(i,36294,function(e,t,n){return e.uniform2uiv(t,m(n,2))}),Object(r.a)(i,36295,function(e,t,n){return e.uniform3uiv(t,m(n,3))}),Object(r.a)(i,36296,function(e,t,n){return e.uniform4uiv(t,m(n,4))}),Object(r.a)(i,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,g(n,6))}),Object(r.a)(i,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,g(n,8))}),Object(r.a)(i,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,g(n,6))}),Object(r.a)(i,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,g(n,12))}),Object(r.a)(i,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,g(n,8))}),Object(r.a)(i,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,g(n,12))}),Object(r.a)(i,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36311,function(e,t,n){return e.uniform1i(t,n)}),i),l={},f={},h={},d=[0];function v(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(d[0]=e,e=d);var r=e.length;if(r%t&&u.a.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&uHTMLVideoElement.HAVE_METADATA&&(i.width!==o.videoWidth||i.height!==o.videoHeight?(i.resize({width:o.videoWidth,height:o.videoHeight,mipmaps:!0}),i.setSubImageData({data:o,paramters:P})):i.setSubImageData({data:o}),i.generateMipmap());i&&r&&r.setUniforms(Object.assign({},t,{bitmapTexture:i,desaturate:s,transparentColor:u.map(function(e){return e/255}),tintColor:c.slice(0,3).map(function(e){return e/255})})).draw()}},{key:"loadTexture",value:function(e){var t=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),e instanceof O.a?this.setState({bitmapTexture:e}):e instanceof Image||e instanceof HTMLCanvasElement?this.setState({bitmapTexture:new O.a(t,{data:e,parameters:P})}):e instanceof HTMLVideoElement&&this.setState({bitmapTexture:new O.a(t,{width:1,height:1,parameters:P,mipmaps:!1})})}},{key:"calculatePositions",value:function(e){var t=e.value,n=this.state.positions;t.set(n)}},{key:"calculatePositions64xyLow",value:function(e){var t=this.use64bitPositions();(e.constant=!t,t)?e.value.set(this.state.positions.map(b.c)):e.value=new Float32Array(4)}}]),t}(_.a);S.layerName="BitmapLayer",S.defaultProps={image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};var j,k=n(72),C=n(80),E=n(121),A=1024,T=4,M=function(){},L=(j={},y()(j,10241,9987),y()(j,10240,9729),j);function I(e){return e&&(e.id||e.url)}function R(e,t,n){for(var i=0;i0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&(R(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&R(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new O.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:L})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(C.f)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:L}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(E.b)(e.url).then(function(r){var a=I(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},L,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),D=[0,0,0,255],N={iconAtlas:{type:"object",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},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:D},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},z=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new F(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:D},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s||this.props._asyncPropOriginalValues.iconAtlas?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),r.extensionsChanged){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(k.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=Object(b.c)(p[0]),a[o++]=Object(b.c)(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(_.a);z.layerName="IconLayer",z.defaultProps=N;var B=n(221),U=n(191),V=[0,0,0,255],G=[0,0,1],W=new U.a,H={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:G},getColor:{type:"accessor",value:V},material:W,radiusPixels:{deprecatedFor:"pointSize"}};var X=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:G},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:V}})}},{key:"updateState",value:function(e){var n,i,r,a=e.props,o=e.oldProps,s=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:a,oldProps:o,changeFlags:s}),s.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),this.getAttributeManager().invalidateAll()}s.dataChanged&&(n=a.data,i=n.header,r=n.attributes,i&&r&&(n.length=i.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION,r.instancePositions64xyLow={constant:!0,value:new Float32Array(2)}),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0&&(r.instanceColors=r.COLOR_0)))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(k.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var _=s(y,h);u[c++]=Object(b.c)(_[0]),u[c++]=Object(b.c)(_[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(_.a);X.layerName="PointCloudLayer",X.defaultProps=H;var q=n(170),Z=n(169),Y=n(216),K=n(113),Q=n(217),J=n(222),$=n(192),ee=n(16),te=n.n(ee),ne=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position); \n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getParagraphSize,f=r.getRowSize,h=r.getOffsets,d=e.value,v=n*e.size,g=Object(k.a)(a,n,i).iterable,p=!0,m=!1,y=void 0;try{for(var b,_=g[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){var x=b.value,w=o[s(x)]||{},O=l(x),P=te()(O,2),S=P[0],j=P[1],C=f(x),E=te()(C,1)[0],A=h(x),T=te()(A,2),M=T[0],L=T[1],I=u(x),R=c(x),F=(1-I)*(S-E)/2;d[v++]=(I-1)*S/2+F+w.width/2+M||0,d[v++]=(R-1)*j/2+w.height/2+L||0}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(k.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(z);ne.layerName="MultiIconLayer",ne.defaultProps={getRowSize:{type:"accessor",value:function(e){return e.rowSize||[0,0]}},getOffsets:{type:"accessor",value:function(e){return e.offsets||[0,0]}},getParagraphSize:{type:"accessor",value:function(e){return e.size||[1,1]}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ie=n(231),re=n.n(ie),ae=n(15),oe=32;function se(e,t,n,i,r){var a=e.split("\n"),o=[0,0],s=0;a.forEach(function(e){var a=function(e,t,n){var i=0,r=0,a=Array.from(e);return{characters:a=a.map(function(e,a){var o={text:e,offsetLeft:i},s=t[e];return s?(i+=s.width,r||(r=s.height*n)):(ae.a.warn("Missing character: ".concat(e))(),i+=oe),o}),rowWidth:i,rowHeight:r}}(e,n,t),u=a.characters,c=a.rowWidth,l=a.rowHeight,f=[c,l];u.forEach(function(e){e.offsetTop=s,e.size=o,e.rowSize=f,r.push(i(e))}),s+=l,o[0]=Math.max(o[0],c)}),o[1]=s}var ue=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ce=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),le="Monaco, monospace",fe="normal",he=64,de=2,ve=.25,ge=3,pe=new ue(3),me=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function ye(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};me.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=pe.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=pe.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),pe.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");be(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(be(h,r,o,a),u){var b=new re.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,O=void 0;try{for(var P,S=t[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;ye(b.draw(j),_),h.putImageData(_,v[j].x-s,v[j].y-s)}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}}else{var k=!0,C=!1,E=void 0;try{for(var A,T=t[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h.fillText(M,v[M].x,v[M].y+.9*o)}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=pe.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),xe=n(137),we={fontSize:he,buffer:de,sdf:!1,radius:ge,cutoff:ve},Oe={start:1,middle:0,end:-1},Pe={top:1,center:0,bottom:-1},Se=["fontSize","buffer","sdf","radius","cutoff"],je={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ce,fontFamily:le,fontWeight:fe,lineHeight:1,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},ke=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new _e(this.context.gl)}}},{key:"updateState",value:function(e){var t=this,n=e.props,i=e.oldProps,r=e.changeFlags,a=this.fontChanged(i,n);a&&this.updateFontAtlas({oldProps:i,props:n});var o=r.dataChanged||a||n.lineHeight!==i.lineHeight||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText);if(o&&Array.isArray(r.dataChanged)){var s=this.state.data.slice(),u=r.dataChanged.map(function(e){return Object(xe.a)({data:s,getIndex:function(e){return e.__source.index},dataRange:e,replace:t.transformStringToLetters(e)})});this.setState({data:s,dataDiff:u})}else o&&this.setState({data:this.transformStringToLetters(),dataDiff:null})}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},we,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return Se.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,r=n.lineHeight,a=n.getText,o=this.state.iconMapping,s=t.startRow,u=t.endRow,c=Object(k.a)(i,s,u),l=c.iterable,f=c.objectInfo,h=[],d=!0,v=!1,g=void 0;try{for(var p,m=function(){var t=p.value;f.index++;var n=a(t,f);n&&se(n,r,o,function(n){return e.getSubLayerRow(n,t,f.index)},h)},y=l[Symbol.iterator]();!(d=(p=y.next()).done);d=!0)m()}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}return h}},{key:"getAnchorXFromTextAnchor",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Oe[e]||0}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Pe[e]||0}}},{key:"renderLayers",value:function(){var e=this.state,t=e.data,n=e.dataDiff,i=e.scale,r=e.iconAtlas,a=e.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.billboard,g=o.sdf,p=o.sizeScale,m=o.sizeUnits,y=o.sizeMinPixels,b=o.sizeMaxPixels,_=o.transitions,x=o.updateTriggers;return new(this.getSubLayerClass("characters",ne))({sdf:g,iconAtlas:r,iconMapping:a,_dataDiff:n&&function(){return n},getPosition:this.getSubLayerAccessor(s),getColor:this.getSubLayerAccessor(u),getSize:this.getSubLayerAccessor(c),getAngle:this.getSubLayerAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this.getSubLayerAccessor(d),getPickingIndex:function(e){return e.__source.index},billboard:v,sizeScale:p*i,sizeUnits:m,sizeMinPixels:y*i,sizeMaxPixels:b*i,transitions:_&&{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:x.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:x.getPixelOffset,getAnchorX:x.getTextAnchor,getAnchorY:x.getAlignmentBaseline}}),{data:t,getIcon:function(e){return e.text},getRowSize:function(e){return e.rowSize},getOffsets:function(e){return[e.offsetLeft,e.offsetTop]},getParagraphSize:function(e){return e.size}})}}]),t}($.a);ke.layerName="TextLayer",ke.defaultProps=je;var Ce=n(130);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return S}),n.d(t,"IconLayer",function(){return z}),n.d(t,"LineLayer",function(){return B.a}),n.d(t,"PointCloudLayer",function(){return X}),n.d(t,"ScatterplotLayer",function(){return q.a}),n.d(t,"ColumnLayer",function(){return Z.a}),n.d(t,"GridCellLayer",function(){return Y.a}),n.d(t,"PathLayer",function(){return K.a}),n.d(t,"PolygonLayer",function(){return Q.a}),n.d(t,"GeoJsonLayer",function(){return J.a}),n.d(t,"TextLayer",function(){return ke}),n.d(t,"SolidPolygonLayer",function(){return Ce.a}),n.d(t,"_MultiIconLayer",function(){return ne})},function(e,t,n){"use strict";var i=n(43),r=n(60),a=n(56),o=n(70),s=n(30),u=n(117),c=n(19);function l(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(c.a)(!1),0}}var f=n(158),h=n(26);function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,f=t.sourceAttachment,h=void 0===f?36064:f,d=t.target,v=void 0===d?null:d,g=t.sourceWidth,p=t.sourceHeight,m=t.sourceType,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=_.attachments;g=g||_.width,p=p||_.height,36064===h&&null===O&&(h=1028),Object(c.a)(P[h]),v=function(e,t,n,i,r){if(e)return e;t=t||5121;var a=Object(u.c)(t,{clamped:!1}),o=l(n);return new a(i*r*o)}(v,m=m||P[h].type,s,g,p),m=m||Object(u.b)(v);var S=w.bindFramebuffer(36160,O);return w.readPixels(i,a,g,p,s,m,v),w.bindFramebuffer(36160,S||null),x&&_.delete(),v}function v(e,t){var n=t.sourceX,r=void 0===n?0:n,a=t.sourceY,u=void 0===a?0:a,f=t.sourceFormat,h=void 0===f?6408:f,d=t.target,v=void 0===d?null:d,g=t.targetByteOffset,p=void 0===g?0:g,m=t.sourceWidth,y=t.sourceHeight,_=t.sourceType,x=b(e),w=x.framebuffer,O=x.deleteFramebuffer;Object(c.a)(w);var P=w.gl;if(m=m||w.width,y=y||w.height,Object(s.a)(P),_=_||(v?v.type:5121),!v){var S=l(h),j=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(c.a)(!1),0}}(_),k=p+m*y*S*j;v=new i.a(P,{byteLength:k,accessor:{type:_,size:S}})}return v.bind({target:35051}),Object(o.a)(P,{framebuffer:w},function(){P.readPixels(r,u,m,y,h,_,p)}),v.unbind({target:35051}),O&&w.delete(),v}function g(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=d(e,{sourceAttachment:i}),s=e.width,c=e.height;c>a;){var l=Object(u.d)({data:o,width:s,height:c});o=l.data,s=l.width,c=l.height}Object(u.a)({data:o,width:s,height:c});var f=document.createElement("canvas");f.width=s,f.height=c;var h=f.getContext("2d"),v=h.createImageData(s,c);return v.data.set(o),h.putImageData(v,0,0),f.toDataURL()}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=g(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,o=n.sourceY,s=void 0===o?0:o,u=n.targetX,l=n.targetY,f=n.targetZ,h=n.targetMipmaplevel,d=void 0===h?0:h,v=n.targetInternalFormat,g=void 0===v?6408:v,p=n.width,m=n.height,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=void 0!==u||void 0!==l||void 0!==f;u=u||0,l=l||0,f=f||0;var S=w.bindFramebuffer(36160,O);Object(c.a)(t);var j=null;if(t instanceof a.a&&(j=t,p=Number.isFinite(p)?p:j.width,m=Number.isFinite(m)?m:j.height,j.bind(0),t=j.target),P)switch(t){case 3553:case 34067:w.copyTexSubImage2D(t,d,u,l,r,s,p,m);break;case 35866:case 32879:w.copyTexSubImage3D(t,d,u,l,f,r,s,p,m)}else w.copyTexImage2D(t,d,g,r,s,p,m,0);return j&&j.unbind(),w.bindFramebuffer(36160,S||null),x&&_.delete(),j}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,u=n.sourceY0,l=void 0===u?0:u,f=n.sourceX1,d=n.sourceY1,v=n.targetX0,g=void 0===v?0:v,p=n.targetY0,m=void 0===p?0:p,y=n.targetX1,_=n.targetY1,x=n.color,w=void 0===x||x,O=n.depth,P=void 0!==O&&O,S=n.stencil,j=void 0!==S&&S,k=n.mask,C=void 0===k?0:k,E=n.filter,A=void 0===E?9728:E,T=b(e),M=T.framebuffer,L=T.deleteFramebuffer,I=b(t),R=I.framebuffer,F=I.deleteFramebuffer;Object(c.a)(M),Object(c.a)(R);var D=R.gl,N=R.handle,z=R.width,B=R.height,U=R.readBuffer;Object(s.a)(D),M.handle||36064!==r||(r=1028),w&&(C|=16384),P&&(C|=256),j&&(C|=1024),(L||F)&&1280&C&&(C=16384,h.a.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Object(c.a)(C),f=void 0===f?M.width:f,d=void 0===d?M.height:d,y=void 0===y?z:y,_=void 0===_?B:_;var V=D.bindFramebuffer(36009,N),G=D.bindFramebuffer(36008,M.handle);return D.readBuffer(r),D.blitFramebuffer(o,l,f,d,g,m,y,_,C,A),D.readBuffer(U),D.bindFramebuffer(36008,G||null),D.bindFramebuffer(36009,V||null),L&&M.delete(),F&&R.delete(),R}function b(e){return e instanceof r.a?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Object(f.b)(e),deleteFramebuffer:!0}}n.d(t,"e",function(){return d}),n.d(t,"f",function(){return v}),n.d(t,"b",function(){return g}),n.d(t,"c",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return y})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(178),v=n(22),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(81),u=n(179),c=n(18),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(82),u=n(15),c=n(18),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,e.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){if(!this.isDragging())return!1;var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState,r={};switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut(),r.isZooming=!0;break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn(),r.isZooming=!0;break;case 37:n?(t=i.rotateLeft(),r.isRotating=!0):(t=i.moveLeft(),r.isPanning=!0);break;case 39:n?(t=i.rotateRight(),r.isRotating=!0):(t=i.moveRight(),r.isPanning=!0);break;case 38:n?(t=i.rotateUp(),r.isRotating=!0):(t=i.moveUp(),r.isPanning=!0);break;case 40:n?(t=i.rotateDown(),r.isRotating=!0):(t=i.moveDown(),r.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),r),!0}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";var i=n(204),r=n(42),a=Object.keys(r.a).map(function(e){return"const float COORDINATE_SYSTEM_".concat(e," = ").concat(r.a[e],".;")}).join(""),o="".concat(a,"\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform float project_uAntimeridian;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n dy = clamp(dy, -1., 1.);\n }\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n"),s=n(135),u={};t.a={name:"project",dependencies:[i.a],vs:o,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?Object(s.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return v});var i=n(29);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-t[2],-t[6],-t[10]],up:[t[1],t[5],t[9]],right:[t[0],t[4],t[8]]}}var o=new i.a,s=new i.a,u=new i.a,c=new i.a,l=new i.a,f=new i.a,h=new i.a;function d(e){var t=e.aspect,n=e.near,r=e.far,a=e.fovyRadians,d=e.position,v=e.direction,g=e.up,p=e.right;s.copy(v);var m=1/s.len();s.normalize(),o.copy(d),u.copy(g).normalize(),c.copy(p).normalize();var y=2*Math.tan(a/2)*n,b=y*t;l.copy(s).scale(n*m).add(o),f.copy(s).scale(r*m).add(o);var _=s.clone().negate(),x=_.dot(l),w={near:{distance:x,normal:_},far:{distance:s.dot(f),normal:s.clone()}};return h.copy(c).scale(.5*b).add(l).subtract(o).normalize(),_=new i.a(u).cross(h),x=o.dot(_),w.right={normal:_,distance:x},h.copy(c).scale(.5*-b).add(l).subtract(o).normalize(),_=new i.a(h).cross(u),x=o.dot(_),w.left={normal:_,distance:x},h.copy(u).scale(.5*y).add(l).subtract(o).normalize(),_=new i.a(h).cross(c),x=o.dot(_),w.top={normal:_,distance:x},h.copy(u).scale(.5*-y).add(l).subtract(o).normalize(),_=new i.a(c).cross(h),x=o.dot(_),w.bottom={normal:_,distance:x},w}function v(e){return e-Math.fround(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(96),r=n(54);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t){var n,i,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),Object(c.a)(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(78))},function(e,t,n){"use strict";var i=n(36),r=n(90),a=n(49),o="Failed to create WebGL context in Node.js, headless gl not available",s="Failed to create WebGL context in Node.js, headless gl returned null";var u=n(124);var c=n(111),l=(n(19),n(110)),f=n(26),h=n(46);n.d(t,"e",function(){return g}),n.d(t,"a",function(){return p}),n.d(t,"c",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"d",function(){return b});function d(e){return Boolean(e&&2===e._version)}var v={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(v,{width:1,height:1},e)}function p(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},v,t),r=n.width,h=n.height;function g(e){if(t.throwOnError)throw new Error(e);return null}if(l.a){var p=t.canvas;e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(Object(u.a)({canvas:p,width:r,height:h,onError:g}),t)}else e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,u=e.onError;if(r&&!i)return u("headless-gl does not support WebGL2");if(!a.c)return u(o);var c=Object(a.c)(t,n,e);return c||u(s)}(Object(i.a)({},t,{width:r,height:h,onError:g}));return e?(function(e){var t=d(e)?"WebGL2":"WebGL1",n=Object(c.a)(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";f.a.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=m(e,t)),e):null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==a.a&&e instanceof a.a)return 2;return 1}(e);var n=t=Object.assign({},v,t),i=n.manageState,o=n.debug;return i&&Object(r.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(5),a=n(29),o=n(64),s=n(67),u=n(19),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id;this.id=n||Object(s.c)(this.constructor.name),this.display=!0,this.position=new a.a,this.rotation=new a.a,this.scale=new a.a(1,1,1),this.matrix=new o.a,this.userData={},this.props={},this._setScenegraphNodeProps(t)}return Object(r.a)(e,[{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:"setPosition",value:function(e){return Object(u.a)(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return Object(u.a)(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return Object(u.a)(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Object(u.a)(e),t=t||this.matrix;var n=new o.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{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)}}]),e}()},function(e,t,n){"use strict";var i=n(0),r=n(36),a=n(4),o=n(5),s=n(10),u=n(9),c=n(66),l=n(11),f=n(43),h=n(201),d=n(19),v={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function g(e,t){var n=(t||{}).attributeMap,i=void 0===n?v:n;return i&&i[e]||e}function p(e,t){var n;switch(e){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2}Object(d.a)(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var m=n(30),y=n(202),b=n(176),_=n(196),x=n(28),w=n(131),O=n(207),P=n(208),S=n(209),j=n(41),k=n.n(j),C=n(46),E={},A=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},T=new Map;k.a.listenFor("luma.gl",function(e){var t=E[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){C.d.__SEER_INITIALIZED__&&(T.has(e)||T.set(e,new Map),T.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();A(i,n,e.value),t.setUniforms(i)}});var M=n(67),L=n(26),I=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),Object(d.a)(Object(m.c)(t));var i=n.id,r=void 0===i?Object(M.c)("base-model"):i;this.id=r,this.gl=t,this.id=n.id||Object(M.c)("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(o.a)(e,[{key:"initialize",value:function(e){this.props={},this.program=this._createProgram(e),this.vertexArray=new y.a(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete E[t],k.a.deleteItem("luma.gl",t)}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.uniforms}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),function(e,t){if(C.d.__SEER_INITIALIZED__&&e){var n=T.get(e);n&&n.forEach(function(e,n){A(t,n,e)})}}(this.id,e),e=this._extractAnimatedUniforms(e),this.program.setUniforms(e),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,s=t.attributes,u=void 0===s?{}:s,c=t.transformFeedback,l=void 0===c?this.transformFeedback:c,f=t.parameters,h=void 0===f?{}:f,d=t.vertexArray,v=void 0===d?this.vertexArray:d,g=t.animationProps;E[(e=this).id]||(E[e.id]=e,k.a.listItem("luma.gl",e.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(g);var p=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&L.a.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,b=m.indexType,_=m.indexOffset,x=this.isInstanced,w=this.instanceCount,O=function(){},P=this.props,S=P.onBeforeRender,j=void 0===S?O:S,C=P.onAfterRender,A=void 0===C?O:C;j(),this._timerQueryStart();var T=this.program.draw(Object.assign({},t,{logPriority:p,uniforms:null,framebuffer:r,parameters:h,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:b,isInstanced:x,instanceCount:w,offset:y?_:0}));return this._timerQueryEnd(),A(),this._logDrawCallEnd(p,v,r),T}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&b.a.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&L.a.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,s=e.defines,u=void 0===s?{}:s,c=e.inject,l=void 0===c?{}:c,f=e.shaderCache,h=void 0===f?null:f,v=e.varyings,g=void 0===v?null:v,p=e.bufferMode,m=void 0===p?35981:p,y=e.program,b=void 0===y?null:y;this.getModuleUniforms=function(e){};var O=this.id;if(!b){n=n||x.a.vs,r=r||x.a.fs;var P=Object(w.a)(this.gl,{vs:n,fs:r,modules:o,inject:l,defines:u,log:L.a});n=P.vs,r=P.fs,b=h?h.getProgram(this.gl,{id:O,vs:n,fs:r}):new _.a(this.gl,{id:O,vs:n,fs:r,varyings:g,bufferMode:m}),this.getModuleUniforms=P.getUniforms||function(e){}}return Object(d.a)(b instanceof _.a,"Model needs a program"),b}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!Object(M.a)(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new b.a(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,L.a.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(L.a.priority>> DRAWING MODEL ".concat(this.id),{collapsed:L.a.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=Object(O.a)({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=Object(P.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,c=Object(P.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),l=c.table;c.count>0&&L.a.log("MISSING UNIFORMS",Object.keys(l))(),u>0&&L.a.log("UNUSED UNIFORMS",Object.keys(s))();var f=Object(S.a)(this.vertexArray.configuration);L.a.table(e,r)(),L.a.table(e,o)(),L.a.table(e+1,f)(),function(e,t){if(k.a.isReady()&&!k.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);k.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),L.a.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}();n.d(t,"a",function(){return R});var R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,t);var i=n.id,o=void 0===i?Object(M.c)("model"):i;return Object(s.a)(this,Object(u.a)(t).call(this,e,Object(r.a)({},n,{id:o})))}return Object(l.a)(t,e),Object(o.a)(t,[{key:"initialize",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Object(d.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){Object(c.a)(Object(u.a)(t.prototype),"delete",this).call(this),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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Object(d.a)(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Object(d.a)(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=function(e,t,n){var i={},a=t.indices;for(var o in t.attributes){var s=t.attributes[o],u=g(o,n);if("indices"===o)a=s;else if(s.constant)i[u]=s.value;else{var c=s.value,l=Object(r.a)({},s);delete l.value,i[u]=[new f.a(e,c),l],p(o,l)}}if(a){var h=a.value||a;Object(d.a)(h instanceof Uint16Array||h instanceof Uint32Array,'attribute array for "indices" must be of integer type');var v={size:1,isIndexed:void 0===a.isIndexed||a.isIndexed};i.indices=[new f.a(e,{data:h,target:34963}),v]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(M.a)(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,r=e.feedbackBuffers,a=e.unbindModels,o=void 0===a?[]:a,s=e.parameters;r&&this._setFeedbackBuffers(r),n&&(s=Object.assign({},s,Object(i.a)({},35977,n))),o.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:s}))}finally{o.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return L.a.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof f.a&&t.delete()}}},{key:"_setAnimationProps",value:function(e){if(this.animated){Object(d.a)(e,"Model.draw(): animated uniforms but no animationProps");var t=this._evaluateAnimateUniforms(e);this.program.setUniforms(t)}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(M.a)(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new h.a(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}}]),t}(I)},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,i))).initialize(i),Object.seal(Object(s.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=Object(v.d)(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,d)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(u.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Object(g.a)(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Object(v.d)(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*d[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(173),r="7.2.0-beta.2",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return h});var i,r,a,o=n(0),s=n(30),u=(i={},Object(o.a)(i,6407,{dataFormat:6407,types:[5121,33635]}),Object(o.a)(i,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(o.a)(i,6406,{dataFormat:6406,types:[5121]}),Object(o.a)(i,6409,{dataFormat:6409,types:[5121]}),Object(o.a)(i,6410,{dataFormat:6410,types:[5121]}),Object(o.a)(i,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(o.a)(i,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(o.a)(i,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(o.a)(i,34836,{dataFormat:6408,types:[5126],gl2:!0}),i),c=(r={},Object(o.a)(r,6403,1),Object(o.a)(r,36244,1),Object(o.a)(r,33319,2),Object(o.a)(r,33320,2),Object(o.a)(r,6407,3),Object(o.a)(r,36248,3),Object(o.a)(r,6408,4),Object(o.a)(r,36249,4),Object(o.a)(r,6402,1),Object(o.a)(r,34041,1),Object(o.a)(r,6406,1),Object(o.a)(r,6409,1),Object(o.a)(r,6410,2),r),l=(a={},Object(o.a)(a,5126,4),Object(o.a)(a,5125,4),Object(o.a)(a,5124,4),Object(o.a)(a,5123,2),Object(o.a)(a,5122,2),Object(o.a)(a,5131,2),Object(o.a)(a,5120,1),Object(o.a)(a,5121,1),a);function f(e,t){var n=u[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=Object(s.d)(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}function h(e,t){var n=u[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},,function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(10),a=n(9),o=n(11),s=n(93),u=n(58),c="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",l=[-1,-1,1,-1,-1,1,1,1],f=function(e){function t(e,n){var o;Object(i.a)(this,t);var s=l.map(function(e){return-1===e?0:e});return(o=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},n,{vs:c,geometry:new u.a({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(l)},aTexCoord:{size:2,value:new Float32Array(s)},aCoordinate:{size:2,value:new Float32Array(s)}}})})))).setVertexCount(4),o}return Object(o.a)(t,e),t}(s.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(177),v=n(70),g=n(112),p=n(147),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.a)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.a)(e,{scissorTest:!0,scissor:l},function(){return Object(g.a)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(p.a)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,mousePosition:e.context.mousePosition,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.a)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i,r=n(0),a=n(30),o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",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"};t.b=(i={},Object(r.a)(i,o.WEBGL2,[function(e){return Object(a.d)(e)}]),Object(r.a)(i,o.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(r.a)(i,o.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(r.a)(i,o.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(r.a)(i,o.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(r.a)(i,o.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(r.a)(i,o.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(r.a)(i,o.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(r.a)(i,o.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(r.a)(i,o.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(r.a)(i,o.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(r.a)(i,o.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(r.a)(i,o.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(r.a)(i,o.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),i)},function(e,t,n){"use strict";function i(e,t){return e===t||Object.keys(e).every(function(n){return Array.isArray(e[n])&&Array.isArray(t[n])?i(e[n],t[n]):e[n]===t[n]})}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(32),o=n(9),s=n(66),u=n(5),c=n(11),l=n(52),f=n(43),h=n(30),d=null;function v(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!d||d.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var u=s.id||s.program&&s.program.id;return(n=Object(r.a)(this,Object(o.a)(t).call(this,e,Object.assign({},s,{id:u})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(s),Object.seal(Object(a.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?Object(h.d)(e)||"Chrome"===function(e){if(!e&&!Object(m.a)())return"Node";if(Object(y.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":p.b.chrome?"Chrome":p.b.safari?"Safari":p.b.mozInnerScreenX?"Firefox":"Unknown"}():Object(h.d)(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Object(g.a)(!1)}}}]),Object(u.a)(t,[{key:"delete",value:function(){Object(s.a)(Object(o.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(g.a)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Object(g.a)(Object(h.d)(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new f.a(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=v(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof a.a)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof a.a)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new a.a(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"e",function(){return c}),n.d(t,"a",function(){return l}),n.d(t,"c",function(){return f}),n.d(t,"d",function(){return h}),n.d(t,"b",function(){return d});var u=new s;function c(e){u.setDefaultShaderModules(e)}function l(){return u.getDefaultShaderModules()}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;u.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(u.defaultShaderModules),v(e=u.resolveModules(e))}function d(e){return u.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,a=t.color,l=void 0===a?null:a,f=t.depth,h=void 0===f?null:f,d=t.stencil,g=void 0===d?null:d,p={};i&&(p.framebuffer=i);var m=0;l&&(m|=c,!0!==l&&(p.clearColor=l)),h&&(m|=s,!0!==h&&(p.clearDepth=h)),g&&(m|=u,!0!==h&&(p.clearStencil=h)),Object(o.a)(0!==m,v),Object(r.a)(e,p,function(){e.clear(m)})}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,s=void 0===n?null:n,u=t.buffer,c=void 0===u?l:u,g=t.drawBuffer,p=void 0===g?0:g,m=t.value,y=void 0===m?[0,0,0,0]:m;Object(a.a)(e),Object(r.a)(e,{framebuffer:s},function(){switch(c){case l:switch(y.constructor){case Int32Array:e.clearBufferiv(c,p,y);break;case Uint32Array:e.clearBufferuiv(c,p,y);break;case Float32Array:default:e.clearBufferfv(c,p,y)}break;case f:e.clearBufferfv(f,0,[y]);break;case h:e.clearBufferiv(h,0,[y]);break;case d:var t=Object(i.a)(y,2),n=t[0],r=t[1];e.clearBufferfi(d,0,n,r);break;default:Object(o.a)(!1,v)}})}},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(129),p=n(93),m=n(58),y=n(21),b=n(85),_=y.experimental.Tesselator,x=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3,padding:3},endPositions:{size:3,padding:3},segmentTypes:{size:1,type:Uint8ClampedArray},startPositions64XyLow:{size:2,padding:2,fp64Only:!0},endPositions64XyLow:{size:2,padding:2,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){var t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t+1:Math.max(0,t-1)}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.startPositions64XyLow,o=n.endPositions64XyLow,s=n.segmentTypes,u=this.fp64,c=t.geometrySize;if(0!==c)for(var l,f,h=this.isClosed(e),d=t.vertexStart,v=0;v=e.length&&(t+=1-e.length/n),[e[t*n],e[t*n+1],3===n?e[t*n+2]:0]}return t>=e.length&&(t+=1-e.length),e[t]}},{key:"isClosed",value:function(e){var t=this.getPathLength(e),n=this.getPointOnPath(e,0),i=this.getPointOnPath(e,t-1);return n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]}}]),t}(_);n.d(t,"a",function(){return S});var w=[0,0,0,255],O={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:w},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},P={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceLeftStartPositions64xyLow;\nattribute vec4 instanceEndRightPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width, vec2 widthPixels\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = !isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0);\n bool isEndCap = isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0);\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(vCornerOffset * widthPixels * isValid, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n return currPoint + vec3(offset.xy / widthPixels * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n vec2 width = billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width, widthPixels\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.worldPosition = instanceStartPositions;\n geometry.worldPositionAlt = instanceEndPositions;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceLeftStartPositions64xyLow.xy, instanceLeftStartPositions64xyLow.zw, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceLeftStartPositions64xyLow.zw, instanceEndRightPositions64xyLow.xy, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceEndRightPositions64xyLow.xy, instanceEndRightPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({startPositions:{size:3,offset:12,transition:P,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{offset:0},instanceStartPositions:{offset:12}}},endPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0,shaderAttributes:{instanceEndPositions:{offset:0},instanceRightPositions:{offset:12}}},instanceLeftStartPositions64xyLow:{size:4,stride:8,update:this.calculateLeftStartPositions64xyLow,noAlloc:!0},instanceEndRightPositions64xyLow:{size:4,stride:8,update:this.calculateEndRightPositions64xyLow,noAlloc:!0},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:P,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:P,defaultValue:w},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new x({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions(),dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),r.dataChanged||a.invalidateAll()}if(r.extensionsChanged){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.a({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateSegmentTypes",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("segmentTypes")}},{key:"calculateLeftStartPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startPositions64XyLow"):new Float32Array(4)}},{key:"calculateEndRightPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("endPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,o=n.pointLights,s=n.directionalLights,u=i||o&&o.length>0||s&&s.length>0;return u?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,o=void 0===r?[]:r,s={};s["lighting_uAmbientLight.color"]=t?a(t):[0,0,0];return i.forEach(function(e,t){s["lighting_uPointLight[".concat(t,"].color")]=a(e),s["lighting_uPointLight[".concat(t,"].position")]=e.position,s["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),s.lighting_uPointLightCount=i.length,o.forEach(function(e,t){s["lighting_uDirectionalLight[".concat(t,"].color")]=a(e),s["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),s.lighting_uDirectionalLightCount=o.length,s}({ambientLight:i,pointLights:o,directionalLights:s}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var c={pointLights:[],directionalLights:[]},l=!0,f=!1,h=void 0;try{for(var d,v=(t.lights||[])[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;switch(g.type){case"ambient":c.ambientLight=g;break;case"directional":c.directionalLights.push(g);break;case"point":c.pointLights.push(g)}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return e({lightSources:c})}return{}},defines:{MAX_LIGHTS:3}},{});function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o});var i=n(57),r={};function a(e){e=Array.isArray(e)?e:[e];var t=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var u=o.value;Object(i.b)(u);var c=!0,l=!1,f=void 0;try{for(var h,d=u.extensions[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;r[v]=u}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}}}catch(e){n=!0,a=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}}function o(){return Object.values(r)}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"d",function(){return s});var i="Failed to deduce GL constant from typed array";function r(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(i)}}function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u=24&&2303741511===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint32(16,u),height:e.getUint32(20,u)}}}],["image/jpeg",{test:function(e){return e.byteLength>=2&&65496===e.getUint16(0,u)},getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,u))return null;var t=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),n=t.tableMarkers,i=t.sofMarkers,r=2;for(;r=10&&1195984440===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint16(6,c),height:e.getUint16(8,c)}}}],["image/bmp",{test:function(e){return e.byteLength>=2&&16973===e.getUint16(0,u)},getSize:function(e){return{width:e.getUint32(18,c),height:e.getUint32(22,c)}}}]]);var f="Invalid MIME type. Supported MIME types are: ".concat(Array.from(l.keys()).join(", "));function h(e){var t=g(e),n=!0,i=!1,r=void 0;try{for(var a,o=l.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=Object(s.a)(a.value,2),c=u[0];if((0,u[1].test)(t))return c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(0,v(t=t||h(e)).getSize)(g(e));if(!n)throw new Error("invalid image data for type: ".concat(t));return n}(e,t=t||h(e));return n.mimeType=t,n}function v(e){var t=l.get(e);if(!t)throw new Error(f);return t}function g(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}n.d(t,"a",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"e",function(){return _}),n.d(t,"c",function(){return x});var p=o.a._parseImageNode||"undefined"!=typeof ImageBitmap;function m(e,t){if(o.a._parseImageNode){var n=d(e).mimeType;return o.a._parseImageNode(e,n,t)}return _(e)}function y(e,t){return b.apply(this,arguments)}function b(){return(b=Object(a.a)(r.a.mark(function e(t,n){var i,a;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof Image){e.next=8;break}return e.next=3,fetch(t,n);case 3:return i=e.sent,e.next=6,i.arrayBuffer();case 6:return a=e.sent,e.abrupt("return",m(a));case 8:return e.next=10,x(t,n);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _(e){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var t=new Blob([new Uint8Array(e)]);return createImageBitmap(t)}function x(e,t){return w.apply(this,arguments)}function w(){return(w=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(24),r=n(118),a="void main() {gl_FragColor = vec4(0);}",o="#version 300 es\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}";function s(e,t){t=Array.isArray(t)?t:[t];var n=e.replace(/^\s+/,"").split(/\s+/),r=Object(i.a)(n,3),a=r[0],o=r[1],s=r[2];return t.includes(a)&&o&&s?{qualifier:a,type:o,name:s.split(";")[0]}:null}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var i=n(19),r="";function a(e){r=e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)("string"==typeof e),e=r+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function s(e,t){return Object(i.a)("string"==typeof e),e=r+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i,r=n(110).a&&"undefined"!=typeof document,a=r&&"complete"===document.readyState;function o(){return i||(i=r?new Promise(function(e,t){if(r&&"complete"===document.readyState)return a=!0,void e(document);window.onload=function(){a=!0,e(document)}}):Promise.resolve({})),i}function s(e){var t,n=e.canvas,i=e.width,r=e.height,o=e.onError,s=void 0===o?function(){}:o;return"string"==typeof n?(a||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:s}),t}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(56),l=n(30),f=n(123),h=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.b)(e),(s instanceof Promise||"string"==typeof s)&&(s={data:s}),"string"==typeof s.data&&(s=Object.assign({},s,{data:Object(f.b)(s.data)})),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},s,{target:3553})))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e,t){return c.a.isSupported(e,t)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return u});var i=n(104),r=n(30),a=n(19);function o(e,t){return s(e,t)}function s(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return c(e,t)})}function u(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=Object(r.d)(e),i.b)e.luma.caps[t]=c(e,t);return e.luma.caps}function c(e,t){var n=i.b[t];Object(a.a)(n,t);var o,s=Object(r.d)(e)&&n[1]||n[0];if("function"==typeof s)o=s(e);else if(Array.isArray(s)){o=!0;var u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;o=o&&Boolean(e.getExtension(d))}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}else"string"==typeof s?o=Boolean(e.getExtension(s)):"boolean"==typeof s?o=s:Object(a.a)(!1);return o}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(4),r=function e(){Object(i.a)(this,e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return O});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(184),v=n(22),g=n(83),p=n(136),m=n(81),y=n(82),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,O=void 0===w?b.minZoom:w,P=e.maxZoom,S=void 0===P?b.maxZoom:P,j=e.startPanPosition,k=e.startTarget,C=e.startRotationX,E=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:O,maxZoom:S})))._interactiveState={startPanPosition:j,startTarget:k,startRotationX:C,startRotationOrbit:E,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c=Object.keys(t),l=0;l=0&&n.modules.splice(i,1)}return"inject"in t&&(n.inject=Object.assign({},e.inject,t.inject)),n}var T=n(150),M=n(99),L=n(72),I={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return N(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return R(e,t)}},accessor:{validate:function(e,t){var n=z(e);return"function"===n||n===z(t.value)},equal:function(e,t,n){return"function"==typeof t||R(e,t)}},array:{validate:function(e,t){return t.optional&&!e||N(e)},equal:function(e,t,n){return n.compare?R(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function R(e,t){if(e===t)return!0;if(!N(e)||!N(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=Q,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):Object(L.b)(t)?this._resolveAsyncIterable(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){t=n._postProcessValue(e,t),n._setAsyncPropValue(e,t,r);var i=n.layer.props.onDataLoad;"data"===e&&i&&i(t,{propName:e,layer:n.layer})}).catch(function(e){return C.a.error(e)()})}},{key:"_resolveAsyncIterable",value:function(){var e=Z()(X.a.mark(function e(t,n){var i,r,a,o,s,u,c,l,f,h,d,v;return X.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"data"!==t&&this._setPropValue(t,n),(i=this.asyncProps[t]).pendingLoadCount++,r=i.pendingLoadCount,a=[],o=0,s=!0,u=!1,e.prev=8,l=K()(n);case 10:return e.next=12,l.next();case 12:return f=e.sent,s=f.done,e.next=16,f.value;case 16:if(h=e.sent,s){e.next=26;break}d=h,a=this._postProcessValue(t,d,a),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:o,endRow:a.length}]}),o=a.length,this._setAsyncPropValue(t,a,r);case 23:s=!0,e.next=10;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(8),u=!0,c=e.t0;case 32:if(e.prev=32,e.prev=33,s||null==l.return){e.next=37;break}return e.next=37,l.return();case 37:if(e.prev=37,!u){e.next=40;break}throw c;case 40:return e.finish(37);case 41:return e.finish(32);case 42:(v=this.layer.props.onDataLoad)&&v(a,{propName:t,layer:this.layer});case 44:case"end":return e.stop()}},e,this,[[8,28,32,42],[33,,37,41]])}));return function(t,n){return e.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(e,t,n){var i=(this.component?this.component.props:{}).dataTransform;return"data"!==e?t:i?i(t,n):n?n.concat(t):t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),$=0,ee=function(){function e(){o()(this,e),this.props=function(){for(var e=U(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=e.match(Oe);if(i&&i[0]){var r=function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object(_e.b)(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,i[0]);if(r)return r}var a=function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s.testText&&s.testText(t))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(n,t);return a||null}var Se=n(116),je=function(e){return e&&e instanceof ArrayBuffer},ke=function(e){return e&&e instanceof Buffer};function Ce(e){if(je(e))return e;if(ke(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){var t=e;return(new TextEncoder).encode(t).buffer}return Object(ge.a)(!1)}var Ee=new Map;function Ae(e,t,n){var i=function(e){var t=Ee.get(e);if(!t){var n=new Blob([e],{type:"application/javascript"});t=URL.createObjectURL(n),Ee.set(e,t)}return new Worker(t)}(e);n=function(e){null!==(e=Object.assign({},e)).log&&delete e.log;return e}(n);var r=function(e,t){return new Promise(function(n,r){i.onmessage=function(e){switch(e.data.type){case"done":n(e.data.result),i.terminate();break;case"error":r(new Error(e.data.message))}};var a=Ce(e);i.postMessage({arraybuffer:a,opts:t},[a])})};return t?r(t,n):r}function Te(e){this.wrapped=e}function Me(e){var t,n;function i(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Te;Promise.resolve(s?o.wrapped:o).then(function(e){s?i("next",e):r(a.done?"return":"normal",e)},function(e){i("throw",e)})}catch(e){r("throw",e)}}function r(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(a,o){var s={key:e,arg:r,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,i(e,r))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(Me.prototype[Symbol.asyncIterator]=function(){return this}),Me.prototype.next=function(e){return this._invoke("next",e)},Me.prototype.throw=function(e){return this._invoke("throw",e)},Me.prototype.return=function(e){return this._invoke("return",e)};n(226);var Le="Cannot convert supplied data type";function Ie(e){return se(e)?e.url:null}function Re(e,t){if(t.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){var n=e.buffer||e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}throw new Error(Le)}function Fe(e,t){return De.apply(this,arguments)}function De(){return(De=oe(re.a.mark(function e(t,n){var i;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(t=e.sent,i=t instanceof ArrayBuffer||ArrayBuffer.isView(t),"string"!=typeof t&&!i){e.next=6;break}return e.abrupt("return",Re(t,n));case 6:if(!ue(t)){e.next=10;break}return e.next=9,me(t);case 9:t=e.sent;case 10:if(!se(t)){e.next=19;break}if(!n.binary){e.next=17;break}return e.next=14,t.arrayBuffer();case 14:e.t0=e.sent,e.next=18;break;case 17:e.t0=t.text();case 18:return e.abrupt("return",e.t0);case 19:throw new Error(Le);case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ne(e,t,n,i){return ze.apply(this,arguments)}function ze(){return(ze=oe(re.a.mark(function e(t,n,i,r){return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=r||Ie(t),e.next=3,Fe(t,n);case 3:if(t=e.sent,!n.parseTextSync||"string"!=typeof t){e.next=7;break}return i.dataType="text",e.abrupt("return",n.parseTextSync(t,i,r,n));case 7:if(!n.parseSync){e.next=9;break}return e.abrupt("return",n.parseSync(t,i,r,n));case 9:if(!n.parse){e.next=13;break}return e.next=12,n.parse(t,i,r,n);case 12:return e.abrupt("return",e.sent);case 13:if(!n.worker){e.next=17;break}return e.next=16,Ae(n.worker,t,i);case 16:return e.abrupt("return",e.sent);case 17:return e.abrupt("return",Object(ge.a)(!1));case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Be(e,t,n,i){return Ue.apply(this,arguments)}function Ue(){return(Ue=oe(re.a.mark(function e(t,n,i,r){var a,o;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||Object(_e.a)(n)||(r=i,i=n,n=null),a=ue(r)?r.name:r,n=n||Object(Se.a)(),o=Array.isArray(n)?Pe(a,t,n):n){e.next=6;break}return e.abrupt("return",null);case 6:return Object(_e.b)(o),i=we(i,o),e.next=10,Ne(t,o,i,a);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Ve(){return(Ve=oe(re.a.mark(function e(t,n,i){var r,a,o;return re.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)||Object(_e.a)(n)||(i=n,n=null),r=ue(t)?t.name:t,n=n||Object(Se.a)(),a=Array.isArray(n)?Pe(r,null,n):n,i=we(i,a),!a||!a.loadAndParse){e.next=9;break}return e.next=8,a.loadAndParse(t,i);case 8:return e.abrupt("return",e.sent);case 9:if(!ue(o=t)&&"string"!=typeof o){e.next=14;break}return e.next=13,ye(t,i);case 13:o=e.sent;case 14:return e.abrupt("return",Be(o,n,i,r));case 15:case"end":return e.stop()}},e)}))).apply(this,arguments)}n.d(t,"a",function(){return Xe});var Ge=Object.freeze([]),We=new Uint8ClampedArray(0),He={data:{type:"data",value:Ge,async:!0},dataComparator:null,_dataDiff:{type:"function",value:function(e){return e&&e.__diff},compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:function(e,t){return function(e,t,n){return Ve.apply(this,arguments)}(e,t.layer.getLoadOptions())},compare:!1},updateTriggers:{},numInstances:void 0,visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:.8},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:g.a.LNGLAT,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:{},uniforms:{},extensions:[],framebuffer:null,animation:null,getPolygonOffset:{type:"function",value:function(e){return[0,100*-e.layerIndex]},compare:!1},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"color",value:[0,0,128,128]}},Xe=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return v()(t,e),u()(t,[{key:"toString",value:function(){var e=this.constructor.layerName||this.constructor.name;return"".concat(e,"({id: '").concat(this.props.id,"'})")}},{key:"setState",value:function(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}},{key:"setNeedsRedraw",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{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:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(T.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(ne.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(T.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){C.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){C.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitPositions",value:function(){return this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return C.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.props.extensions[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=A(e,o.getShaders.call(this,o))}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return e}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();if(t.dataChanged&&n){var i=t.dataChanged;if(Array.isArray(i)){var r=!0,a=!1,o=void 0;try{for(var s,u=i[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;n.invalidateAll(c)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}else n.invalidateAll()}}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(C.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(C.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;this._setModelAttributes(o,e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"_updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}}},{key:"updateTransition",value:function(){var e=this.getAttributeManager();e&&e.updateTransition(this.context.time)}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.numInstances,i=e.value,r=e.size;if(1!==i[0]){var a=We.length/r;if(a2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=Object(O.c)(v),o[2*l+1]=Object(O.c)(g)),s[l]=1,l++}if(h)for(var m=0;m2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(146);n.d(t,"c",function(){return k}),n.d(t,"b",function(){return C}),n.d(t,"a",function(){return E});var w="\n\n".concat(x.a,"\n\n"),O=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),S={},j="precision highp float;\n\n";function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function C(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);S[e]=S[e]||{},S[e][o]=S[e][o]||{},Object(s.a)(!S[e][o][n],"Module injection already created"),S[e][o][n]={injection:i,order:a}}function E(e,t){var n=t.vs,i=t.fs,r=Object(o.d)(t.modules||[]);return{gl:e,vs:A(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:A(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:T(r),modules:M(r)}}function A(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=t.defines,c=void 0===u?{}:u,l=t.inject,f=void 0===l?{}:l,h=t.prologue,v=void 0===h||h,p=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var b=r===a.b,_=i.split("\n"),k=100,C="",E=i;0===_[0].indexOf("#version ")&&(k=300,C=_[0],E=_.slice(1).join("\n"));var A={};o.forEach(function(e){Object.assign(A,e.getDefines())}),Object.assign(A,c);var T=v?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(O[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(O[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(A),"\n").concat(b?"":j,"\n"):"".concat(C,"\n"),M=!1,L={},I={};for(var R in f){var F="string"==typeof f[R]?{injection:f[R],order:0}:f[R];R.match(/^(v|f)s:/)?"#"===R[3]?I[R]=[F]:L[R]=[F]:I[R]=[F]}var D=!0,N=!1,z=void 0;try{for(var B,U=o[Symbol.iterator]();!(D=(B=U.next()).done);D=!0){var V=B.value;switch(V.name){case"inject":M=!0;break;default:if(p&&V.checkDeprecations(E,p),T+=V.getModuleSource(r,k),S[V.name]){var G=S[V.name][r];for(var W in G)W.match(/^(v|f)s:#/)?(I[W]=I[W]||[],I[W].push(G[W])):(L[W]=L[W]||[],L[W].push(G[W]))}}}}catch(e){N=!0,z=e}finally{try{D||null==U.return||U.return()}finally{if(N)throw z}}return T+=w,T+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,L),T+=E,T=Object(x.c)(T,r,I,M)}function T(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function M(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.b)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(22),l=function(e,t){if(!e)throw new Error(t)},f=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t=0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(29),u=n(200),c=n(18),l={position:[0,0,0],lookAt:[0,0,0],up:[0,0,1],rotationX:0,rotationY:0,fov:50,near:1,far:100},f=function(){function e(t){r()(this,e);var n=t.width,i=t.height,a=t.position,o=void 0===a?l.position:a;Object(c.a)(Number.isFinite(n),"`width` must be supplied"),Object(c.a)(Number.isFinite(i),"`height` must be supplied"),this._viewportProps=this._applyConstraints(Object.assign({},t,{position:new s.a(o)}))}return o()(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getDirection",value:function(){return new u.a({bearing:this._viewportProps.bearing,pitch:this._viewportProps.pitch}).toVector3().normalize()}},{key:"getDirectionFromBearing",value:function(e){return new u.a({bearing:e,pitch:90}).toVector3().normalize()}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}()},function(e,t,n){"use strict";function i(e){for(var t=e.data,n=e.getIndex,i=e.dataRange,r=e.replace,a=i.startRow,o=void 0===a?0:a,s=i.endRow,u=void 0===s?1/0:s,c=t.length,l=c,f=c,h=0;hh&&d>=o&&(l=h),d>=u){f=h;break}}for(var v=l,g=f-l!==r.length,p=g&&t.slice(f),m=0;m=t.min)}},array:{validate:function(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function c(e){var t=l(e);return"object"===t?e?"type"in e?Object.assign({},e,u[e.type]):"value"in e?(t=l(e.value),Object.assign({type:t},e,u[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},u[t])}function l(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":Object(s.a)(e)}n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var f=function(){function e(t){var n=t.name,r=t.vs,a=t.fs,s=t.dependencies,u=void 0===s?[]:s,l=t.uniforms,f=t.getUniforms,h=t.deprecations,d=void 0===h?[]:h,v=t.defines,g=void 0===v?{}:v,p=t.vertexShader,m=t.fragmentShader;Object(i.a)(this,e),Object(o.a)("string"==typeof n),this.name=n,this.vs=r||p,this.fs=a||m,this.getModuleUniforms=f,this.dependencies=u,this.deprecations=this._parseDeprecationDefinitions(d),this.defines=g,l&&(this.uniforms=function(e){var t={};for(var n in e){var i=c(e[n]);t[n]=i}return t}(l))}return Object(r.a)(e,[{key:"getModuleSource",value:function(e,t){var n;switch(e){case"vs":n=a(this.vs||"",t,!0);break;case"fs":n=a(this.fs||"",t,!1);break;default:Object(o.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase(),"\n").concat(n,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,t){this.deprecations.forEach(function(n){n.regex.test(e)&&(n.deprecated?t.deprecated(n.old,n.new)():t.removed(n.old,n.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=this.uniforms;for(var i in n){var r=n[i];i in e&&!r.private?(r.validate&&Object(o.a)(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function h(e){if(!e.normalized&&(e.normalized=!0,e.uniforms&&!e.getUniforms)){var t=new f(e);e.getUniforms=t.getUniforms.bind(t)}return e}},function(e,t,n){"use strict";n.d(t,"b",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"a",function(){return g});var i=n(230),r=n.n(i);function a(e){if(e=e&&e.positions||e,!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new Error("invalid polygon")}function o(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(97),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return p}),n.d(t,"c",function(){return m});var i=n(5),r=n(10),a=n(9),o=n(11),s=n(4),u=n(29),c=n(67),l=[255,255,255],f=[0,0,1],h=[0,0,-1],d=[0,0,1],v=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e),this.id=t.id||Object(c.c)("light");var n=t.color,i=void 0===n?l:n;this.color=i;var r=t.intensity,a=void 0===r?1:r;this.intensity=a},g=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="ambient",e}return Object(o.a)(t,e),t}(v),p=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="directional";var i=n.direction,o=void 0===i?h:i;return e.direction=new u.a(o).normalize().toArray(),e}return Object(o.a)(t,e),t}(v),m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="point";var i=n.position,o=void 0===i?d:i;return e.position=o,e.attenuation=e._getAttenuation(n),e}return Object(o.a)(t,e),Object(i.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:f}}]),t}(v)},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=function(e){function t(e){var n;r()(this,t),n=u()(this,l()(t).call(this,e));var i=e._shadow,a=void 0!==i&&i;return n.shadow=a,n}return h()(t,e),o()(t,[{key:"getProjectedLight",value:function(){return this}}]),t}(n(144).b)},function(e,t,n){"use strict";var i,r=n(0),a=n(71),o=n(118);n.d(t,"a",function(){return u}),n.d(t,"c",function(){return h}),n.d(t,"b",function(){return d});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u="__LUMA_INJECT_DECLARATIONS__",c=/void main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,f=[];function h(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),f.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(65),r=n(24),a=n(25);function o(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var s={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(a.a)(t))},blendEquation:function(e,t){t=o(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(a.a)(t))},blendFunc:function(e,t){t=o(t)&&2===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,e.blendFuncSeparate.apply(e,Object(a.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(a.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(a.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(a.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(a.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(a.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(a.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=o(t)?t:[t,t],i=Object(r.a)(n,2),a=i[0],s=i[1];e.stencilMaskSeparate(1028,a),e.stencilMaskSeparate(1029,s)},stencilFunc:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilFuncSeparate(1028,s,u,c),e.stencilFuncSeparate(1029,l,f,h)},stencilOp:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilOpSeparate(1028,s,u,c),e.stencilOpSeparate(1029,l,f,h)},viewport:function(e,t){return e.viewport.apply(e,Object(a.a)(t))}};function u(e,t){for(var n in Object(i.f)(e,t),t){var r=s[n];r&&r(e,t[n],n)}}n.d(t,"a",function(){return u})},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(125),v=n(109),g=n(144),p=n(145),m=n(103),y=n(64),b=n(29),_=n(8),x=n.n(_),w=n(13),O=n.n(w),P=n(102),S=n(95),j=n(60),k=n(70),C=function(e){function t(e,n){var i,a,o;return r()(this,t),(o=u()(this,l()(t).call(this,e,n))).shadowMap=new d.a(e,{width:1,height:1,parameters:(i={},x()(i,10241,9729),x()(i,10240,9729),x()(i,10242,33071),x()(i,10243,33071),i)}),o.depthBuffer=new S.a(e,{format:33189,width:1,height:1}),o.fbo=new j.a(e,{id:"shadowmap",width:1,height:1,attachments:(a={},x()(a,36064,o.shadowMap),x()(a,36096,o.depthBuffer),a)}),o}return h()(t,e),o()(t,[{key:"render",value:function(e){var n=this,i=this.fbo;Object(k.a)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var r=e.viewports[0],a=r.width*n.props.pixelRatio,o=r.height*n.props.pixelRatio;a===i.width&&o===i.height||i.resize({width:a,height:o}),O()(l()(t.prototype),"render",n).call(n,Object.assign(e,{outputBuffer:i}))})}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,drawToShadowMap:!0,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{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)}}]),t}(P.a),E=n(162);n.d(t,"a",function(){return L});var A={color:[255,255,255],intensity:1},T=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],M=[0,0,0,200/255],L=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],n.shadowColor=M,n.shadowPasses=[],n.dummyShadowMaps=[],n.shadow=!1,e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n._applyDefaultLights(),n.directionalLights.some(function(e){return e.shadow})&&(n.shadow=!0,n._addShadowModule()),n}return h()(t,e),o()(t,[{key:"prepare",value:function(e,t){var n=t.layers,i=t.viewports,r=t.onViewportActive,a=t.views,o=t.pixelRatio;if(!this.shadow)return{};var s=this._createLightMatrix();0===this.shadowPasses.length&&this._createShadowPasses(e,o),0===this.dummyShadowMaps.length&&this._createDummyShadowMaps(e);for(var u=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.a)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new g.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(p.a)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(177).a),y=n(138);n.d(t,"a",function(){return b});var b=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(y.b)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=w(t),a=new m(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=w(t,r),s="".concat(n,"-").concat(a);return new m(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return _(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return x(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(16),r=n.n(i),a=n(31),o=n(135),s=n(37),u=n(40),c=n(27);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.n([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.m(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.overAlloc,i=void 0===n?2:n,a=t.poolSize,o=void 0===a?100:a;r()(this,e),this.overAlloc=i,this.poolSize=o,this._pool=[]}return o()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=void 0===i?1:i,a=n.type,o=n.padding,s=void 0===o?0:o,u=n.copy,c=void 0!==u&&u,l=a||e&&e.constructor||Float32Array,f=t*r+s;if(ArrayBuffer.isView(e)){if(f<=e.length)return e;if(f*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new l(e.buffer,0,f)}var h=this._allocate(l,f);return e&&c?h.set(e):h.fill(0,0,4),this._release(e),h}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,t){t=Math.max(Math.ceil(t*this.overAlloc),1);var n=this._pool,i=e.BYTES_PER_ELEMENT*t,r=n.findIndex(function(e){return e.byteLength>=i});return r>=0?new e(n.splice(r,1)[0],0,t):new e(t)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.poolSize&&t.shift()}}}]),e}();t.a=new s},function(e,t){function n(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise(function(r,a){var o=e.apply(t,i);function s(e){n(o,r,a,s,u,"next",e)}function u(e){n(o,r,a,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(32),c=n(24),l=n(55),f=n(27),h=n(20),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(199),p=n(47);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,O=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(f.l)(g);x=Math.max(.75,x);var S=Object(f.g)([d,l],P);S[2]=0;var j=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:O||1.01}),k=Object(f.f)({height:s,center:S,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:k,projectionMatrix:j}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=P,e.center=S,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,,function(e,t,n){"use strict";(function(e){var t=n(97),i=n(141);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return u({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},Object(a.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=s(t),r=o(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}}))},function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return l});var i=n(0),r=n(125),a=n(159),o=n(160),s=n(60),u=n(19);function c(e,t){Object(u.a)(e instanceof r.a||e instanceof a.a||e instanceof o.a);var n=e.constructor,i=e.gl,s=e.width,c=e.height,l=e.format,f=e.type,h=e.dataFormat,d=e.border,v=e.mipmaps;return new n(i,Object.assign({width:s,height:c,format:l,type:f,dataFormat:h,border:d,mipmaps:v},t))}function l(e,t){var n=e.gl,r=e.width,a=e.height,o=e.id;return new s.a(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(i.a)({},36064,e)}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(50),r=n.n(i),a=n(115),o=n(4),s=n(5),u=n(10),c=n(9),l=n(32),f=n(11),h=n(56),d=n(30),v=n(26),g=[34069,34070,34071,34072,34073,34074],p=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,t),Object(d.b)(e),(n=Object(u.a)(this,Object(c.a)(t).call(this,e,Object.assign({},i,{target:34067})))).initialize(i),Object.seal(Object(l.a)(n)),n}return Object(f.a)(t,e),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(a.a)(r.a.mark(function e(t){var n,i,a,o,s,u,c,l,f,h,d,p,m,y=this;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,a=t.pixels,o=t.data,s=t.border,u=void 0===s?0:s,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,p=a||o,e.next=5,Promise.all(g.map(function(e){var t=p[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:m=e.sent,this.bind(),g.forEach(function(e,t){m[t].length>1&&!1!==y.opts.mipmaps&&v.a.warn("".concat(y.id," has mipmap and multiple LODs."))(),m[t].forEach(function(t,r){n&&i?d.texImage2D(e,r,l,n,i,u,l,h,t):d.texImage2D(e,r,l,l,h,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(h.a);p.FACES=g},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(70),l=n(30),f=n(56),h=n(98),d=n(43),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.a)(e),s=Object.assign({depth:1},s,{target:32879,unpackFlipY:!1}),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(s.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,l=void 0===u?1:u,f=e.border,v=void 0===f?0:f,g=e.format,p=e.type,m=void 0===p?5121:p,y=e.offset,b=void 0===y?0:y,_=e.data,x=e.parameters,w=void 0===x?{}:x;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(c.a)(this.gl,w,function(){ArrayBuffer.isView(_)&&t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,_),_ instanceof d.a&&(t.gl.bindBuffer(35052,_.handle),t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,b))}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var O=h.a[this.dataFormat]||4,P=h.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*O*P,"Texture")}return this.loaded=!0,this}}]),t}(f.a)},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(77),r=n.n(i),a=n(16),o=n.n(a),s=n(131),u=n(42),c=n(64),l=n(29),f=n(94),h=n(27),d=Object(f.a)(function(e){var t=e.viewport,n=e.center;return new c.a(t.viewProjectionMatrix).invert().transformVector4(n)}),v=Object(f.a)(function(e){var t=e.viewport,n=e.shadowMatrices,i=[],a=t.pixelUnprojectionMatrix,s=[[0,0],[t.width,0],[0,t.height],[t.width,t.height],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(function(e){return function(e,t){var n=o()(e,3),i=n[0],r=n[1],a=n[2],s=Object(h.h)([i,r,a],t);if(Number.isFinite(a))return s;return[s[0],s[1],0]}(e,a)}),u=!0,f=!1,d=void 0;try{for(var v,g=function(){var e=v.value,n=e.clone().translate(new l.a(t.center).negate()),a=s.map(function(e){return n.transformVector3(e)}),o=(new c.a).ortho({left:Math.min.apply(Math,r()(a.map(function(e){return e[0]}))),right:Math.max.apply(Math,r()(a.map(function(e){return e[0]}))),bottom:Math.min.apply(Math,r()(a.map(function(e){return e[1]}))),top:Math.max.apply(Math,r()(a.map(function(e){return e[1]}))),near:Math.min.apply(Math,r()(a.map(function(e){return-e[2]}))),far:Math.max.apply(Math,r()(a.map(function(e){return-e[2]})))});i.push(o.multiplyRight(e))},p=n[Symbol.iterator]();!(u=(v=p.next()).done);u=!0)g()}catch(e){f=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(f)throw d}}return i});Object(s.b)("shadow",{hook:"vs:DECKGL_FILTER_GL_POSITION",injection:"\nposition = shadow_setVertexPosition(geometry.position);\n "}),Object(s.b)("shadow",{hook:"fs:DECKGL_FILTER_COLOR",injection:"\ncolor = shadow_filterShadowColor(color);\n "});var g=[0,0,0,1],p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];t.a={name:"shadow",dependencies:["project"],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap[max_lights];\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[i], shadow_uShadowMap[i]) * shadow_uColor.a / shadow_uLightCount;\n }\n }\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){var n={},i=e.shadowEnabled;return(void 0===i||i)&&e.shadowMatrices&&e.shadowMatrices.length>0?Object.assign(n,function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||g,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=d({viewport:e.viewport,center:t.project_uCenter}),r=[],a=v({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice(),o=0;o0?n["shadow_uShadowMap[".concat(f,"]")]=e.shadowMaps[f]:n["shadow_uShadowMap[".concat(f,"]")]=e.dummyShadowMaps[0];return n}(e,t)):Object.assign(n,{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}),n}return{}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(164),g=n(171),p=function(e){function t(e){return r()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:v.a})))}return h()(t,e),o()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.a})}}]),t}(d.a);p.displayName="MapView"},function(e,t,n){"use strict";n.d(t,"a",function(){return O});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(87),p=n.n(g),m=n(45),y=n(27),b=n(199),_=n(47),x=n(18),w="Illegal argument to WebMercatorViewport",O=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,O=void 0!==w&&w,P=n.width,S=n.height,j=n.altitude,k=void 0===j?1.5:j;P=P||1,S=S||1,k=Math.max(.75,k);var C=Object(y.e)({width:P,height:S,pitch:d,altitude:k,nearZMultiplier:b,farZMultiplier:x}),E=C.fov,A=C.aspect,T=C.focalDistance,M=C.near,L=C.far,I=Object(y.f)({height:S,pitch:d,bearing:g,altitude:k}),R=Object.assign({},n,{width:P,height:S,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:O,fovyRadians:E,aspect:A,orthographicFocalDistance:T,near:M,far:L});return(e=l()(this,h()(t).call(this,R))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=k,e.orthographic=O,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);O.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(77),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(18),l=n(189),f=n(41),h=n.n(f),d=n(129),v=n(99),g=n(15),p=n(75),m=n(267),y=n(45),b=n(69),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,mousePosition:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l.a({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(83),p=n(136),m=n(22),y=n(29);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(83),v=n(128),g=n(81),p=n(82),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(16),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(13),v=n.n(d),g=n(7),p=n.n(g),m=n(43),y=n(18),b=n(72),_=n(75),x=[],w=[[0,1/0]];var O=n(15),P=n(126),S=n(104),j=n(59),k=n(67),C=n(26),E=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(k.c)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(P.b)(t,S.a.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a),this._setAccessor(e);for(var o=this.elementOffset,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({offset:n.offset,stride:n.stride,normalized:n.normalized},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,T,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"delete",value:function(){v()(h()(t.prototype),"delete",this).call(this),A.a.release(this.userData.allocatedValue)}},{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;if(t.update){Object(y.a)(Number.isFinite(e));var n=Math.max(e,1),i=L(this.type||5126),r=t.allocatedValue,a=t.updateRanges!==w;return this.constant=!1,this.value=A.a.allocate(r,n,{size:this.size,type:i,padding:this.elementOffset,copy:a}),this.buffer&&this.buffer.byteLength=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return n+e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(E);function L(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}var I=n(223);function R(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.a){var l=new Float32Array(r),f=t.getData({}),h=n.size,d=n.constant,v=d?n.getValue():n.getBuffer().getData({}),g=d?function(e,t){return c(v,t)}:function(e,t){return c(v.subarray(e,e+h),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.offset,a=void 0===r?0:r,o=e.getData,s=e.sourceLayout,u=e.targetLayout;if(!Array.isArray(u))return R({source:t,target:n,getData:o}),n;for(var c=a,l=a,f=o&&function(e,t){return o(e+l,t)},h=Math.min(s.length,u.length),d=0;d0),this.needsRedraw=!0;var n=Object.assign({},U,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return H});function G(){}var W={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;O.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;W.savedMessages=[],W.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;W.savedMessages&&W.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-W.timeStart),a="".concat(r,"ms");O.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=W.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;O.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}O.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),W.savedMessages=null}},H=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new V(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(W.onLog=t||G),void 0!==n&&(W.onUpdateStart=n||G),void 0!==i&&(W.onUpdate=i||G),void 0!==r&&(W.onUpdateEnd=r||G)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in W.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h]||t.attributes&&t.attributes[h])||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&W.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&O.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new M(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),O.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&W.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);W.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(129),y=n(191),b=n(93),_=n(229),x=n.n(_),w=n(15),O=n(67),P=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(O.c)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;w.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:j},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:j},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=r.extensionsChanged;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new P({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);w.layerName="ScatterplotLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(22),p=n(83),m=n(136),y=n(153),b=n(55),_=85.05113,x=-85.05113;var w=n(18),O=n(81),P=n(82);n.d(t,"a",function(){return A});var S={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new O.a,transitionInterruption:P.a.BREAK},j={transitionDuration:0},k={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},C={pitch:0,bearing:0,altitude:1.5},E=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?C.bearing:c,d=n.pitch,v=void 0===d?C.pitch:d,g=n.altitude,p=void 0===g?C.altitude:g,m=n.maxZoom,y=void 0===m?k.maxZoom:m,b=n.minZoom,_=void 0===b?k.minZoom:b,x=n.maxPitch,O=void 0===x?k.maxPitch:x,P=n.minPitch,S=void 0===P?k.minPitch:P,j=n.startPanLngLat,E=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,M=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:O,minPitch:S})))._interactiveState={startPanLngLat:j,startZoomLngLat:E,startBearing:A,startPitch:T,startZoom:M},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,E,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return S}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,j,{isDragging:!0,isRotating:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(15),u=n(6),c=n.n(u),l=n(3),f=n.n(l),h=n(13),d=n.n(h),v=n(7),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(102).a),m=n(182),y=n(183),b=n(149),_=n(60);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h,pixelRatio:this.pixelRatio}),m=this.lastPostProcessEffect?this.screenBuffer:_.a.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.a(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.a(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.a.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(34),r=n(174);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(89))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(34);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(89))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(126),f=n(104),h=n(30),d=n(19),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(h.d)(e),i=Object(l.c)(e,f.a.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Object(d.a)(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(s.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(22),u=n(18),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(35),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(102),p=n(70),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.a)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";function i(e){return e&&"undefined"!=typeof window?window.devicePixelRatio:1}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(132),c=n(47),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,r=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,r=void 0===n?16:n,a=t.size,o=void 0===a?1:a,s="[",u=0;u0&&(s+=",".concat(u%o==0?" ":"")),s+=i(e[u],t);var c=e.length>r?"...":"]";return"".concat(s).concat(c)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return r?"0":"0.";if(r)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var a=e.toPrecision(2);return a.indexOf(".0")===a.length-2?a.slice(0,-1):a}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var i=n(114),r="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var a={name:"gouraud-lighting",dependencies:[i.a],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:u},o={name:"phong-lighting",dependencies:[i.a],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:u},s={};function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor.map(function(e){return e/255}),t}(t):{lighting_uEnabled:!1}}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(4),r=n(5),a=n(61),o=n(196),s=n(19),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Object(s.a)(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new a.c(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new a.a(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Object(s.a)(this._compareContexts(e,this.gl)),Object(s.a)("string"==typeof t.vs),Object(s.a)("string"==typeof t.fs),Object(s.a)("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new o.a(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(36),r=n(4),a=n(10),o=n(9),s=n(11),u=n(58),c=n(67),l=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]),f=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]),h=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]),d=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]),v={POSITION:{size:3,value:new Float32Array(f)},NORMAL:{size:3,value:new Float32Array(h)},TEXCOORD_0:{size:2,value:new Float32Array(d)}},g=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.id,s=void 0===n?Object(c.c)("cube-geometry"):n;return Object(a.a)(this,Object(o.a)(t).call(this,Object(i.a)({},e,{id:s,indices:{size:1,value:new Uint16Array(l)},attributes:Object(i.a)({},v,e.attributes)})))}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(11),u=n(127),c={ambient:.35,diffuse:.6,shininess:32,specularColor:[30,30,30]},l=function(e){function t(e){var n;return Object(i.a)(this,t),n=Object(r.a)(this,Object(a.a)(t).call(this,e)),e=Object.assign({},c,e),Object.assign(Object(o.a)(n),e),n}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(129),p=n(15),m=n(75),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){h()(l()(t.prototype),"setState",this).call(this,e),this.setLayerNeedsUpdate()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?Object.assign(t,{object:n.__source.object,index:n.__source.index}):t}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerRow",value:function(e,t,n){return e.__source={parent:this,object:t,index:n},e}},{key:"getSubLayerAccessor",value:function(e){if("function"==typeof e){var t={data:this.props.data,target:[]};return function(n,i){return n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,i)}}return e}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,f=t.coordinateOrigin,h=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,g=t.extensions,p=t._subLayerProps,m={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:v,extensions:g};if(e){var y=p&&p[e.id],b=y&&y.updateTriggers;Object.assign(m,e,y,{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers,b)})}var _=!0,x=!1,w=void 0;try{for(var O,P=g[Symbol.iterator]();!(_=(O=P.next()).done);_=!0){var S=O.value,j=S.getSubLayerProps.call(this,S);Object.assign(m,j,{updateTriggers:Object.assign(m.updateTriggers,j.updateTriggers)})}}catch(e){x=!0,w=e}finally{try{_||null==P.return||P.return()}finally{if(x)throw w}}return m}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?p.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,p.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(g.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(165),l=n(18),f=n(105),h=n(53),d=n(45),v=n(15),g=n(75),p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return u()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i={x:e[0],y:e[1]},r=n.length-1;r>=0;--r){var a=n[r];if(a.containsPixel(i)){var o=e.slice();return o[0]-=a.x,o[1]-=a.y,a.unproject(o,t)}}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(l.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(g.b)(e,{filter:Boolean}).map(function(e){return e instanceof d.a?new h.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(f.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):v.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),m=n(163),y=n(148),b=new y.a,_=function(){function e(){o()(this,e),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return u()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(f.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e,this._createInternalEffects()}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=!0,o=!1,s=void 0;try{for(var u,c=this._internalEffects[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){u.value.cleanup()}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some(function(e){return e instanceof y.a})||this._internalEffects.push(b)}}]),e}(),x=n(103),w=n(172),O=n(60),P=n(80),S=n(183),j=n(182),k={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function C(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,h=-1,d=0,g=0;gf)d+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,h=d)}d+=4}}if(h>=0){var x=t[h+3]-1,w=t.slice(h,h+4),O=n[x];if(O){var P=O.decodePickingColor(w);return{pickedColor:w,pickedLayer:O,pickedObjectIndex:P}}v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return k}function E(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=A({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function A(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var T=function(){function e(t){o()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new j.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return u()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(S.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new O.a(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-(r+1)*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=A({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(l.a)(r),Object(l.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(l.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,u=r.y,c=r.width,f=r.height,h=new Uint8Array(c*f*4);return Object(P.e)(o,{sourceX:s,sourceY:u,sourceWidth:c,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight,o=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-o,c=Math.min(a,n+i+1)-s;return u<=0||c<=0?null:{x:o,y:s,width:u,height:c}}},{key:"callLayerPickingCallbacks",value:function(e,t){var n=[],i=this.pickingEvent;return e.forEach(function(e){if(e.layer){var r=!1;switch(t){case"hover":r=e.layer.onHover(e,i);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}}),n}}]),e}(),M=n(195),L=n(203),I=n(91),R=n(90),F=n(147),D=n(107),N=n(267),z=n(24),B=n(4),U=n(5),V=1,G=2,W=4,H={mousedown:V,mousemove:G,mouseup:W};var X,q,Z=null;"undefined"!=typeof document&&(Z=n(256),X=Z.PointerEventInput,q=X.prototype.handler,X.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&G&&0===e.which&&(t=W),this.pressed&&(t&W&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var Y=Z;var K=Y?[[Y.Rotate,{enable:!1}],[Y.Pinch,{enable:!1}],[Y.Swipe,{enable:!1}],[Y.Pan,{threshold:0,enable:!1}],[Y.Press,{enable:!1}],[Y.Tap,{event:"doubletap",taps:2,enable:!1}],[Y.Tap,{event:"anytap",enable:!1}],[Y.Tap,{enable:!1}]]:null,Q={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},J={doubletap:["tap"]},$={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ee=["keydown","keyup"],te=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],ne=["wheel","mousewheel","DOMMouseScroll"],ie={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",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"},re={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ae=n(119),oe=-1!==ae.b.indexOf("firefox"),se=ne,ue=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=se.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!ae.a&&{passive:!1})})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;ae.c.WheelEvent&&(oe&&e.deltaMode===ae.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=ae.c.devicePixelRatio),e.deltaMode===ae.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ce=te,le=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=ce.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),fe=ee,he=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=fe.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),de=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(U.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ve=1,ge=2,pe=4,me={pointerdown:ve,pointermove:ge,pointerup:pe,mousedown:ve,mousemove:ge,mouseup:pe},ye=1,be=2,_e=3,xe=0,we=1,Oe=2,Pe=1,Se=2,je=4;var ke=function(){function e(t){Object(B.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(U.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(B.a)(this,e),this.options=Object.assign({},Ce,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(U.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||K}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(Q).forEach(function(e){var n=t.manager.get(e);n&&Q[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new ue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new le(e,this._onOtherEvent,{enable:!1}),this.keyInput=new he(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new de(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(z.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=J[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=re[e]||e,o=r.get(a);o||(o=new ke(this),r.set(a,o),o.recognizerName=ie[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=re[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=$[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),Ae=n(31);function Te(){}n.d(t,"a",function(){return Le});var Me={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:Te,onResize:Te,onViewStateChange:Te,onBeforeRender:Te,onAfterRender:Te,onLoad:Te,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Le=function(){function e(t){o()(this,e),t=Object.assign({},Me,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),function(){if(void 0===("undefined"==typeof window?"undefined":r()(window)))return!1;return-1!==((window.navigator||{}).userAgent||"").indexOf("Trident/")}()&&v.a.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new N.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return u()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&v.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&v.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(l.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new L.a({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(I.a)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new m.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.callback=this.props.onHover,t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(R.a)(e,{enable:!0,copyState:!0})),Object(F.a)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new Ee(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Ae.b)this.eventManager.on(t,this._onEvent);this.viewManager=new p({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(l.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new c.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new _,this.deckRenderer=new w.a(e),this.deckPicker=new T(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(F.a)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),v.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=Ae.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){this.stats.get("frameRate").timeEnd(),this.stats.get("frameRate").timeStart();var e=this.animationLoop.stats;this.stats.get("GPU Time").addTime(e.get("GPU Time").lastTiming),this.stats.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){this.metrics.fps=this.stats.get("frameRate").getHz(),this.metrics.setPropsTime=this.stats.get("setProps Time").time,this.metrics.updateAttributesTime=this.stats.get("Update Attributes").time,this.metrics.framesRedrawn=this.stats.get("Redraw Count").count,this.metrics.pickTime=this.stats.get("pickObject Time").time+this.stats.get("pickMultipleObjects Time").time+this.stats.get("pickObjects Time").time,this.metrics.pickCount=this.stats.get("Pick Count").count,this.metrics.gpuTime=this.stats.get("GPU Time").time,this.metrics.cpuTime=this.stats.get("CPU Time").time,this.metrics.gpuTimePerFrame=this.stats.get("GPU Time").getAverageTime(),this.metrics.cpuTimePerFrame=this.stats.get("CPU Time").getAverageTime();var e=D.a.get("Memory Usage");this.metrics.bufferMemory=e.get("Buffer Memory").count,this.metrics.textureMemory=e.get("Texture Memory").count,this.metrics.renderbufferMemory=e.get("Renderbuffer Memory").count,this.metrics.gpuMemory=e.get("GPU Memory").count}}]),e}();Le.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(x.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Le.defaultProps=Me,Le.VERSION=M.a.VERSION},function(e,t,n){"use strict";var i=n(109),r=n(131),a=n(204),o=n(188),s=n(205),u={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n} geometry;\n",fs:"\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n"},c=n(84),l={name:"project32",dependencies:[c.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"};function f(){Object(i.c)([a.a,c.a,l,o.a,o.b,s.a]),Object(i.e)([u,c.a]),Object(r.c)("vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)"),Object(r.c)("fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"),Object(r.b)("picking",{hook:"fs:DECKGL_FILTER_COLOR",order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n"})}n.d(t,"a",function(){return f})},function(e,t,n){"use strict";var i=n(116),r=n(121),a=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],o=(r.a&&r.d,!r.a&&r.b,r.e,{extensions:a,loadAndParse:r.c}),s=n(108),u=n(15);var c={name:"JSON",extensions:["json","geojson"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},l=n(194),f="7.2.0-beta.2";if(s.a.deck&&s.a.deck.VERSION!==f)throw new Error("deck.gl - multiple versions detected: ".concat(s.a.deck.VERSION," vs ").concat(f));s.a.deck||(u.a.log(0,"deck.gl ".concat(f," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),s.a.deck=s.a.deck||{VERSION:f,version:f,log:u.a},Object(i.b)([c,o]),Object(l.a)());t.a=s.a.deck},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(32),s=n(9),u=n(66),c=n(11),l=n(52),f=n(56),h=n(60),d=n(74),v=n(61),g=n(59),p=n(30),m=n(73),y=function(){function e(t){Object(i.a)(this,e),this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}return Object(r.a)(e,[{key:"getAttributeInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var t=this.getAttributeInfo(e);return t?t.location:-1}},{key:"getAttributeAccessor",value:function(e){var t=this.getAttributeInfo(e);return t?t.accessor:null}},{key:"getVaryingInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var t=this.getVaryingInfo();return t?t.location:-1}},{key:"getVaryingAccessor",value:function(e){var t=this.getVaryingInfo();return t?t.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var t=e.gl,n=t.getProgramParameter(e.handle,35721),i=0;i=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(Object(p.d)(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(s.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",P),n._isCached=!1,n.initialize(r),Object.seal(Object(o.a)(n)),n._setId(r.id),n}return Object(c.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new v.c(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new v.a(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,Object(x.a)(this.vs instanceof v.c),Object(x.a)(this.fs instanceof v.a),this.uniforms={},i&&(Object(p.a)(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new y(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,f=void 0!==l&&l,h=e.indexType,d=void 0===h?5123:h,v=e.isInstanced,g=void 0!==v&&v,y=e.instanceCount,O=void 0===y?0:y,P=e.vertexArray,S=void 0===P?null:P,j=e.transformFeedback,k=e.framebuffer,C=e.parameters,E=void 0===C?{}:C,A=e.uniforms,T=e.samplers;if((A||T)&&(w.a.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(A||{})),void 0!==n){var M=k?k.id:"default",L="mode=".concat(Object(_.a)(this.gl,r)," verts=").concat(a," ")+"instances=".concat(O," indexType=").concat(Object(_.a)(this.gl,d)," ")+"isInstanced=".concat(g," isIndexed=").concat(f," ")+"Framebuffer=".concat(M);w.a.log(n,L)()}return Object(x.a)(S),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(S.bindForDraw(a,O,function(){if(void 0!==k&&(E=Object.assign({},E,{framebuffer:k})),j){var e=Object(m.c)(r);j.begin(e)}t._bindTextures(),Object(b.a)(t.gl,E,function(){f&&g?t.gl.drawElementsInstanced(r,a,d,s,O):f&&Object(p.d)(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):f?t.gl.drawElements(r,a,d,s):g?t.gl.drawArraysInstanced(r,s,a,O):t.gl.drawArrays(r,s,a)}),j&&j.end()}),!0)}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=!1,i={};for(var r in e)Object(d.a)(this.uniforms[r],e[r])||(n=!0,i[r]=e[r],this.uniforms[r]=Object(d.c)(e[r]));return n&&(t(),Object(d.b)(i,this.id,this._uniformSetters),this._setUniforms(i)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof h.a)i=i.texture;if(i instanceof f.a)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof h.a&&(n=n.texture),n instanceof f.a)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof h.a&&(n=n.texture),n instanceof f.a){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new v.c({handle:u});break;case 35632:n.fs=new v.a({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Object(O.c)(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),w.a.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),w.a.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||w.a.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1)for(var s=0;s0&&w[1]>0);var O=w[0]/x[0],P=w[1]/x[1],S=(u.right-u.left)/2/O,j=(u.bottom-u.top)/2/P,k=[(_[0]+b[0])/2+S,(_[1]+b[1])/2+j],C=y.unproject(k),E=y.zoom+Math.log2(Math.abs(Math.min(O,P)));return{longitude:C[0],latitude:C[1],zoom:E}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(24),r=n(4),a=n(5),o=n(22),s=n(29),u=n(40),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.g(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(43),f=n(30),h=n(67),d=n(26),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(f.a)(e),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(f.d)(e)}}]),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(h.a)(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,d.a.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof l.a==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(4),r=n(5),a=n(59),o=n(43),s=n(106),u=n(235),c=n(26),l=n(19),f=/^(.+)__LOCATION_([0-9]+)$/,h=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=s.a.isSupported(t)?new s.a(t):s.a.getDefaultArray(t),Object(u.a)(this,"VertexArray","v6.0",h),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new o.a(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof o.a){var a=n;if(r){var s=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,s)}else{var u=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,u)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c.a.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(34),r=n(50),a=n.n(r),o=n(115),s=n(4),u=n(5),c=n(91),l=n(107),f=n(124),h=n(176),d=n(134),v=n(30),g=n(65),p=n(60),m=n(26),y=n(19),b=0,_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e);var n=t.onCreateContext,i=void 0===n?function(e){return Object(c.a)(e)}:n,r=t.onAddHTML,a=void 0===r?null:r,o=t.onInitialize,u=void 0===o?function(){}:o,f=t.onRender,h=void 0===f?function(){}:f,d=t.onFinalize,v=void 0===d?function(){}:d,g=t.gl,p=void 0===g?null:g,y=t.glOptions,_=void 0===y?{}:y,x=t.debug,w=void 0!==x&&x,O=t.createFramebuffer,P=void 0!==O&&O,S=t.autoResizeViewport,j=void 0===S||S,k=t.autoResizeDrawingBuffer,C=void 0===k||k,E=t.stats,A=void 0===E?l.a.get("animation-loop-".concat(b++)):E,T=t.useDevicePixels,M=void 0===T||T;"useDevicePixelRatio"in t&&(m.a.deprecated("useDevicePixelRatio","useDevicePixels")(),M=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:a,onInitialize:u,onRender:h,onFinalize:v,gl:p,glOptions:_,debug:w,createFramebuffer:P},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=A,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:j,autoResizeDrawingBuffer:C,useDevicePixels:M}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(u.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Object(y.a)("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,Object(f.b)().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=h.a.isSupported(e.gl,["timers"])?new h.a(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),Object(d.a)(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(o.a)(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return m.a.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;Object(d.a)(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||Object(d.b)(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(i.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Object(c.c)(this.props.gl,e):this.onCreateContext(e),!Object(v.c)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(g.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Object(c.d)(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new p.a(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()&&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}}]),e}()},function(e,t,n){"use strict";t.a={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}},function(e,t,n){"use strict";var i={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};t.a={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}}},function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(0),r=n(43),a=n(68),o=n(73),s=n(186);function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=c(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),f=t.accessors[s.location];f&&(u="".concat(o,": ").concat(l(s.name,f))),r[u]=c(t,a[o],f,i)}}return r}function c(e,t,n,o){var u,c,l,f,h=e.gl,d="NOT PROVIDED",v="N/A",g="N/A",p="N/A";if(n&&(d=n.type,v=n.size,c=-1!==(d=String(d).replace("Array","")).indexOf("nt")),t instanceof r.a){var m,y,b=t,_=b.getDebugData(),x=_.data;if(l=_.modified?"*":"",f=x,g=(p=b.byteLength)/x.BYTES_PER_ELEMENT/v,n){var w=n.divisor>0;y="".concat(w?"I ":"P "," ").concat(g," (x").concat(v,"=").concat(p," bytes ").concat(Object(a.a)(h,d),")")}else c=!0,y="".concat(p," bytes");return m={},Object(i.a)(m,o,"".concat(l).concat(Object(s.a)(f,{size:v,isInteger:c}))),Object(i.a)(m,"Format ",y),m}return f=t,v=t.length,c=-1!==(d=String(t.constructor.name).replace("Array","")).indexOf("nt"),u={},Object(i.a)(u,o,"".concat(Object(s.a)(f,{size:v,isInteger:c})," (constant)")),Object(i.a)(u,"Format ","".concat(v,"x").concat(d," (constant)")),u}function l(e,t){var n=t.type,i=t.size,r=Object(o.b)(n,i);return r?"".concat(e," (").concat(r.name,")"):e}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(0),r=n(19),a=n(186);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,o=e.program,u=e.uniforms,c=e.undefinedOnly,l=void 0!==c&&c;Object(r.a)(o);var f=o._uniformSetters,h={},d=Object.keys(f).sort(),v=0,g=!0,p=!1,m=void 0;try{for(var y,b=d[Symbol.iterator]();!(g=(y=b.next()).done);g=!0){var _=y.value;_.match(".*_.*")||_.match(".*Matrix")||s({table:h,header:n,uniforms:u,uniformName:_,undefinedOnly:l})&&v++}}catch(e){p=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(p)throw m}}var x=!0,w=!1,O=void 0;try{for(var P,S=d[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;j.match(".*Matrix")&&s({table:h,header:n,uniforms:u,uniformName:j,undefinedOnly:l})&&v++}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}var k=!0,C=!1,E=void 0;try{for(var A,T=d[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h[M]||s({table:h,header:n,uniforms:u,uniformName:M,undefinedOnly:l})&&v++}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}var L=0,I={};if(!l)for(var R in u){var F=u[R];h[R]||(L++,I[R]=Object(i.a)({Type:"NOT USED: ".concat(F)},n,Object(a.a)(F)))}return{table:h,count:v,unusedTable:I,unusedCount:L}}function s(e){var t,n=e.table,r=e.header,o=e.uniforms,s=e.uniformName,u=e.undefinedOnly,c=o[s],l=function(e){return null!=e}(c);return(!u||!l)&&(n[s]=(t={},Object(i.a)(t,r,l?Object(a.a)(c):"N/A"),Object(i.a)(t,"Uniform Type",l?c:"NOT PROVIDED"),t),!0)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(0),r=n(73);function a(e){var t={},n="Accessors for ".concat(e.id),r=!0,a=!1,s=void 0;try{for(var u,c=e.attributeInfos[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var l=u.value;if(l){var f=o(l);t["in ".concat(f)]=Object(i.a)({},n,JSON.stringify(l.accessor))}}}catch(e){a=!0,s=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw s}}var h=!0,d=!1,v=void 0;try{for(var g,p=e.varyingInfos[Symbol.iterator]();!(h=(g=p.next()).done);h=!0){var m=g.value;if(m){var y=o(m);t["out ".concat(y)]=Object(i.a)({},n,JSON.stringify(m.accessor))}}}catch(e){d=!0,v=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw v}}return t}function o(e){var t=e.accessor,n=t.type,i=t.size,a=Object(r.b)(n,i);return a?"".concat(a.name," ").concat(e.name):e.name}},function(e,t,n){"use strict";function i(e){var t=100,n=e.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(25),r=n(4),a=n(5),o=n(10),s=n(9),u=n(66),c=n(11),l=n(64),f=n(26),h=n(92),d=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var i=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===i?[]:i;return f.a.assert(a.every(function(e){return e instanceof h.a}),"every child must an instance of ScenegraphNode"),(e=Object(o.a)(this,Object(s.a)(t).call(this,n))).children=a,e}return Object(c.a)(t,e),Object(a.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new l.a:n,r=new l.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;f instanceof t?f.traverse(e,{worldMatrix:r}):e(f,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return f.a.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(h.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(66),u=n(11),c=n(93),l=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof c.a?(n.model=e,n._setModelNodeProps(r)):n.model=new c.a(e,r),n.managedResources=r.managedResources||[],n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return Object(s.a)(Object(o.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(n(92).a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(200),p=n(64),m=n(166);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(1),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(128),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,O=e.zoom,P=void 0===O?0:O;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:P}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(1),u=n.n(s),c=n(6),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(167),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(190),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.a}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(169).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(191),v=n(72),g=n(192),p=n(130),m=n(113),y=n(139),b=n(137),_=new d.a,x={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags),i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(i&&Array.isArray(n.dataChanged)){var r=this.state.paths.slice(),a=n.dataChanged.map(function(e){return Object(b.a)({data:r,getIndex:function(e){return e.__source.index},dataRange:e,replace:t._getPaths(e)})});this.setState({paths:r,pathsDiff:a})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.data,i=t.getPolygon,r=[],a="XY"===t.positionFormat?2:3,o=e.startRow,s=e.endRow,u=Object(v.a)(n,o,s),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var g,p=c[Symbol.iterator]();!(f=(g=p.next()).done);f=!0){var m=g.value;l.index++;var b=y.c(i(m,l),a),_=b.positions,x=b.holeIndices;if(x)for(var w=0;w<=x.length;w++){var O=_.subarray(x[w-1]||0,x[w]||_.length);r.push(this.getSubLayerRow({path:O},m,l.index))}else r.push(this.getSubLayerRow({path:_},m,l.index))}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}return r}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e._dataDiff,i=e.stroked,r=e.filled,a=e.extruded,o=e.wireframe,s=e.elevationScale,u=e.transitions,c=e.positionFormat,l=this.props,f=l.lineWidthUnits,h=l.lineWidthScale,d=l.lineWidthMinPixels,v=l.lineWidthMaxPixels,g=l.lineJointRounded,y=l.lineMiterLimit,b=l.lineDashJustified,_=this.props,x=_.getFillColor,w=_.getLineColor,O=_.getLineWidth,P=_.getLineDashArray,S=_.getElevation,j=_.getPolygon,k=_.updateTriggers,C=_.material,E=this.state,A=E.paths,T=E.pathsDiff,M=this.getSubLayerClass("fill",p.a),L=this.getSubLayerClass("stroke",m.a),I=this.shouldRenderSubLayer("fill",A)&&new M({_dataDiff:n,extruded:a,elevationScale:s,filled:r,wireframe:o,getElevation:S,getFillColor:x,getLineColor:w,material:C,transitions:u},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:k.getPolygon,getElevation:k.getElevation,getFillColor:k.getFillColor,getLineColor:k.getLineColor}}),{data:t,positionFormat:c,getPolygon:j});return[!a&&I,!a&&i&&this.shouldRenderSubLayer("stroke",A)&&new L({_dataDiff:T&&function(){return T},widthUnits:f,widthScale:h,widthMinPixels:d,widthMaxPixels:v,rounded:g,miterLimit:y,dashJustified:b,transitions:u&&{getWidth:u.getLineWidth,getColor:u.getLineColor,getPath:u.getPolygon},getColor:this.getSubLayerAccessor(w),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:k.getLineWidth,getColor:k.getLineColor,getDashArray:k.getLineDashArray}}),{data:A,positionFormat:c,getPath:function(e){return e.path}}),a&&I]}}]),t}(g.a);w.layerName="PolygonLayer",w.defaultProps=x},function(e,t,n){"use strict";var i="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",r={name:"project2",vs:i,fs:i},a=n(114);t.a={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[r,a.a]}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var r="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",a="".concat(r,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),o={ONE:1};t.a={name:"fp64",vs:a,fs:null,fp64ify:i,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var a=4*n+r;i(e[4*r+n],t,2*a)}return t},getUniforms:function(){return Object.assign({},o)}},"".concat(r)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(129),y=n(93),b=n(58);n.d(t,"a",function(){return w});var _=[0,0,0,255],x={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:_},getTargetColor:{type:"accessor",value:_},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n vec2 source = project_position(geometry.worldPosition, instancePositions64Low.xy).xy;\n vec2 target = project_position(geometry.worldPositionAlt, instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:_},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:_},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]);var O=u(x,d);c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);w.layerName="ArcLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(129),y=n(93),b=n(58);n.d(t,"a",function(){return x});var _={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.), target_commonspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),O=u(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]),c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);x.layerName="LineLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(192),v=n(170),g=n(113),p=n(191),m=n(130),y=n(137),b=n(15);function _(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},r=n.startRow,a=void 0===r?0:r,o=n.endRow,s=void 0===o?e.length:o,u=a;u0;)t=t[0];return t&&Number.isFinite(t[0])}(a,o))switch(a){case"Point":s.push(n({geometry:e},i,r));break;case"MultiPoint":o.forEach(function(e){s.push(n({geometry:{type:"Point",coordinates:e}},i,r))});break;case"LineString":u.push(n({geometry:e},i,r));break;case"MultiLineString":o.forEach(function(e){u.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"Polygon":c.push(n({geometry:e},i,r)),o.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"MultiPolygon":o.forEach(function(e){c.push(n({geometry:{type:"Polygon",coordinates:e}},i,r)),e.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))})})}else b.a.warn("".concat(a," coordinates are malformed"))()}var w={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return j});var O=new p.a,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:O};function S(e){return e.geometry.coordinates}var j=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){var t=e.props,n=e.changeFlags;if(n.dataChanged){var i=function(e){if(Array.isArray(e))return e;switch(b.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return b.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data),r=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var a=this.state.features,o={},s={};for(var u in a)o[u]=a[u].slice(),s[u]=[];var c=!0,l=!1,f=void 0;try{for(var h,d=n.dataChanged[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value,g=_(i,r,v);for(var p in a)s[p].push(Object(y.a)({data:o[p],getIndex:function(e){return e.__source.index},dataRange:v,replace:g[p]}))}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}this.setState({features:o,featuresDiff:s})}else this.setState({features:_(i,r),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var e=this.state,t=e.features,n=e.featuresDiff,i=t.pointFeatures,r=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures,s=this.props,u=s.stroked,c=s.filled,l=s.extruded,f=s.wireframe,h=s.material,d=s.transitions,p=this.props,y=p.lineWidthUnits,b=p.lineWidthScale,_=p.lineWidthMinPixels,x=p.lineWidthMaxPixels,w=p.lineJointRounded,O=p.lineMiterLimit,P=p.pointRadiusScale,j=p.pointRadiusMinPixels,k=p.pointRadiusMaxPixels,C=p.elevationScale,E=p.lineDashJustified,A=this.props,T=A.getLineColor,M=A.getFillColor,L=A.getRadius,I=A.getLineWidth,R=A.getLineDashArray,F=A.getElevation,D=A.updateTriggers,N=this.getSubLayerClass("polygons-fill",m.a),z=this.getSubLayerClass("polygons-stroke",g.a),B=this.getSubLayerClass("line-strings",g.a),U=this.getSubLayerClass("points",v.a),V=this.shouldRenderSubLayer("polygons-fill",a)&&new N({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:l,elevationScale:C,filled:c,wireframe:f,material:h,getElevation:this.getSubLayerAccessor(F),getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),transitions:d&&{getPolygon:d.geometry,getElevation:d.getElevation,getFillColor:d.getFillColor,getLineColor:d.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:D.getElevation,getFillColor:D.getFillColor,getLineColor:D.getLineColor}}),{data:a,getPolygon:S});return[!l&&V,!l&&u&&this.shouldRenderSubLayer("polygons-stroke",o)&&new z({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:o,getPath:S}),this.shouldRenderSubLayer("linestrings",r)&&new B({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:r,getPath:S}),this.shouldRenderSubLayer("points",i)&&new U({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:u,filled:c,radiusScale:P,radiusMinPixels:j,radiusMaxPixels:k,lineWidthUnits:y,lineWidthScale:b,lineWidthMinPixels:_,lineWidthMaxPixels:x,getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),getRadius:this.getSubLayerAccessor(L),getLineWidth:this.getSubLayerAccessor(I),transitions:d&&{getPosition:d.geometry,getFillColor:d.getFillColor,getLineColor:d.getLineColor,getRadius:d.getRadius,getLineWidth:d.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:D.getFillColor,getLineColor:D.getLineColor,getRadius:D.getRadius,getLineWidth:D.getLineWidth}}),{data:i,getPosition:S}),l&&V]}}]),t}(d.a);j.layerName="GeoJsonLayer",j.defaultProps=P},function(e,t,n){"use strict";var i,r=n(4),a=n(5),o=n(0),s=n(146),u=n(122),c=n(206),l=n(30),f=n(43),h=n(80),d=n(125),v=n(158),g=n(201),p=n(60),m=n(210),y=n(19),b=n(26),_=n(67),x=n(93),w="transform_uSampler_",O="transform_uSize_",P="transform_position";function S(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,c={},l=t,f={};if(a>0||i){var h=l.split("\n"),d=h.slice();if(h.forEach(function(e,t,r){if(a>0){var l=function(e,t){var n={},i=function(e){return Object(u.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(w).concat(e),n="".concat(O).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),c=s.samplerName,l=s.sizeName,f=s.uniformDeclerations,h=Object(u.e)(r),d=" ".concat(r," ").concat(a," = transform_getInput(").concat(c,", ").concat(l,").").concat(h,";\n");n[c]=a;var v={"vs:#decl":f,"vs:#main-start":d};return{updatedLine:o,inject:v,samplerTextureMap:n}}return null}(e,n);if(l){var h=l.updatedLine,v=l.inject;d[t]=h,f=Object(s.b)([f,v]),Object.assign(c,l.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(u.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Object(y.a)(r);var v="".concat(O).concat(i),g={"vs:#decl":"uniform vec2 ".concat(v,";\n"),"vs:#main-start":" vec2 ".concat(P," = transform_getPos(").concat(v,");\n gl_Position = vec4(").concat(P,", 0, 1.);\n")};f=Object(s.b)([f,g])}l=d.join("\n")}return{vs:l,targetTextureType:o,inject:f,samplerTextureMap:c}}n.d(t,"a",function(){return k});var j=(i={},Object(o.a)(i,10241,9728),Object(o.a)(i,10240,9728),Object(o.a)(i,10242,33071),Object(o.a)(i,10243,33071),i),k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,e),Object(y.a)(Object(l.d)(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this.resources={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(a.a)(e,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(a.a)(e,[{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof f.a?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Object(y.a)(!n||n===this.targetTextureVarying);var o=Object(h.e)(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,c=Object(u.d)(this.targetTextureType),l=new s(o.length*c/4),f=0,d=0;d0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,s=this.framebuffers[this.currentIndex],Object(y.a)(s),r.viewport=[0,0,s.width,s.height],o&&s.clear({color:!0})),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){b.a.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Object(y.a)(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Object(y.a)(r[o]instanceof f.a||r[o].buffer instanceof f.a);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(j)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Object(y.a)(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(b.a.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(b.a.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,h=e._swapTexture;for(var v in Object(y.a)(a&&(s||n||c)&&o),t||{})Object(y.a)(t[v]instanceof f.a||t[v].buffer instanceof f.a);for(var g in u||{})Object(y.a)(u[g]instanceof d.a);return Object(y.a)(!c||l),Object(y.a)(!h||u[h]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n,0);Object(y.a)(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e,t){var n;if(e instanceof d.a)return e;var i=this.sourceTextures[0][e];if(!i)return null;this._targetRefTexName=e;var r=Object(v.a)(i,{parameters:(n={},Object(o.a)(n,10241,9728),Object(o.a)(n,10240,9728),Object(o.a)(n,10242,33071),Object(o.a)(n,10243,33071),n),pixelStore:Object(o.a)({},37440,!1)}),a="target-texture-".concat(t);return this.resources[a]&&this.resources[a].delete(),this.resources[a]=r,r}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=this._createNewBuffer(r,{byteLength:o,usage:s,accessor:u});this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new f.a(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=n,n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Object(y.a)(this.feedbackBuffers[t][i]instanceof f.a))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new x.a(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){Object(_.a)(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=this._createNewBuffer("elementIDBuffer",{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,l=Object(s.b)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:e._fs||Object(u.b)({version:Object(m.a)(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[c.a].concat(e.modules||[]):e.modules,uniforms:i,inject:l,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return S({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}()},function(e,t,n){"use strict";(function(e){var i=n(34);t.a="undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==Object(i.a)(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(89))},function(e,t,n){var i=n(255);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";(function(e,i){n.d(t,"a",function(){return a});var r=n(180),a="object"!==(void 0===e?"undefined":Object(r.a)(e))||"[object process]"!==String(e)||e.browser;"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document}).call(this,n(89),n(78))},function(e,t){e.exports=function(e){var t;if("function"==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(38),a=n.n(r),o=n(120);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(89))},function(e,t,n){var i=n(8);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===S(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(O(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),O(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),O(i),O(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:{},i=g.b[t];if(Object(m.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in y)return y[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),y[t]=s,s}var _=n(59),x=n(43),w=n(61),O=n(197),P=n(60),S=n(95),j=n(126),k=n(160),C=n(112),E=n(80),A=n(177),T=n(161),M=n(202),L=n(106),I=n(203),R=n(4),F=n(5),D=n(73),N=5126,z=5124,B=5125,U=function(){function e(t){var n;for(var i in Object(R.a)(this,e),this.layout={},this.size=0,t)this._addUniform(i,t[i]);this.size+=(4-this.size%4)%4;var r=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,N,r),Object(c.a)(n,z,new Int32Array(r.buffer)),Object(c.a)(n,B,new Uint32Array(r.buffer)),n)}return Object(F.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[N]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Object(m.a)(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Object(D.a)(t);Object(m.a)(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}(),V=n(124),G=n(26),W=n(67),H=n(46);n.d(t,"S",function(){return r.a}),n.d(t,"A",function(){return a.a}),n.d(t,"B",function(){return a.b}),n.d(t,"V",function(){return a.d}),n.d(t,"X",function(){return a.e}),n.d(t,"N",function(){return o.c}),n.d(t,"O",function(){return o.d}),n.d(t,"w",function(){return s.a}),n.d(t,"J",function(){return u.b}),n.d(t,"I",function(){return u.a}),n.d(t,"E",function(){return v}),n.d(t,"H",function(){return d}),n.d(t,"F",function(){return h}),n.d(t,"D",function(){return f.a}),n.d(t,"c",function(){return g.a}),n.d(t,"L",function(){return p.b}),n.d(t,"M",function(){return p.c}),n.d(t,"G",function(){return p.a}),n.d(t,"t",function(){return b}),n.d(t,"a",function(){return _.a}),n.d(t,"b",function(){return x.a}),n.d(t,"i",function(){return w.b}),n.d(t,"q",function(){return w.c}),n.d(t,"d",function(){return w.a}),n.d(t,"f",function(){return O.a}),n.d(t,"e",function(){return P.a}),n.d(t,"h",function(){return S.a}),n.d(t,"j",function(){return j.a}),n.d(t,"l",function(){return k.a}),n.d(t,"u",function(){return C.a}),n.d(t,"v",function(){return C.b}),n.d(t,"T",function(){return E.e}),n.d(t,"U",function(){return E.f}),n.d(t,"x",function(){return E.b}),n.d(t,"y",function(){return E.c}),n.d(t,"z",function(){return E.d}),n.d(t,"s",function(){return E.a}),n.d(t,"g",function(){return A.a}),n.d(t,"k",function(){return T.a}),n.d(t,"m",function(){return M.a}),n.d(t,"p",function(){return L.a}),n.d(t,"o",function(){return I.a}),n.d(t,"n",function(){return U}),n.d(t,"Y",function(){return V.c}),n.d(t,"P",function(){return V.a}),n.d(t,"Q",function(){return V.b}),n.d(t,"R",function(){return G.a}),n.d(t,"r",function(){return m.a}),n.d(t,"Z",function(){return W.c}),n.d(t,"W",function(){return H.c}),n.d(t,"ab",function(){return H.d}),n.d(t,"K",function(){return H.b}),n.d(t,"C",function(){return H.a})},function(e,t,n){"use strict";var i=n(236);t.a=new i.a({id:"deck"}).enable()},function(e,t,n){var i=n(252),r=n(253),a=n(254);e.exports=function(e,t){return i(e)||r(e,t)||a()}},function(e,t,n){"use strict";n.r(t);var i=n(14),r=n(51),a=n(58),o=n(128),s=n(146),u=n(204),c=n(24),l=new Uint8Array([0,0,0]);function f(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function h(e){var t=Object(c.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function d(){return l}var v=n(93),g=n(224),p=n(101),m=n(190),y=n(34),b=n(4),_=n(5),x=n(125),w=n(135),O=n(19),P=n(26);var S=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.onInitialize,r=void 0===i?function(){}:i,a=n.onFinalize,o=void 0===a?function(){}:a,s=n.useDevicePixels,u=void 0===s||s,c=n.autoResizeDrawingBuffer,l=void 0===c||c;this.props={onInitialize:r,onFinalize:o},this.setProps({autoResizeDrawingBuffer:l,useDevicePixels:u}),Object(O.a)(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(_.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.onmessage=function(n){var i,r,a,o=n.data;switch(o.command){case"start":i=t,r=o.opts.canvas,a=new Map,r.addEventListener=function(e,t){i.postMessage({command:"addEventListener",type:e}),a.has(e)||a.set(e,[]),a.get(e).push(t)},r.removeEventListener=function(e,t){i.postMessage({command:"removeEventListener",type:e});var n=a.get(e);n&&n.splice(n.indexOf(t),1)},r.dispatchEvent=function(e,t){var n=a.get(e);n&&n.forEach(function(e){return e(t)})},i.canvas=r,e.start(o.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=o.width,t.canvas.height=o.height;break;case"event":t.canvas.dispatchEvent(o.type,o.event)}}}}}]),Object(_.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,Object(x.b)().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=Object(w.b)(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(Object(w.a)(this._animationFrameId),this._animationFrameId=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(y.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._animationFrameId=Object(w.b)(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=Object(x.a)(e);t.transferControlToOffscreen||P.a.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),j=n(10),k=n(9),C=n(11),E=n(60),A=n(70),T=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.id,r=void 0===i?"pass":i;this.id=r,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(_.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=E.a.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),Object(A.a)(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),M=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(T),L=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(b.a)(this,e),this.gl=t,this.framebuffer1=new E.a(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new E.a(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(_.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),I=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),i=Array.isArray(i)?{passes:i}:i,(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"multi-pass"},i)))).renderState=new L(e,i),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(M),R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){var e=this.gl,t=this.props.clearBits,n=void 0===t?16640:t;e.clear(n)}}]),t}(T),F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(T),D="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",N=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},i)))).clipspace=new p.a(e,{id:"copy-pass",fs:D}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),z="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",B=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,t),n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"texture-pass"},i)));var r=i.texture,a=i.opacity,o=void 0===a?1:a;return n.clipspace=new p.a(e,{id:"texture-pass",fs:z,uniforms:{uDiffuseSampler:r,uOpacity:o}}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),U=n(140),V=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),G=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(b.a)(this,t);var a="".concat(n.name,"-pass");Object(U.b)(n);var o=function(e,t,n,i){if(t.filter||t.sampler){var r=q(t),a=new V(e,{id:n,model:W(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=q(t,r),s="".concat(n,"-").concat(o.length+1);return new V(e,Object.assign({id:s,model:W(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,a,r);return(i=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:a,passes:o},r)))).module=n,i}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.props.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1;var l=c.props,f=l.uniforms,h=l.model;f&&h.setUniforms(f),h.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(M);function W(e,t,n,i,r){var a=new p.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var H=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},X=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return H(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return X(i)}return null}var Z=n(36),Y=n(67),K={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Q=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("truncated-code-geometry"):n,r=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,O=x(b),P=_(b),S=v?-2:0,j=l+(p?2:0),k=u+1,C=new Uint16Array(u*(l+m)*6),E=K[h],A=new Float32Array(3*y),T=new Float32Array(3*y),M=new Float32Array(2*y),L=0,I=0,R=S;R<=j;R++){var F=R/l,D=o*F,N=void 0;R<0?(D=0,F=1,N=n):R>l?(D=o,F=1,N=r):N=n+R/l*(r-n),-2!==R&&R!==l+2||(N=0,F=0),D-=o/2;for(var z=0;zl?0:B*O,T[L+E[1]]=R<0?-1:R>l?1:P,T[L+E[2]]=R<0||R>l?0:U*O,M[I+0]=z/u,M[I+1]=F,I+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cone-geometry"):n,r=e.radius,a=void 0===r?1:r,o=e.cap,s=void 0===o||o;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,topRadius:0,topCap:Boolean(s),bottomCap:Boolean(s),bottomRadius:a})))}return Object(C.a)(t,e),t}(Q),$=n(191),ee=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cylinder-geometry"):n,r=e.radius,a=void 0===r?1:r;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,bottomRadius:a,topRadius:a})))}return Object(C.a)(t,e),t}(Q),te=n(29),ne=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],ie=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],re=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("ico-sphere-geometry"):n,r=function(e){var t=e.iterations,n=void 0===t?0:t,i=Math.PI,r=2*i,a=[].concat(ne),o=[].concat(ie);a.push(),o.push();for(var s=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,r=t>n?t:n,o="".concat(i,"|").concat(r);if(o in e)return e[o];var s=a[t],u=a[t+1],c=a[t+2],l=a[n],f=a[n+1],h=a[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,a.push(d,v,g),e[o]=a.length/3-1}}(),u=0;u=0;p-=3){var m=o[p+0],y=o[p+1],b=o[p+2],_=3*m,x=3*y,w=3*b,O=2*m,P=2*y,S=2*b,j=a[_+0],k=a[_+1],C=a[_+2],E=Math.acos(C/Math.sqrt(j*j+k*k+C*C)),A=Math.atan2(k,j)+i,T=E/i,M=1-A/r,L=a[x+0],I=a[x+1],R=a[x+2],F=Math.acos(R/Math.sqrt(L*L+I*I+R*R)),D=Math.atan2(I,L)+i,N=F/i,z=1-D/r,B=a[w+0],U=a[w+1],V=a[w+2],G=Math.acos(V/Math.sqrt(B*B+U*U+V*V)),W=Math.atan2(U,B)+i,H=G/i,X=1-W/r,q=[B-L,U-I,V-R],Z=[j-L,k-I,C-R],Y=new te.a(q).cross(Z).normalize(),K=void 0;(0===M||0===z||0===X)&&(0===M||M>.5)&&(0===z||z>.5)&&(0===X||X>.5)&&(a.push(a[_+0],a[_+1],a[_+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=T,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[x+0],a[x+1],a[x+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=N,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[w+0],a[w+1],a[w+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=H,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z),v[_+0]=v[x+0]=v[w+0]=Y.x,v[_+1]=v[x+1]=v[w+1]=Y.y,v[_+2]=v[x+2]=v[w+2]=Y.z,g[O+0]=M,g[O+1]=T,g[P+0]=z,g[P+1]=N,g[S+0]=X,g[S+1]=H}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(g)}}}}(e),a=r.indices,o=r.attributes;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,indices:a,attributes:Object(Z.a)({},o,e.attributes)})))}return Object(C.a)(t,e),t}(a.a);var ae=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("plane-geometry"):n,r=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")]||1,f=e["".concat(c[1],"len")]||1,h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,O=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=O,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*O-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*O-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*O-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}y+=2,b+=3}for(var P=h+1,S=new Uint16Array(h*d*6),j=0;j0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("sphere-geometry"):n,r=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,O=s*y,P=Math.sin(w),S=Math.cos(w),j=Math.sin(O),k=Math.cos(O),C=S*j,E=k,A=P*j,T=o(C,E,A,m,y);f[x+0]=T*C,f[x+1]=T*E,f[x+2]=T*A,h[x+0]=C,h[x+1]=E,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var M=n+1,L=0;L0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.a)(this,t),(e=Object(j.a)(this,Object(k.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(C.a)(t,e),t}(ce.a),de=n(28);n.d(t,"isWebGL",function(){return i.N}),n.d(t,"isWebGL2",function(){return i.O}),n.d(t,"lumaStats",function(){return i.S}),n.d(t,"createGLContext",function(){return i.A}),n.d(t,"destroyGLContext",function(){return i.B}),n.d(t,"resizeGLContext",function(){return i.V}),n.d(t,"setGLContextDefaults",function(){return i.X}),n.d(t,"getContextInfo",function(){return i.E}),n.d(t,"getGLContextInfo",function(){return i.H}),n.d(t,"getContextLimits",function(){return i.F}),n.d(t,"FEATURES",function(){return i.c}),n.d(t,"hasFeature",function(){return i.L}),n.d(t,"hasFeatures",function(){return i.M}),n.d(t,"getFeatures",function(){return i.G}),n.d(t,"canCompileGLGSExtension",function(){return i.t}),n.d(t,"cloneTextureFrom",function(){return i.w}),n.d(t,"getKeyValue",function(){return i.J}),n.d(t,"getKey",function(){return i.I}),n.d(t,"setContextDefaults",function(){return i.X}),n.d(t,"glGetDebugInfo",function(){return i.D}),n.d(t,"trackContextState",function(){return r.g}),n.d(t,"resetParameters",function(){return r.d}),n.d(t,"getParameter",function(){return r.b}),n.d(t,"getParameters",function(){return r.c}),n.d(t,"setParameter",function(){return r.e}),n.d(t,"setParameters",function(){return r.f}),n.d(t,"withParameters",function(){return r.h}),n.d(t,"getModifiedParameters",function(){return r.a}),n.d(t,"Buffer",function(){return i.b}),n.d(t,"Shader",function(){return i.i}),n.d(t,"VertexShader",function(){return i.q}),n.d(t,"FragmentShader",function(){return i.d}),n.d(t,"Program",function(){return i.f}),n.d(t,"Framebuffer",function(){return i.e}),n.d(t,"Renderbuffer",function(){return i.h}),n.d(t,"Texture2D",function(){return i.j}),n.d(t,"TextureCube",function(){return i.l}),n.d(t,"clear",function(){return i.u}),n.d(t,"clearBuffer",function(){return i.v}),n.d(t,"readPixelsToArray",function(){return i.T}),n.d(t,"readPixelsToBuffer",function(){return i.U}),n.d(t,"copyToDataUrl",function(){return i.x}),n.d(t,"copyToImage",function(){return i.y}),n.d(t,"copyToTexture",function(){return i.z}),n.d(t,"blit",function(){return i.s}),n.d(t,"Query",function(){return i.g}),n.d(t,"Texture3D",function(){return i.k}),n.d(t,"TransformFeedback",function(){return i.m}),n.d(t,"VertexArrayObject",function(){return i.p}),n.d(t,"VertexArray",function(){return i.o}),n.d(t,"UniformBufferLayout",function(){return i.n}),n.d(t,"setPathPrefix",function(){return i.Y}),n.d(t,"loadFile",function(){return i.P}),n.d(t,"loadImage",function(){return i.Q}),n.d(t,"_Accessor",function(){return i.a}),n.d(t,"_clearBuffer",function(){return i.v}),n.d(t,"Geometry",function(){return a.a}),n.d(t,"Material",function(){return o.a}),n.d(t,"AmbientLight",function(){return s.a}),n.d(t,"DirectionalLight",function(){return s.b}),n.d(t,"PointLight",function(){return s.c}),n.d(t,"AnimationLoop",function(){return u.a}),n.d(t,"encodePickingColor",function(){return f}),n.d(t,"decodePickingColor",function(){return h}),n.d(t,"getNullPickingColor",function(){return d}),n.d(t,"Model",function(){return v.a}),n.d(t,"Transform",function(){return g.a}),n.d(t,"ClipSpace",function(){return p.a}),n.d(t,"_ShaderCache",function(){return m.a}),n.d(t,"_AnimationLoopProxy",function(){return S}),n.d(t,"_MultiPassRenderer",function(){return I}),n.d(t,"_RenderState",function(){return L}),n.d(t,"_Pass",function(){return T}),n.d(t,"_CompositePass",function(){return M}),n.d(t,"_ClearPass",function(){return R}),n.d(t,"_RenderPass",function(){return F}),n.d(t,"_CopyPass",function(){return N}),n.d(t,"_TexturePass",function(){return B}),n.d(t,"_ShaderModulePass",function(){return G}),n.d(t,"ConeGeometry",function(){return J}),n.d(t,"CubeGeometry",function(){return $.a}),n.d(t,"CylinderGeometry",function(){return ee}),n.d(t,"IcoSphereGeometry",function(){return re}),n.d(t,"PlaneGeometry",function(){return ae}),n.d(t,"SphereGeometry",function(){return oe}),n.d(t,"TruncatedConeGeometry",function(){return Q}),n.d(t,"PhongMaterial",function(){return se.a}),n.d(t,"PBRMaterial",function(){return ue}),n.d(t,"ScenegraphNode",function(){return ce.a}),n.d(t,"GroupNode",function(){return le.a}),n.d(t,"ModelNode",function(){return fe.a}),n.d(t,"CameraNode",function(){return he}),n.d(t,"registerShaderModules",function(){return de.v}),n.d(t,"setDefaultShaderModules",function(){return de.w}),n.d(t,"getDefaultShaderModules",function(){return de.l}),n.d(t,"assembleShaders",function(){return de.c}),n.d(t,"createShaderHook",function(){return de.g}),n.d(t,"createModuleInjection",function(){return de.f}),n.d(t,"combineInjects",function(){return de.d}),n.d(t,"normalizeShaderModule",function(){return de.q}),n.d(t,"fp32",function(){return de.j}),n.d(t,"fp64",function(){return de.k}),n.d(t,"project",function(){return de.u}),n.d(t,"lights",function(){return de.p}),n.d(t,"dirlight",function(){return de.i}),n.d(t,"picking",function(){return de.t}),n.d(t,"diffuse",function(){return de.h}),n.d(t,"gouraudlighting",function(){return de.o}),n.d(t,"phonglighting",function(){return de.s}),n.d(t,"pbr",function(){return de.r}),n.d(t,"_transform",function(){return de.b}),n.d(t,"MODULAR_SHADERS",function(){return de.a}),n.d(t,"getQualifierDetails",function(){return de.n}),n.d(t,"getPassthroughFS",function(){return de.m}),n.d(t,"typeToChannelSuffix",function(){return de.y}),n.d(t,"typeToChannelCount",function(){return de.x}),n.d(t,"convertToVec4",function(){return de.e}),n.d(t,"log",function(){return i.R}),n.d(t,"assert",function(){return i.r}),n.d(t,"uid",function(){return i.Z}),n.d(t,"self",function(){return i.W}),n.d(t,"window",function(){return i.ab}),n.d(t,"global",function(){return i.K}),n.d(t,"document",function(){return i.C})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return g}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return b});var i=n(12);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],g=t[13],p=t[14],m=t[15],y=n*s-i*o,b=n*u-r*o,_=n*c-a*o,x=i*u-r*s,w=i*c-a*s,O=r*c-a*u,P=l*g-f*v,S=l*p-h*v,j=l*m-d*v,k=f*p-h*g,C=f*m-d*g,E=h*m-d*p,A=y*E-b*C+_*k+x*j-w*S+O*P;return A?(A=1/A,e[0]=(s*E-u*C+c*k)*A,e[1]=(r*C-i*E-a*k)*A,e[2]=(g*O-p*w+m*x)*A,e[3]=(h*w-f*O-d*x)*A,e[4]=(u*j-o*E-c*S)*A,e[5]=(n*E-r*j+a*S)*A,e[6]=(p*_-v*O-m*b)*A,e[7]=(l*O-h*_+d*b)*A,e[8]=(o*C-s*j+c*P)*A,e[9]=(i*j-n*C-a*P)*A,e[10]=(v*w-g*_+m*y)*A,e[11]=(f*_-l*w-d*y)*A,e[12]=(s*S-o*k-u*P)*A,e[13]=(n*k-i*S+r*P)*A,e[14]=(g*b-v*x-p*y)*A,e[15]=(l*x-f*b+h*y)*A,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],v=e[13],g=e[14],p=e[15];return(t*o-n*a)*(f*p-h*g)-(t*s-i*a)*(l*p-h*v)+(t*u-r*a)*(l*g-f*v)+(n*s-i*o)*(c*p-h*d)-(n*u-r*o)*(c*g-f*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],g=t[12],p=t[13],m=t[14],y=t[15],b=n[0],_=n[1],x=n[2],w=n[3];return e[0]=b*i+_*s+x*f+w*g,e[1]=b*r+_*u+x*h+w*p,e[2]=b*a+_*c+x*d+w*m,e[3]=b*o+_*l+x*v+w*y,b=n[4],_=n[5],x=n[6],w=n[7],e[4]=b*i+_*s+x*f+w*g,e[5]=b*r+_*u+x*h+w*p,e[6]=b*a+_*c+x*d+w*m,e[7]=b*o+_*l+x*v+w*y,b=n[8],_=n[9],x=n[10],w=n[11],e[8]=b*i+_*s+x*f+w*g,e[9]=b*r+_*u+x*h+w*p,e[10]=b*a+_*c+x*d+w*m,e[11]=b*o+_*l+x*v+w*y,b=n[12],_=n[13],x=n[14],w=n[15],e[12]=b*i+_*s+x*f+w*g,e[13]=b*r+_*u+x*h+w*p,e[14]=b*a+_*c+x*d+w*m,e[15]=b*o+_*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,f,h,d,v,g=n[0],p=n[1],m=n[2];return t===e?(e[12]=t[0]*g+t[4]*p+t[8]*m+t[12],e[13]=t[1]*g+t[5]*p+t[9]*m+t[13],e[14]=t[2]*g+t[6]*p+t[10]*m+t[14],e[15]=t[3]*g+t[7]*p+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=v,e[12]=i*g+s*p+f*m+t[12],e[13]=r*g+u*p+h*m+t[13],e[14]=a*g+c*p+d*m+t[14],e[15]=o*g+l*p+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,f,h,d,v,g,p,m,y,b,_,x,w,O,P,S,j,k,C,E=r[0],A=r[1],T=r[2],M=Math.sqrt(E*E+A*A+T*T);return M0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=Ce.a,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return u()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64,a=e.dataChanged;if(this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,Array.isArray(a)){var o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;this._rebuildGeometry(f)}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(je.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.opts=t}return u()(e,[{key:"equals",value:function(e){return this===e||this.constructor===e.constructor&&Object(Le.a)(this.opts,e.opts)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var t=e.constructor.defaultProps,n=void 0===t?{}:t,i={updateTriggers:{}};for(var r in n)if(r in this.props){var a=n[r],o=this.props[r];i[r]=o,a&&"accessor"===a.type&&(i.updateTriggers[r]=this.props.updateTriggers[r],"function"==typeof o&&(i[r]=this.getSubLayerAccessor(o,!0)))}return i}},{key:"initializeState",value:function(e,t){}},{key:"updateState",value:function(e,t){}},{key:"finalizeState",value:function(e){}}]),e}();n.d(t,"experimental",function(){return Re}),n.d(t,"COORDINATE_SYSTEM",function(){return i.a}),n.d(t,"LightingEffect",function(){return r.a}),n.d(t,"PointLight",function(){return m}),n.d(t,"DirectionalLight",function(){return y.a}),n.d(t,"_CameraLight",function(){return _}),n.d(t,"_SunLight",function(){return F}),n.d(t,"PostProcessEffect",function(){return D.a}),n.d(t,"_LayersPass",function(){return N.a}),n.d(t,"Deck",function(){return z.a}),n.d(t,"LayerManager",function(){return B.a}),n.d(t,"AttributeManager",function(){return U.a}),n.d(t,"Layer",function(){return V.a}),n.d(t,"CompositeLayer",function(){return G.a}),n.d(t,"DeckRenderer",function(){return W.a}),n.d(t,"Viewport",function(){return H.a}),n.d(t,"WebMercatorViewport",function(){return X.a}),n.d(t,"project",function(){return q.a}),n.d(t,"project64",function(){return Z.a}),n.d(t,"View",function(){return Y.a}),n.d(t,"MapView",function(){return K.a}),n.d(t,"FirstPersonView",function(){return Q.a}),n.d(t,"ThirdPersonView",function(){return te}),n.d(t,"OrbitView",function(){return ne.a}),n.d(t,"PerspectiveView",function(){return ae}),n.d(t,"OrthographicView",function(){return oe.a}),n.d(t,"Controller",function(){return se.a}),n.d(t,"MapController",function(){return ue.a}),n.d(t,"_FirstPersonController",function(){return ce.a}),n.d(t,"_OrbitController",function(){return le.b}),n.d(t,"_OrthographicController",function(){return fe.a}),n.d(t,"Effect",function(){return he.a}),n.d(t,"TRANSITION_EVENTS",function(){return de.a}),n.d(t,"LinearInterpolator",function(){return ve.a}),n.d(t,"FlyToInterpolator",function(){return Oe}),n.d(t,"log",function(){return Pe.a}),n.d(t,"createIterable",function(){return je.a}),n.d(t,"fp64LowPart",function(){return ke.c}),n.d(t,"AmbientLight",function(){return Me.AmbientLight}),n.d(t,"LayerExtension",function(){return Ie});var Re={Tesselator:Ee,flattenVertices:Se.c,fillArray:Se.a,count:Ae.a,memoize:Te.a}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"e",function(){return d});var i={};function r(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function a(e){return Math.round(e/i.EPSILON)*i.EPSILON}function o(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function O(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.h([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function S(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function j(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){"use strict";var i=n(109),r=n(132),a=n(147),o=n(140),s=n(123),u=n(205),c=n(220),l=n(64),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h={modelMatrix:f,viewMatrix:f,projectionMatrix:f,cameraPositionWorld:[0,0,0]};var d="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",v={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new l.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(d,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(d)},g=n(115),p={lightDirection:new Float32Array([1,1,2])};var m={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[v]},y=n(206),b={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var _={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},x=n(189),w=n(219),O=n(207);n.d(t,"a",function(){return P}),n.d(t,"v",function(){return i.c}),n.d(t,"w",function(){return i.e}),n.d(t,"l",function(){return i.a}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.b}),n.d(t,"q",function(){return o.b}),n.d(t,"n",function(){return s.c}),n.d(t,"m",function(){return s.b}),n.d(t,"y",function(){return s.e}),n.d(t,"x",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u.a}),n.d(t,"k",function(){return c.a}),n.d(t,"u",function(){return v}),n.d(t,"p",function(){return g.a}),n.d(t,"i",function(){return m}),n.d(t,"t",function(){return y.a}),n.d(t,"h",function(){return _}),n.d(t,"o",function(){return x.a}),n.d(t,"s",function(){return x.b}),n.d(t,"r",function(){return w.a}),n.d(t,"b",function(){return O.a});var P={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",uniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(22),l=n(40),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.c(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.j(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.k(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.l(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,n,i){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e[3]=s+i*(n[3]-s),e}function g(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}function p(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function m(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=i.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-u)<=i.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=i.b*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var y,b;y=new i.a(4),i.a!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),b=y},function(e,t,n){e.exports=n(259)()},,function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"g",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"n",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return v}),n.d(t,"a",function(){return g}),n.d(t,"m",function(){return m}),n.d(t,"f",function(){return y});var i=n(12);function r(){var e=new i.a(3);return i.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function l(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function f(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function v(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function g(e,t){var n=o(e[0],e[1],e[2]),i=o(t[0],t[1],t[2]);u(n,n),u(i,i);var r=c(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var p,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},y=a;p=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={LNG_LAT:1,LNGLAT_AUTO_OFFSET:4,METER_OFFSETS:2,LNGLAT_OFFSETS:3,IDENTITY:0}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(32),u=n(11),c=n(52),l=n(59),f=n(30),h=n(118),d=n(234),v=n(19),g=n(26),p={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"},m={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:p},y={removedProps:p},b=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(s.a)(n)),n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=Object(d.a)("Buffer",e,m),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=Object(d.a)("Buffer",e,y))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new l.a(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Object(v.a)(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(Object(f.a)(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return Object(f.a)(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;Object(f.a)(this.gl);var c,l,d=Object(h.c)(this.accessor.type||5126,{clamped:!1}),g=this._getAvailableElementCount(r),p=o;n?c=(l=n.length)-p:l=p+(c=Math.min(g,u||g));var m=Math.min(g,c);return u=u||m,Object(v.a)(u<=m),n=n||new d(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Object(v.a)(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=Object(h.b)(e);return Object(v.a)(i),this.setAccessor(new l.a(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/Object(h.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new l.a(this.accessor,{type:Object(h.b)(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return g.a.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return g.a.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new l.a(this.accessor,e),this}},{key:"type",get:function(){return g.a.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return g.a.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(c.a)},,function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(15),l=n(85),f=n(22),h=n(64),d=n(29),v=n(20),g=n(27),p=n(18),m=Math.PI/180,y=Object(l.a)(),b=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Object(o.b)(t);var r=n.id,a=n.userData,s=void 0===a?{}:a;this.gl=t,this.id=r||Object(u.c)(this.constructor.name),this.userData=s,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=Object(o.d)(this.gl),u={},c=n||Object.keys(r),l=!0,f=!1,h=void 0;try{for(var d,v=c[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value,p=r[g];if(p&&(!("webgl2"in p)||a)&&(!("extension"in p)||this.gl.getExtension(p.extension))){var m=i?Object(s.a)(this.gl,g):g;u[m]=this.getParameter(g,e),i&&"GLenum"===p.type&&(u[m]=Object(s.a)(this.gl,u[m]))}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return u}},{key:"setParameter",value:function(e,t){e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Object(s.b)(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return Object(l.a)(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(f)}},{key:"_deleteHandle",value:function(){throw new Error(f)}},{key:"_bindHandle",value:function(){throw new Error(f)}},{key:"_getOptsFromHandle",value:function(){throw new Error(f)}},{key:"_getParameter",value:function(e,t){throw new Error(f)}},{key:"_setParameter",value:function(e,t){throw new Error(f)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=a.a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;a.a.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=a.a.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=a.a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}()},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(45),l=/([0-9]+\.?[0-9]*)(%|px)/;function f(e){switch(r()(e)){case"number":return{position:e,relative:!1};case"string":var t=e.match(l);if(t&&t.length>=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(105),v=n(18);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,O=t.modelMatrix,P=void 0===O?null:O,S=t.viewportInstance,j=void 0===S?null:S,k=t.type,C=void 0===k?c.a:k;Object(v.a)(!j||j instanceof c.a),this.viewportInstance=j,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(34),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(78),n(89))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(37);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.n([],t,e);return i.k(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(0),r=n(4),a=n(10),o=n(9),s=n(5),u=n(11),c=n(52),l=n(43),f=n(98),h=n(70),d=n(30),v=n(49),g=n(67),p=n(26),m=n(19),y=[9729,9728],b=function(e){function t(e,n){var i;Object(r.a)(this,t);var s=n.id,u=void 0===s?Object(g.c)("texture"):s,c=n.handle,l=n.target;return(i=Object(a.a)(this,Object(o.a)(t).call(this,e,{id:u,handle:c}))).target=l,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&Object(f.d)(e,n))&&(!i||Object(f.e)(e,n))),r}}]),Object(s.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var r=t.pixels,a=void 0===r?null:r,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,v=t.pixelStore,g=void 0===v?{}:v,m=t.textureUnit,y=void 0===m?void 0:m,b=t.unpackFlipY,_=void 0===b||b,x=t.mipmaps,w=void 0===x||x;n||(n=a);var O=t.width,P=t.height,S=t.dataFormat,j=t.type,k=t.depth,C=void 0===k?0:k,E=this._deduceParameters({format:s,type:j,dataFormat:S,compressed:!1,data:n,width:O,height:P});O=E.width,P=E.height,S=E.dataFormat,j=E.type,this.width=O,this.height=P,this.depth=C,this.format=s,this.type=j,this.dataFormat=S,this.border=c,this.textureUnit=y,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var A=Object(i.a)({},37440,_),T=Object.assign({},A,g);return w&&this._isNPOT()&&(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),w=!1,this._updateForNPOT(d)),this.mipmaps=w,this.setImageData({data:n,width:O,height:P,depth:C,format:s,type:j,dataFormat:S,border:c,mipmaps:w,parameters:T}),w&&this.generateMipmap(),this.setParameters(d),f&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.height,n=e.width,i=e.mipmaps,r=void 0!==i&&i;return n!==this.width||t!==this.height?this.initialize({width:n,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,v=e.offset,g=void 0===v?0:v,p=e.parameters,y=void 0===p?{}:p,b=e.data,_=void 0===b?null:b,x=e.type,w=void 0===x?this.type:x,O=e.width,P=void 0===O?this.width:O,S=e.height,j=void 0===S?this.height:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E;_||(_=r);var T=this._deduceParameters({format:u,type:w,dataFormat:C,compressed:A,data:_,width:P,height:j});w=T.type,C=T.dataFormat,A=T.compressed,P=T.width,j=T.height;var M=this.gl;M.bindTexture(this.target,this.handle);var L,I=this._getDataType({data:_,compressed:A});if(_=I.data,L=I.dataType,Object(h.a)(this.gl,y,function(){switch(L){case"null":M.texImage2D(n,o,u,P,j,l,C,w,_);break;case"typed-array":M.texImage2D(n,o,u,P,j,l,C,w,_,g);break;case"buffer":Object(d.a)(M),M.bindBuffer(35052,_.handle||_),M.texImage2D(n,o,u,P,j,l,C,w,g),M.bindBuffer(35052,null);break;case"browser-object":Object(d.d)(M)?M.texImage2D(n,o,u,P,j,l,C,w,_):M.texImage2D(n,o,u,C,w,_);break;case"compressed":M.compressedTexImage2D(n,o,u,P,j,l,_);break;default:Object(m.a)(!1,"Unknown image data type")}}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var R=f.a[this.dataFormat]||4,F=f.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,f=e.y,g=void 0===f?0:f,p=e.width,y=void 0===p?this.width:p,b=e.height,_=void 0===b?this.height:b,x=e.level,w=void 0===x?0:x,O=e.format,P=void 0===O?this.format:O,S=e.type,j=void 0===S?this.type:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E,T=e.offset,M=void 0===T?0:T,L=e.border,I=(void 0===L&&this.border,e.parameters),R=void 0===I?{}:I,F=this._deduceParameters({format:P,type:j,dataFormat:C,compressed:A,data:s,width:y,height:_});if(j=F.type,C=F.dataFormat,A=F.compressed,y=F.width,_=F.height,Object(m.a)(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var D=s;s=D.data,y=D.shape[0],_=D.shape[1]}s instanceof l.a&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,R,function(){A?t.gl.compressedTexSubImage2D(i,w,c,g,y,_,P,s):null===s?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s,M):s instanceof v.b?(Object(d.a)(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,w,c,g,y,_,C,j,M),t.gl.bindBuffer(35052,null)):Object(d.d)(t.gl)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s):t.gl.texSubImage2D(i,w,c,g,C,j,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p.a.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof l.a?{data:t.handle,dataType:"buffer"}:t instanceof v.b?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=f.b[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},Object(m.a)(i,"Could not deduced texture size"),Object(m.a)(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Object(m.a)(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Object(m.a)(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Object(d.d)(this.gl)&&(!(!this.width||!this.height)&&(!Object(g.b)(this.width)||!Object(g.b)(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===y.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(c.a)},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(76);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function o(e){for(var t=1;t0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}n.d(t,"a",function(){return s}),n.d(t,"b",function(){return u})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(36),r=n(4),a=n(5),o=n(67),s=n(19),u={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,e);var n=t.id,i=void 0===n?Object(o.c)("geometry"):n,a=t.drawMode,s=void 0===a?u.TRIANGLES:a,c=t.attributes,l=void 0===c?{}:c,f=t.indices,h=void 0===f?null:f,d=t.vertexCount,v=void 0===d?null:d;this.id=i,this.drawMode=0|s,this.attributes={},this.userData={},this._setAttributes(l,h),this.vertexCount=v||this._calculateVertexCount(this.attributes,this.indices)}return Object(a.a)(e,null,[{key:"DRAW_MODE",get:function(){return u}}]),Object(a.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?Object(i.a)({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Object(s.a)(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||i.size||(i.size=3),"indices"===n?(Object(s.a)(!this.indices),this.indices=i):this.attributes[n]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}return Object(s.a)(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}()},function(e,t,n){"use strict";var i=n(176);function r(e,t,n){return(r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Object(i.a)(a,n.prototype),a}).apply(null,arguments)}var a=n(4),o=n(5),s=n(118),u=n(19),c=n(234);n.d(t,"a",function(){return h});var l={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},f={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},h=function(){function e(){var t=this;Object(a.a)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=Object(c.a)("Accessor",e,f)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(0),r=n(24),a=n(4),o=n(10),s=n(9),u=n(32),c=n(5),l=n(11),f=n(52),h=n(126),d=n(95),v=n(112),g=n(80),p=n(127),m=n(30),y=n(68),b=n(19),_=n(26),x=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this,t),(n=Object(o.a)(this,Object(s.a)(t).call(this,e,i))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(i),Object.seal(Object(u.a)(n)),n}return Object(l.a)(t,e),Object(c.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(c.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(Object(b.a)(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Object(b.a)(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&_.a.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,a=void 0!==i&&i,o=n.resizeAttachments,s=void 0===o||o,u={};a&&Object.keys(this.attachments).forEach(function(e){u[e]=null}),Object.assign(u,e);var c=this.gl.bindFramebuffer(36160,this.handle);for(var l in u){Object(b.a)(void 0!==l,"Misspelled framebuffer binding point?");var f=Number(l),h=u[f],v=h;if(v)if(v instanceof d.a)this._attachRenderbuffer({attachment:f,renderbuffer:v});else if(Array.isArray(h)){var g=Object(r.a)(h,3),p=g[0],m=g[1],y=void 0===m?0:m,_=g[2],x=void 0===_?0:_;v=p,this._attachTexture({attachment:f,texture:p,layer:y,level:x})}else this._attachTexture({attachment:f,texture:v,layer:0,level:0});else this._unattach(f);s&&v&&v.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(w(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&Object(v.a)(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){Object(v.b)({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;Object(m.a)(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Object(y.a)(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?Object(y.a)(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>_.a.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Object(g.b)(this,{maxHeight:100});return _.a.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,r,a){var o,s=null;e&&((s=s||{})[36064]=new h.a(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:r,height:a,mipmaps:!1,parameters:(o={},Object(i.a)(o,10241,9729),Object(i.a)(o,10240,9729),Object(i.a)(o,10242,33071),Object(i.a)(o,10243,33071),o)}));return t&&n?(s=s||{})[33306]=new d.a(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:r,height:111}):t?(s=s||{})[36096]=new d.a(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:r,height:a}):n&&Object(b.a)(!1),s}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof d.a?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Object(b.a)(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;Object(m.d)(t)?t.readBuffer(e):Object(b.a)(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(Object(m.d)(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Object(b.a)(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=Object(p.a)(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(f.a);function w(e){return(x.STATUS||{})[e]||"Framebuffer error ".concat(e)}x.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(9),o=n(5),s=n(11),u=n(162),c=35632,l=35633;function f(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Object(u.a)(t)||"(unnamed)",f="".concat(function(e){switch(e){case c:return"fragment";case l:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),v=0;v1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=d(a,r-o);return s+n+e})}(t);return{shaderName:f,errors:h(a,b),warnings:h(o,b)}}function h(e,t){for(var n="",i=0;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(133).a),p=n(20),m=n(47),y=n(40),b=n(37);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.n(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.n(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.n(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.n(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.n(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(62),r=n(198),a=n(144);function o(e,t,n){var r=i.c[t],o=r?r(e,Number(t)):e.getParameter(Number(t)),s=i.d[t];return Object(a.a)("function"==typeof s),s(e,n,Number(t)),o}function s(e,t){var n={};for(var r in t){var a=Number(r),o=i.d[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],a))}var s=e.state&&e.state.cache;if(s){var u=Object.assign({},s,t);for(var c in n){(0,i.a[c])(e,u)}}}function u(e,t){var n=i.c[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function c(e,t){t=t||i.b;var n=Array.isArray(t)?t:Object.keys(t),r={},a=!0,o=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;r[f]=u(e,f)}}catch(e){o=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return r}function l(e){s(e,Object.assign({},i.b,{}))}function f(e){var t=c(e,Object.keys(i.b)),n={};for(var a in i.b)Object(r.a)(t[a],i.b[a])||(n[a]=t[a]);return n}},function(e,t,n){"use strict";var i=n(9);function r(e,t,n){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(i.a)(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i=n(19),r={};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";r[e]=r[e]||1;var t=r[e]++;return"".concat(e,"-").concat(t)}function o(e){return Object(i.a)("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function s(e){var t=!0;for(var n in e){t=!1;break}return t}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var i=n(19);function r(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var r=e[t=t.replace(/^.*\./,"")];return Object(i.a)(void 0!==r,"Accessing undefined constant GL.".concat(t)),r}function a(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(77),r=n.n(i),a=n(41),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(90),r=n(148),a=n(233),o=n(144);function s(e,t,n){if(Object(a.a)(t))return n(e);var s,u=t.nocatch,c=void 0===u||u;if(Object(o.a)(!t.frameBuffer),Object(i.c)(e),Object(r.a)(e,t),c)s=n(e),Object(i.b)(e);else try{s=n(e)}finally{Object(i.b)(e)}return s}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});var i="vs",r="fs"},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}function o(e){return e&&e[Symbol.asyncIterator]}},function(e,t,n){"use strict";n.d(t,"c",function(){return _}),n.d(t,"a",function(){return x}),n.d(t,"b",function(){return w});var i,r=n(24),a=n(0),o=n(19),s=5120,u=5121,c=5122,l=5123,f=0,h=1,d=2,v=3,g=4,p=5,m=6,y=5126,b=(i={},Object(a.a)(i,y,[y,1,"float"]),Object(a.a)(i,35664,[y,2,"vec2"]),Object(a.a)(i,35665,[y,3,"vec3"]),Object(a.a)(i,35666,[y,4,"vec4"]),Object(a.a)(i,5124,[5124,1,"int"]),Object(a.a)(i,35667,[5124,2,"ivec2"]),Object(a.a)(i,35668,[5124,3,"ivec3"]),Object(a.a)(i,35669,[5124,4,"ivec4"]),Object(a.a)(i,5125,[5125,1,"uint"]),Object(a.a)(i,36294,[5125,2,"uvec2"]),Object(a.a)(i,36295,[5125,3,"uvec3"]),Object(a.a)(i,36296,[5125,4,"uvec4"]),Object(a.a)(i,35670,[y,1,"bool"]),Object(a.a)(i,35671,[y,2,"bvec2"]),Object(a.a)(i,35672,[y,3,"bvec3"]),Object(a.a)(i,35673,[y,4,"bvec4"]),Object(a.a)(i,35674,[y,8,"mat2"]),Object(a.a)(i,35685,[y,8,"mat2x3"]),Object(a.a)(i,35686,[y,8,"mat2x4"]),Object(a.a)(i,35675,[y,12,"mat3"]),Object(a.a)(i,35687,[y,12,"mat3x2"]),Object(a.a)(i,35688,[y,12,"mat3x4"]),Object(a.a)(i,35676,[y,16,"mat4"]),Object(a.a)(i,35689,[y,16,"mat4x2"]),Object(a.a)(i,35690,[y,16,"mat4x3"]),i);function _(e){switch(e){case f:return f;case h:case v:case d:return h;case g:case p:case m:return g;default:return Object(o.a)(!1),0}}function x(e){var t=b[e];if(!t)return null;var n=Object(r.a)(t,2);return{type:n[0],components:n[1]}}function w(e,t){switch(e){case s:case u:case c:case l:e=y}for(var n in b){var i=Object(r.a)(b[n],3),a=i[0],o=i[1],f=i[2];if(a===e&&o===t)return{glType:n,name:f}}return null}},function(e,t,n){"use strict";n.d(t,"e",function(){return y}),n.d(t,"d",function(){return b}),n.d(t,"b",function(){return _}),n.d(t,"a",function(){return w}),n.d(t,"c",function(){return O});var i,r=n(0),a=n(60),o=n(95),s=n(56),u=n(26),c=(i={},Object(r.a)(i,5126,function(e,t,n){return e.uniform1fv(t,g(n,1))}),Object(r.a)(i,35664,function(e,t,n){return e.uniform2fv(t,g(n,2))}),Object(r.a)(i,35665,function(e,t,n){return e.uniform3fv(t,g(n,3))}),Object(r.a)(i,35666,function(e,t,n){return e.uniform4fv(t,g(n,4))}),Object(r.a)(i,5124,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35667,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35668,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35669,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35670,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35671,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35672,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35673,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,g(n,4))}),Object(r.a)(i,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,g(n,9))}),Object(r.a)(i,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,g(n,16))}),Object(r.a)(i,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,5125,function(e,t,n){return e.uniform1uiv(t,m(n,1))}),Object(r.a)(i,36294,function(e,t,n){return e.uniform2uiv(t,m(n,2))}),Object(r.a)(i,36295,function(e,t,n){return e.uniform3uiv(t,m(n,3))}),Object(r.a)(i,36296,function(e,t,n){return e.uniform4uiv(t,m(n,4))}),Object(r.a)(i,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,g(n,6))}),Object(r.a)(i,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,g(n,8))}),Object(r.a)(i,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,g(n,6))}),Object(r.a)(i,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,g(n,12))}),Object(r.a)(i,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,g(n,8))}),Object(r.a)(i,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,g(n,12))}),Object(r.a)(i,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36311,function(e,t,n){return e.uniform1i(t,n)}),i),l={},f={},h={},d=[0];function v(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(d[0]=e,e=d);var r=e.length;if(r%t&&u.a.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&uHTMLVideoElement.HAVE_METADATA&&(i.width!==o.videoWidth||i.height!==o.videoHeight?(i.resize({width:o.videoWidth,height:o.videoHeight,mipmaps:!0}),i.setSubImageData({data:o,paramters:P})):i.setSubImageData({data:o}),i.generateMipmap());i&&r&&r.setUniforms(Object.assign({},t,{bitmapTexture:i,desaturate:s,transparentColor:u.map(function(e){return e/255}),tintColor:c.slice(0,3).map(function(e){return e/255})})).draw()}},{key:"loadTexture",value:function(e){var t=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),e instanceof O.a?this.setState({bitmapTexture:e}):e instanceof HTMLVideoElement?this.setState({bitmapTexture:new O.a(t,{width:1,height:1,parameters:P,mipmaps:!1})}):e&&this.setState({bitmapTexture:new O.a(t,{data:e,parameters:P})})}},{key:"calculatePositions",value:function(e){var t=e.value,n=this.state.positions;t.set(n)}},{key:"calculatePositions64xyLow",value:function(e){var t=this.use64bitPositions();(e.constant=!t,t)?e.value.set(this.state.positions.map(b.c)):e.value=new Float32Array(4)}}]),t}(_.a);S.layerName="BitmapLayer",S.defaultProps={image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};var j,k=n(72),C=n(80),E=n(122),A=1024,T=4,M=function(){},L=(j={},y()(j,10241,9987),y()(j,10240,9729),j);function I(e){return e&&(e.id||e.url)}function R(e,t,n){for(var i=0;i0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&(R(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&R(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new O.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:L})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(C.f)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:L}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(E.b)(e.url).then(function(r){var a=I(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},L,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),D=[0,0,0,255],N={iconAtlas:{type:"object",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},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:D},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},z=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new F(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:D},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s||this.props._asyncPropOriginalValues.iconAtlas?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),r.extensionsChanged){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(k.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=Object(b.c)(p[0]),a[o++]=Object(b.c)(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(_.a);z.layerName="IconLayer",z.defaultProps=N;var B=n(222),U=n(192),V=[0,0,0,255],G=[0,0,1],W=new U.a,H={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:G},getColor:{type:"accessor",value:V},material:W,radiusPixels:{deprecatedFor:"pointSize"}};var X=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:G},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:V}})}},{key:"updateState",value:function(e){var n,i,r,a=e.props,o=e.oldProps,s=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:a,oldProps:o,changeFlags:s}),s.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),this.getAttributeManager().invalidateAll()}s.dataChanged&&(n=a.data,i=n.header,r=n.attributes,i&&r&&(n.length=i.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION,r.instancePositions64xyLow={constant:!0,value:new Float32Array(2)}),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0&&(r.instanceColors=r.COLOR_0)))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(k.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var _=s(y,h);u[c++]=Object(b.c)(_[0]),u[c++]=Object(b.c)(_[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(_.a);X.layerName="PointCloudLayer",X.defaultProps=H;var q=n(171),Z=n(170),Y=n(217),K=n(114),Q=n(218),J=n(223),$=n(193),ee=n(16),te=n.n(ee),ne=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position); \n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getParagraphSize,f=r.getRowSize,h=r.getOffsets,d=e.value,v=n*e.size,g=Object(k.a)(a,n,i).iterable,p=!0,m=!1,y=void 0;try{for(var b,_=g[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){var x=b.value,w=o[s(x)]||{},O=l(x),P=te()(O,2),S=P[0],j=P[1],C=f(x),E=te()(C,1)[0],A=h(x),T=te()(A,2),M=T[0],L=T[1],I=u(x),R=c(x),F=(1-I)*(S-E)/2;d[v++]=(I-1)*S/2+F+w.width/2+M||0,d[v++]=(R-1)*j/2+w.height/2+L||0}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(k.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(z);ne.layerName="MultiIconLayer",ne.defaultProps={getRowSize:{type:"accessor",value:function(e){return e.rowSize||[0,0]}},getOffsets:{type:"accessor",value:function(e){return e.offsets||[0,0]}},getParagraphSize:{type:"accessor",value:function(e){return e.size||[1,1]}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ie=n(231),re=n.n(ie),ae=n(15),oe=32;function se(e,t,n,i,r){var a=e.split("\n"),o=[0,0],s=0;a.forEach(function(e){var a=function(e,t,n){var i=0,r=0,a=Array.from(e);return{characters:a=a.map(function(e,a){var o={text:e,offsetLeft:i},s=t[e];return s?(i+=s.width,r||(r=s.height*n)):(ae.a.warn("Missing character: ".concat(e))(),i+=oe),o}),rowWidth:i,rowHeight:r}}(e,n,t),u=a.characters,c=a.rowWidth,l=a.rowHeight,f=[c,l];u.forEach(function(e){e.offsetTop=s,e.size=o,e.rowSize=f,r.push(i(e))}),s+=l,o[0]=Math.max(o[0],c)}),o[1]=s}var ue=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ce=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),le="Monaco, monospace",fe="normal",he=64,de=2,ve=.25,ge=3,pe=new ue(3),me=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function ye(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};me.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=pe.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=pe.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),pe.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");be(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(be(h,r,o,a),u){var b=new re.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,O=void 0;try{for(var P,S=t[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;ye(b.draw(j),_),h.putImageData(_,v[j].x-s,v[j].y-s)}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}}else{var k=!0,C=!1,E=void 0;try{for(var A,T=t[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h.fillText(M,v[M].x,v[M].y+.9*o)}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=pe.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),xe=n(139),we={fontSize:he,buffer:de,sdf:!1,radius:ge,cutoff:ve},Oe={start:1,middle:0,end:-1},Pe={top:1,center:0,bottom:-1},Se=["fontSize","buffer","sdf","radius","cutoff"],je={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ce,fontFamily:le,fontWeight:fe,lineHeight:1,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},ke=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new _e(this.context.gl)}}},{key:"updateState",value:function(e){var t=this,n=e.props,i=e.oldProps,r=e.changeFlags,a=this.fontChanged(i,n);a&&this.updateFontAtlas({oldProps:i,props:n});var o=r.dataChanged||a||n.lineHeight!==i.lineHeight||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText);if(o&&Array.isArray(r.dataChanged)){var s=this.state.data.slice(),u=r.dataChanged.map(function(e){return Object(xe.a)({data:s,getIndex:function(e){return e.__source.index},dataRange:e,replace:t.transformStringToLetters(e)})});this.setState({data:s,dataDiff:u})}else o&&this.setState({data:this.transformStringToLetters(),dataDiff:null})}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},we,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return Se.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,r=n.lineHeight,a=n.getText,o=this.state.iconMapping,s=t.startRow,u=t.endRow,c=Object(k.a)(i,s,u),l=c.iterable,f=c.objectInfo,h=[],d=!0,v=!1,g=void 0;try{for(var p,m=function(){var t=p.value;f.index++;var n=a(t,f);n&&se(n,r,o,function(n){return e.getSubLayerRow(n,t,f.index)},h)},y=l[Symbol.iterator]();!(d=(p=y.next()).done);d=!0)m()}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}return h}},{key:"getAnchorXFromTextAnchor",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Oe[e]||0}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Pe[e]||0}}},{key:"renderLayers",value:function(){var e=this.state,t=e.data,n=e.dataDiff,i=e.scale,r=e.iconAtlas,a=e.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.billboard,g=o.sdf,p=o.sizeScale,m=o.sizeUnits,y=o.sizeMinPixels,b=o.sizeMaxPixels,_=o.transitions,x=o.updateTriggers;return new(this.getSubLayerClass("characters",ne))({sdf:g,iconAtlas:r,iconMapping:a,_dataDiff:n&&function(){return n},getPosition:this.getSubLayerAccessor(s),getColor:this.getSubLayerAccessor(u),getSize:this.getSubLayerAccessor(c),getAngle:this.getSubLayerAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this.getSubLayerAccessor(d),getPickingIndex:function(e){return e.__source.index},billboard:v,sizeScale:p*i,sizeUnits:m,sizeMinPixels:y*i,sizeMaxPixels:b*i,transitions:_&&{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:x.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:x.getPixelOffset,getAnchorX:x.getTextAnchor,getAnchorY:x.getAlignmentBaseline}}),{data:t,getIcon:function(e){return e.text},getRowSize:function(e){return e.rowSize},getOffsets:function(e){return[e.offsetLeft,e.offsetTop]},getParagraphSize:function(e){return e.size}})}}]),t}($.a);ke.layerName="TextLayer",ke.defaultProps=je;var Ce=n(131);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return S}),n.d(t,"IconLayer",function(){return z}),n.d(t,"LineLayer",function(){return B.a}),n.d(t,"PointCloudLayer",function(){return X}),n.d(t,"ScatterplotLayer",function(){return q.a}),n.d(t,"ColumnLayer",function(){return Z.a}),n.d(t,"GridCellLayer",function(){return Y.a}),n.d(t,"PathLayer",function(){return K.a}),n.d(t,"PolygonLayer",function(){return Q.a}),n.d(t,"GeoJsonLayer",function(){return J.a}),n.d(t,"TextLayer",function(){return ke}),n.d(t,"SolidPolygonLayer",function(){return Ce.a}),n.d(t,"_MultiIconLayer",function(){return ne})},function(e,t,n){"use strict";var i=n(43),r=n(60),a=n(56),o=n(70),s=n(30),u=n(118),c=n(19);function l(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(c.a)(!1),0}}var f=n(159),h=n(26);function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,f=t.sourceAttachment,h=void 0===f?36064:f,d=t.target,v=void 0===d?null:d,g=t.sourceWidth,p=t.sourceHeight,m=t.sourceType,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=_.attachments;g=g||_.width,p=p||_.height,36064===h&&null===O&&(h=1028),Object(c.a)(P[h]),v=function(e,t,n,i,r){if(e)return e;t=t||5121;var a=Object(u.c)(t,{clamped:!1}),o=l(n);return new a(i*r*o)}(v,m=m||P[h].type,s,g,p),m=m||Object(u.b)(v);var S=w.bindFramebuffer(36160,O);return w.readPixels(i,a,g,p,s,m,v),w.bindFramebuffer(36160,S||null),x&&_.delete(),v}function v(e,t){var n=t.sourceX,r=void 0===n?0:n,a=t.sourceY,u=void 0===a?0:a,f=t.sourceFormat,h=void 0===f?6408:f,d=t.target,v=void 0===d?null:d,g=t.targetByteOffset,p=void 0===g?0:g,m=t.sourceWidth,y=t.sourceHeight,_=t.sourceType,x=b(e),w=x.framebuffer,O=x.deleteFramebuffer;Object(c.a)(w);var P=w.gl;if(m=m||w.width,y=y||w.height,Object(s.a)(P),_=_||(v?v.type:5121),!v){var S=l(h),j=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(c.a)(!1),0}}(_),k=p+m*y*S*j;v=new i.a(P,{byteLength:k,accessor:{type:_,size:S}})}return v.bind({target:35051}),Object(o.a)(P,{framebuffer:w},function(){P.readPixels(r,u,m,y,h,_,p)}),v.unbind({target:35051}),O&&w.delete(),v}function g(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=d(e,{sourceAttachment:i}),s=e.width,c=e.height;c>a;){var l=Object(u.d)({data:o,width:s,height:c});o=l.data,s=l.width,c=l.height}Object(u.a)({data:o,width:s,height:c});var f=document.createElement("canvas");f.width=s,f.height=c;var h=f.getContext("2d"),v=h.createImageData(s,c);return v.data.set(o),h.putImageData(v,0,0),f.toDataURL()}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=g(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,o=n.sourceY,s=void 0===o?0:o,u=n.targetX,l=n.targetY,f=n.targetZ,h=n.targetMipmaplevel,d=void 0===h?0:h,v=n.targetInternalFormat,g=void 0===v?6408:v,p=n.width,m=n.height,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=void 0!==u||void 0!==l||void 0!==f;u=u||0,l=l||0,f=f||0;var S=w.bindFramebuffer(36160,O);Object(c.a)(t);var j=null;if(t instanceof a.a&&(j=t,p=Number.isFinite(p)?p:j.width,m=Number.isFinite(m)?m:j.height,j.bind(0),t=j.target),P)switch(t){case 3553:case 34067:w.copyTexSubImage2D(t,d,u,l,r,s,p,m);break;case 35866:case 32879:w.copyTexSubImage3D(t,d,u,l,f,r,s,p,m)}else w.copyTexImage2D(t,d,g,r,s,p,m,0);return j&&j.unbind(),w.bindFramebuffer(36160,S||null),x&&_.delete(),j}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,u=n.sourceY0,l=void 0===u?0:u,f=n.sourceX1,d=n.sourceY1,v=n.targetX0,g=void 0===v?0:v,p=n.targetY0,m=void 0===p?0:p,y=n.targetX1,_=n.targetY1,x=n.color,w=void 0===x||x,O=n.depth,P=void 0!==O&&O,S=n.stencil,j=void 0!==S&&S,k=n.mask,C=void 0===k?0:k,E=n.filter,A=void 0===E?9728:E,T=b(e),M=T.framebuffer,L=T.deleteFramebuffer,I=b(t),R=I.framebuffer,F=I.deleteFramebuffer;Object(c.a)(M),Object(c.a)(R);var D=R.gl,N=R.handle,z=R.width,B=R.height,U=R.readBuffer;Object(s.a)(D),M.handle||36064!==r||(r=1028),w&&(C|=16384),P&&(C|=256),j&&(C|=1024),(L||F)&&1280&C&&(C=16384,h.a.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Object(c.a)(C),f=void 0===f?M.width:f,d=void 0===d?M.height:d,y=void 0===y?z:y,_=void 0===_?B:_;var V=D.bindFramebuffer(36009,N),G=D.bindFramebuffer(36008,M.handle);return D.readBuffer(r),D.blitFramebuffer(o,l,f,d,g,m,y,_,C,A),D.readBuffer(U),D.bindFramebuffer(36008,G||null),D.bindFramebuffer(36009,V||null),L&&M.delete(),F&&R.delete(),R}function b(e){return e instanceof r.a?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Object(f.b)(e),deleteFramebuffer:!0}}n.d(t,"e",function(){return d}),n.d(t,"f",function(){return v}),n.d(t,"b",function(){return g}),n.d(t,"c",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return y})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(179),v=n(22),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(81),u=n(180),c=n(18),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(82),u=n(15),c=n(18),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,e.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){if(!this.isDragging())return!1;var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState,r={};switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut(),r.isZooming=!0;break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn(),r.isZooming=!0;break;case 37:n?(t=i.rotateLeft(),r.isRotating=!0):(t=i.moveLeft(),r.isPanning=!0);break;case 39:n?(t=i.rotateRight(),r.isRotating=!0):(t=i.moveRight(),r.isPanning=!0);break;case 38:n?(t=i.rotateUp(),r.isRotating=!0):(t=i.moveUp(),r.isPanning=!0);break;case 40:n?(t=i.rotateDown(),r.isRotating=!0):(t=i.moveDown(),r.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),r),!0}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";var i=n(205),r=n(42),a=Object.keys(r.a).map(function(e){return"const float COORDINATE_SYSTEM_".concat(e," = ").concat(r.a[e],".;")}).join(""),o="".concat(a,"\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform float project_uAntimeridian;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n dy = clamp(dy, -1., 1.);\n }\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n"),s=n(136),u={};t.a={name:"project",dependencies:[i.a],vs:o,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?Object(s.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return v});var i=n(29);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-t[2],-t[6],-t[10]],up:[t[1],t[5],t[9]],right:[t[0],t[4],t[8]]}}var o=new i.a,s=new i.a,u=new i.a,c=new i.a,l=new i.a,f=new i.a,h=new i.a;function d(e){var t=e.aspect,n=e.near,r=e.far,a=e.fovyRadians,d=e.position,v=e.direction,g=e.up,p=e.right;s.copy(v);var m=1/s.len();s.normalize(),o.copy(d),u.copy(g).normalize(),c.copy(p).normalize();var y=2*Math.tan(a/2)*n,b=y*t;l.copy(s).scale(n*m).add(o),f.copy(s).scale(r*m).add(o);var _=s.clone().negate(),x=_.dot(l),w={near:{distance:x,normal:_},far:{distance:s.dot(f),normal:s.clone()}};return h.copy(c).scale(.5*b).add(l).subtract(o).normalize(),_=new i.a(u).cross(h),x=o.dot(_),w.right={normal:_,distance:x},h.copy(c).scale(.5*-b).add(l).subtract(o).normalize(),_=new i.a(h).cross(u),x=o.dot(_),w.left={normal:_,distance:x},h.copy(u).scale(.5*y).add(l).subtract(o).normalize(),_=new i.a(h).cross(c),x=o.dot(_),w.top={normal:_,distance:x},h.copy(u).scale(.5*-y).add(l).subtract(o).normalize(),_=new i.a(c).cross(h),x=o.dot(_),w.bottom={normal:_,distance:x},w}function v(e){return e-Math.fround(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(96),r=n(54);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t){var n,i,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),Object(c.a)(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(78))},function(e,t,n){"use strict";var i=n(36),r=n(90),a=n(49),o="Failed to create WebGL context in Node.js, headless gl not available",s="Failed to create WebGL context in Node.js, headless gl returned null";var u=n(125);var c=n(111),l=(n(19),n(110)),f=n(26),h=n(46);n.d(t,"e",function(){return g}),n.d(t,"a",function(){return p}),n.d(t,"c",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"d",function(){return b});function d(e){return Boolean(e&&2===e._version)}var v={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(v,{width:1,height:1},e)}function p(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},v,t),r=n.width,h=n.height;function g(e){if(t.throwOnError)throw new Error(e);return null}if(l.a){var p=t.canvas;e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(Object(u.a)({canvas:p,width:r,height:h,onError:g}),t)}else e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,u=e.onError;if(r&&!i)return u("headless-gl does not support WebGL2");if(!a.c)return u(o);var c=Object(a.c)(t,n,e);return c||u(s)}(Object(i.a)({},t,{width:r,height:h,onError:g}));return e?(function(e){var t=d(e)?"WebGL2":"WebGL1",n=Object(c.a)(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";f.a.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=m(e,t)),e):null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==a.a&&e instanceof a.a)return 2;return 1}(e);var n=t=Object.assign({},v,t),i=n.manageState,o=n.debug;return i&&Object(r.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(5),a=n(29),o=n(64),s=n(67),u=n(19),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id;this.id=n||Object(s.c)(this.constructor.name),this.display=!0,this.position=new a.a,this.rotation=new a.a,this.scale=new a.a(1,1,1),this.matrix=new o.a,this.userData={},this.props={},this._setScenegraphNodeProps(t)}return Object(r.a)(e,[{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:"setPosition",value:function(e){return Object(u.a)(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return Object(u.a)(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return Object(u.a)(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Object(u.a)(e),t=t||this.matrix;var n=new o.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{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)}}]),e}()},function(e,t,n){"use strict";var i=n(0),r=n(36),a=n(4),o=n(5),s=n(10),u=n(9),c=n(66),l=n(11),f=n(43),h=n(202),d=n(19),v={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function g(e,t){var n=(t||{}).attributeMap,i=void 0===n?v:n;return i&&i[e]||e}function p(e,t){var n;switch(e){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2}Object(d.a)(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var m=n(30),y=n(203),b=n(177),_=n(197),x=n(28),w=n(132),O=n(208),P=n(209),S=n(210),j=n(41),k=n.n(j),C=n(46),E={},A=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},T=new Map;k.a.listenFor("luma.gl",function(e){var t=E[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){C.d.__SEER_INITIALIZED__&&(T.has(e)||T.set(e,new Map),T.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();A(i,n,e.value),t.setUniforms(i)}});var M=n(67),L=n(26),I=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),Object(d.a)(Object(m.c)(t));var i=n.id,r=void 0===i?Object(M.c)("base-model"):i;this.id=r,this.gl=t,this.id=n.id||Object(M.c)("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(o.a)(e,[{key:"initialize",value:function(e){this.props={},this.program=this._createProgram(e),this.vertexArray=new y.a(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete E[t],k.a.deleteItem("luma.gl",t)}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.uniforms}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),function(e,t){if(C.d.__SEER_INITIALIZED__&&e){var n=T.get(e);n&&n.forEach(function(e,n){A(t,n,e)})}}(this.id,e),e=this._extractAnimatedUniforms(e),this.program.setUniforms(e),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,s=t.attributes,u=void 0===s?{}:s,c=t.transformFeedback,l=void 0===c?this.transformFeedback:c,f=t.parameters,h=void 0===f?{}:f,d=t.vertexArray,v=void 0===d?this.vertexArray:d,g=t.animationProps;E[(e=this).id]||(E[e.id]=e,k.a.listItem("luma.gl",e.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(g);var p=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&L.a.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,b=m.indexType,_=m.indexOffset,x=this.isInstanced,w=this.instanceCount,O=function(){},P=this.props,S=P.onBeforeRender,j=void 0===S?O:S,C=P.onAfterRender,A=void 0===C?O:C;j(),this._timerQueryStart();var T=this.program.draw(Object.assign({},t,{logPriority:p,uniforms:null,framebuffer:r,parameters:h,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:b,isInstanced:x,instanceCount:w,offset:y?_:0}));return this._timerQueryEnd(),A(),this._logDrawCallEnd(p,v,r),T}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&b.a.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&L.a.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,s=e.defines,u=void 0===s?{}:s,c=e.inject,l=void 0===c?{}:c,f=e.shaderCache,h=void 0===f?null:f,v=e.varyings,g=void 0===v?null:v,p=e.bufferMode,m=void 0===p?35981:p,y=e.program,b=void 0===y?null:y;this.getModuleUniforms=function(e){};var O=this.id;if(!b){n=n||x.a.vs,r=r||x.a.fs;var P=Object(w.a)(this.gl,{vs:n,fs:r,modules:o,inject:l,defines:u,log:L.a});n=P.vs,r=P.fs,b=h?h.getProgram(this.gl,{id:O,vs:n,fs:r}):new _.a(this.gl,{id:O,vs:n,fs:r,varyings:g,bufferMode:m}),this.getModuleUniforms=P.getUniforms||function(e){}}return Object(d.a)(b instanceof _.a,"Model needs a program"),b}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!Object(M.a)(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new b.a(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,L.a.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(L.a.priority>> DRAWING MODEL ".concat(this.id),{collapsed:L.a.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=Object(O.a)({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=Object(P.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,c=Object(P.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),l=c.table;c.count>0&&L.a.log("MISSING UNIFORMS",Object.keys(l))(),u>0&&L.a.log("UNUSED UNIFORMS",Object.keys(s))();var f=Object(S.a)(this.vertexArray.configuration);L.a.table(e,r)(),L.a.table(e,o)(),L.a.table(e+1,f)(),function(e,t){if(k.a.isReady()&&!k.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);k.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),L.a.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}();n.d(t,"a",function(){return R});var R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,t);var i=n.id,o=void 0===i?Object(M.c)("model"):i;return Object(s.a)(this,Object(u.a)(t).call(this,e,Object(r.a)({},n,{id:o})))}return Object(l.a)(t,e),Object(o.a)(t,[{key:"initialize",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Object(d.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){Object(c.a)(Object(u.a)(t.prototype),"delete",this).call(this),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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Object(d.a)(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Object(d.a)(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=function(e,t,n){var i={},a=t.indices;for(var o in t.attributes){var s=t.attributes[o],u=g(o,n);if("indices"===o)a=s;else if(s.constant)i[u]=s.value;else{var c=s.value,l=Object(r.a)({},s);delete l.value,i[u]=[new f.a(e,c),l],p(o,l)}}if(a){var h=a.value||a;Object(d.a)(h instanceof Uint16Array||h instanceof Uint32Array,'attribute array for "indices" must be of integer type');var v={size:1,isIndexed:void 0===a.isIndexed||a.isIndexed};i.indices=[new f.a(e,{data:h,target:34963}),v]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(M.a)(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,r=e.feedbackBuffers,a=e.unbindModels,o=void 0===a?[]:a,s=e.parameters;r&&this._setFeedbackBuffers(r),n&&(s=Object.assign({},s,Object(i.a)({},35977,n))),o.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:s}))}finally{o.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return L.a.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof f.a&&t.delete()}}},{key:"_setAnimationProps",value:function(e){if(this.animated){Object(d.a)(e,"Model.draw(): animated uniforms but no animationProps");var t=this._evaluateAnimateUniforms(e);this.program.setUniforms(t)}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(M.a)(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new h.a(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}}]),t}(I)},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,i))).initialize(i),Object.seal(Object(s.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=Object(v.d)(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,d)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(u.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Object(g.a)(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Object(v.d)(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*d[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(174),r="7.2.0-beta.3",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return h});var i,r,a,o=n(0),s=n(30),u=(i={},Object(o.a)(i,6407,{dataFormat:6407,types:[5121,33635]}),Object(o.a)(i,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(o.a)(i,6406,{dataFormat:6406,types:[5121]}),Object(o.a)(i,6409,{dataFormat:6409,types:[5121]}),Object(o.a)(i,6410,{dataFormat:6410,types:[5121]}),Object(o.a)(i,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(o.a)(i,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(o.a)(i,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(o.a)(i,34836,{dataFormat:6408,types:[5126],gl2:!0}),i),c=(r={},Object(o.a)(r,6403,1),Object(o.a)(r,36244,1),Object(o.a)(r,33319,2),Object(o.a)(r,33320,2),Object(o.a)(r,6407,3),Object(o.a)(r,36248,3),Object(o.a)(r,6408,4),Object(o.a)(r,36249,4),Object(o.a)(r,6402,1),Object(o.a)(r,34041,1),Object(o.a)(r,6406,1),Object(o.a)(r,6409,1),Object(o.a)(r,6410,2),r),l=(a={},Object(o.a)(a,5126,4),Object(o.a)(a,5125,4),Object(o.a)(a,5124,4),Object(o.a)(a,5123,2),Object(o.a)(a,5122,2),Object(o.a)(a,5131,2),Object(o.a)(a,5120,1),Object(o.a)(a,5121,1),a);function f(e,t){var n=u[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=Object(s.d)(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}function h(e,t){var n=u[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},,function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(10),a=n(9),o=n(11),s=n(93),u=n(58),c="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",l=[-1,-1,1,-1,-1,1,1,1],f=function(e){function t(e,n){var o;Object(i.a)(this,t);var s=l.map(function(e){return-1===e?0:e});return(o=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},n,{vs:c,geometry:new u.a({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(l)},aTexCoord:{size:2,value:new Float32Array(s)},aCoordinate:{size:2,value:new Float32Array(s)}}})})))).setVertexCount(4),o}return Object(o.a)(t,e),t}(s.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(178),v=n(70),g=n(112),p=n(148),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.a)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.a)(e,{scissorTest:!0,scissor:l},function(){return Object(g.a)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(p.a)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,mousePosition:e.context.mousePosition,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.a)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i,r=n(0),a=n(30),o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",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"};t.b=(i={},Object(r.a)(i,o.WEBGL2,[function(e){return Object(a.d)(e)}]),Object(r.a)(i,o.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(r.a)(i,o.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(r.a)(i,o.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(r.a)(i,o.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(r.a)(i,o.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(r.a)(i,o.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(r.a)(i,o.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(r.a)(i,o.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(r.a)(i,o.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(r.a)(i,o.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(r.a)(i,o.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(r.a)(i,o.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(r.a)(i,o.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),i)},function(e,t,n){"use strict";function i(e,t){return e===t||Object.keys(e).every(function(n){return Array.isArray(e[n])&&Array.isArray(t[n])?i(e[n],t[n]):e[n]===t[n]})}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(32),o=n(9),s=n(66),u=n(5),c=n(11),l=n(52),f=n(43),h=n(30),d=null;function v(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!d||d.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var u=s.id||s.program&&s.program.id;return(n=Object(r.a)(this,Object(o.a)(t).call(this,e,Object.assign({},s,{id:u})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(s),Object.seal(Object(a.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?Object(h.d)(e)||"Chrome"===function(e){if(!e&&!Object(m.a)())return"Node";if(Object(y.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":p.b.chrome?"Chrome":p.b.safari?"Safari":p.b.mozInnerScreenX?"Firefox":"Unknown"}():Object(h.d)(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Object(g.a)(!1)}}}]),Object(u.a)(t,[{key:"delete",value:function(){Object(s.a)(Object(o.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(g.a)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Object(g.a)(Object(h.d)(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new f.a(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=v(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof a.a)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof a.a)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new a.a(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"e",function(){return c}),n.d(t,"a",function(){return l}),n.d(t,"c",function(){return f}),n.d(t,"d",function(){return h}),n.d(t,"b",function(){return d});var u=new s;function c(e){u.setDefaultShaderModules(e)}function l(){return u.getDefaultShaderModules()}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;u.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(u.defaultShaderModules),v(e=u.resolveModules(e))}function d(e){return u.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,a=t.color,l=void 0===a?null:a,f=t.depth,h=void 0===f?null:f,d=t.stencil,g=void 0===d?null:d,p={};i&&(p.framebuffer=i);var m=0;l&&(m|=c,!0!==l&&(p.clearColor=l)),h&&(m|=s,!0!==h&&(p.clearDepth=h)),g&&(m|=u,!0!==h&&(p.clearStencil=h)),Object(o.a)(0!==m,v),Object(r.a)(e,p,function(){e.clear(m)})}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,s=void 0===n?null:n,u=t.buffer,c=void 0===u?l:u,g=t.drawBuffer,p=void 0===g?0:g,m=t.value,y=void 0===m?[0,0,0,0]:m;Object(a.a)(e),Object(r.a)(e,{framebuffer:s},function(){switch(c){case l:switch(y.constructor){case Int32Array:e.clearBufferiv(c,p,y);break;case Uint32Array:e.clearBufferuiv(c,p,y);break;case Float32Array:default:e.clearBufferfv(c,p,y)}break;case f:e.clearBufferfv(f,0,[y]);break;case h:e.clearBufferiv(h,0,[y]);break;case d:var t=Object(i.a)(y,2),n=t[0],r=t[1];e.clearBufferfi(d,0,n,r);break;default:Object(o.a)(!1,v)}})}},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=function(e){function t(e){var n;r()(this,t),n=u()(this,l()(t).call(this,e));var i=e._shadow,a=void 0!==i&&i;return n.shadow=a,n}return h()(t,e),o()(t,[{key:"getProjectedLight",value:function(){return this}}]),t}(n(146).b)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(130),p=n(93),m=n(58),y=n(21),b=n(85),_=y.experimental.Tesselator,x=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3,padding:3},endPositions:{size:3,padding:3},segmentTypes:{size:1,type:Uint8ClampedArray},startPositions64XyLow:{size:2,padding:2,fp64Only:!0},endPositions64XyLow:{size:2,padding:2,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){var t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t<3?0:t+1:t-1}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.startPositions64XyLow,o=n.endPositions64XyLow,s=n.segmentTypes,u=this.fp64,c=t.geometrySize;if(0!==c)for(var l,f,h=this.isClosed(e),d=t.vertexStart,v=0;v=e.length&&(t+=1-e.length/n),[e[t*n],e[t*n+1],3===n?e[t*n+2]:0]}return t>=e.length&&(t+=1-e.length),e[t]}},{key:"isClosed",value:function(e){var t=this.getPathLength(e),n=this.getPointOnPath(e,0),i=this.getPointOnPath(e,t-1);return n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]}}]),t}(_);n.d(t,"a",function(){return S});var w=[0,0,0,255],O={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:w},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},P={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceLeftStartPositions64xyLow;\nattribute vec4 instanceEndRightPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width, vec2 widthPixels\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(vCornerOffset * widthPixels * isValid, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n return currPoint + vec3(offset.xy / widthPixels * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n vec2 width = billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width, widthPixels\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.worldPosition = instanceStartPositions;\n geometry.worldPositionAlt = instanceEndPositions;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceLeftStartPositions64xyLow.xy, instanceLeftStartPositions64xyLow.zw, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceLeftStartPositions64xyLow.zw, instanceEndRightPositions64xyLow.xy, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceEndRightPositions64xyLow.xy, instanceEndRightPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({startPositions:{size:3,offset:12,transition:P,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{offset:0},instanceStartPositions:{offset:12}}},endPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0,shaderAttributes:{instanceEndPositions:{offset:0},instanceRightPositions:{offset:12}}},instanceLeftStartPositions64xyLow:{size:4,stride:8,update:this.calculateLeftStartPositions64xyLow,noAlloc:!0},instanceEndRightPositions64xyLow:{size:4,stride:8,update:this.calculateEndRightPositions64xyLow,noAlloc:!0},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:P,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:P,defaultValue:w},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new x({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions(),dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),r.dataChanged||a.invalidateAll()}if(r.extensionsChanged){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.a({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateSegmentTypes",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("segmentTypes")}},{key:"calculateLeftStartPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startPositions64XyLow"):new Float32Array(4)}},{key:"calculateEndRightPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("endPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,o=n.pointLights,s=n.directionalLights,u=i||o&&o.length>0||s&&s.length>0;return u?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,o=void 0===r?[]:r,s={};s["lighting_uAmbientLight.color"]=t?a(t):[0,0,0];return i.forEach(function(e,t){s["lighting_uPointLight[".concat(t,"].color")]=a(e),s["lighting_uPointLight[".concat(t,"].position")]=e.position,s["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),s.lighting_uPointLightCount=i.length,o.forEach(function(e,t){s["lighting_uDirectionalLight[".concat(t,"].color")]=a(e),s["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),s.lighting_uDirectionalLightCount=o.length,s}({ambientLight:i,pointLights:o,directionalLights:s}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var c={pointLights:[],directionalLights:[]},l=!0,f=!1,h=void 0;try{for(var d,v=(t.lights||[])[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;switch(g.type){case"ambient":c.ambientLight=g;break;case"directional":c.directionalLights.push(g);break;case"point":c.pointLights.push(g)}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return e({lightSources:c})}return{}},defines:{MAX_LIGHTS:3}},{});function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o});var i=n(57),r={};function a(e){e=Array.isArray(e)?e:[e];var t=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var u=o.value,c=Object(i.b)(u),l=!0,f=!1,h=void 0;try{for(var d,v=c.extensions[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;r[g]=c}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}}catch(e){n=!0,a=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}}function o(){return Object.values(r)}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"d",function(){return s});var i="Failed to deduce GL constant from typed array";function r(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(i)}}function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u=24&&2303741511===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint32(16,u),height:e.getUint32(20,u)}}}],["image/jpeg",{test:function(e){return e.byteLength>=2&&65496===e.getUint16(0,u)},getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,u))return null;var t=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),n=t.tableMarkers,i=t.sofMarkers,r=2;for(;r=10&&1195984440===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint16(6,c),height:e.getUint16(8,c)}}}],["image/bmp",{test:function(e){return e.byteLength>=2&&16973===e.getUint16(0,u)},getSize:function(e){return{width:e.getUint32(18,c),height:e.getUint32(22,c)}}}]]);var f="Invalid MIME type. Supported MIME types are: ".concat(Array.from(l.keys()).join(", "));function h(e){var t=g(e),n=!0,i=!1,r=void 0;try{for(var a,o=l.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=Object(s.a)(a.value,2),c=u[0];if((0,u[1].test)(t))return c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(0,v(t=t||h(e)).getSize)(g(e));if(!n)throw new Error("invalid image data for type: ".concat(t));return n}(e,t=t||h(e));return n.mimeType=t,n}function v(e){var t=l.get(e);if(!t)throw new Error(f);return t}function g(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}n.d(t,"a",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"e",function(){return _}),n.d(t,"c",function(){return x});var p=o.a._parseImageNode||"undefined"!=typeof ImageBitmap;function m(e,t){if(o.a._parseImageNode){var n=d(e).mimeType;return o.a._parseImageNode(e,n,t)}return _(e,t)}function y(e){return b.apply(this,arguments)}function b(){return(b=Object(a.a)(r.a.mark(function e(t){var n,i,a,o=arguments;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:{},"undefined"!=typeof Image){e.next=9;break}return e.next=4,fetch(t,n);case 4:return i=e.sent,e.next=7,i.arrayBuffer();case 7:return a=e.sent,e.abrupt("return",m(a,n));case 9:return e.next=11,x(t,n);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _(e,t){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var n=new Blob([new Uint8Array(e)]);return createImageBitmap(n,{imageOrientation:t.imageOrientation||"none",premultiplyAlpha:t.premultiplyAlpha||"default"})}function x(e,t){return w.apply(this,arguments)}function w(){return(w=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(24),r=n(119),a="void main() {gl_FragColor = vec4(0);}",o="#version 300 es\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}";function s(e,t){t=Array.isArray(t)?t:[t];var n=e.replace(/^\s+/,"").split(/\s+/),r=Object(i.a)(n,3),a=r[0],o=r[1],s=r[2];return t.includes(a)&&o&&s?{qualifier:a,type:o,name:s.split(";")[0]}:null}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var i=n(19),r="";function a(e){r=e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)("string"==typeof e),e=r+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function s(e,t){return Object(i.a)("string"==typeof e),e=r+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i,r=n(110).a&&"undefined"!=typeof document,a=r&&"complete"===document.readyState;function o(){return i||(i=r?new Promise(function(e,t){if(r&&"complete"===document.readyState)return a=!0,void e(document);window.onload=function(){a=!0,e(document)}}):Promise.resolve({})),i}function s(e){var t,n=e.canvas,i=e.width,r=e.height,o=e.onError,s=void 0===o?function(){}:o;return"string"==typeof n?(a||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:s}),t}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(56),l=n(30),f=n(124),h=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.b)(e),(s instanceof Promise||"string"==typeof s)&&(s={data:s}),"string"==typeof s.data&&(s=Object.assign({},s,{data:Object(f.b)(s.data)})),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},s,{target:3553})))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e,t){return c.a.isSupported(e,t)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return u});var i=n(104),r=n(30),a=n(19);function o(e,t){return s(e,t)}function s(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return c(e,t)})}function u(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=Object(r.d)(e),i.b)e.luma.caps[t]=c(e,t);return e.luma.caps}function c(e,t){var n=i.b[t];Object(a.a)(n,t);var o,s=Object(r.d)(e)&&n[1]||n[0];if("function"==typeof s)o=s(e);else if(Array.isArray(s)){o=!0;var u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;o=o&&Boolean(e.getExtension(d))}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}else"string"==typeof s?o=Boolean(e.getExtension(s)):"boolean"==typeof s?o=s:Object(a.a)(!1);return o}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(4),r=function e(){Object(i.a)(this,e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return O});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(184),v=n(22),g=n(83),p=n(137),m=n(81),y=n(82),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,O=void 0===w?b.minZoom:w,P=e.maxZoom,S=void 0===P?b.maxZoom:P,j=e.startPanPosition,k=e.startTarget,C=e.startRotationX,E=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:O,maxZoom:S})))._interactiveState={startPanPosition:j,startTarget:k,startRotationX:C,startRotationOrbit:E,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c=Object.keys(t),l=0;l=0&&n.modules.splice(i,1)}return"inject"in t&&(n.inject=Object.assign({},e.inject,t.inject)),n}var T=n(151),M=n(99),L=n(72),I={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return N(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return R(e,t)}},accessor:{validate:function(e,t){var n=z(e);return"function"===n||n===z(t.value)},equal:function(e,t,n){return"function"==typeof t||R(e,t)}},array:{validate:function(e,t){return t.optional&&!e||N(e)},equal:function(e,t,n){return n.compare?R(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function R(e,t){if(e===t)return!0;if(!N(e)||!N(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=Q,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):Object(L.b)(t)?this._resolveAsyncIterable(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){t=n._postProcessValue(e,t),n._setAsyncPropValue(e,t,r);var i=n.layer.props.onDataLoad;"data"===e&&i&&i(t,{propName:e,layer:n.layer})}).catch(function(e){return C.a.error(e)()})}},{key:"_resolveAsyncIterable",value:function(){var e=Z()(X.a.mark(function e(t,n){var i,r,a,o,s,u,c,l,f,h,d,v;return X.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"data"!==t&&this._setPropValue(t,n),(i=this.asyncProps[t]).pendingLoadCount++,r=i.pendingLoadCount,a=[],o=0,s=!0,u=!1,e.prev=8,l=K()(n);case 10:return e.next=12,l.next();case 12:return f=e.sent,s=f.done,e.next=16,f.value;case 16:if(h=e.sent,s){e.next=26;break}d=h,a=this._postProcessValue(t,d,a),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:o,endRow:a.length}]}),o=a.length,this._setAsyncPropValue(t,a,r);case 23:s=!0,e.next=10;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(8),u=!0,c=e.t0;case 32:if(e.prev=32,e.prev=33,s||null==l.return){e.next=37;break}return e.next=37,l.return();case 37:if(e.prev=37,!u){e.next=40;break}throw c;case 40:return e.finish(37);case 41:return e.finish(32);case 42:(v=this.layer.props.onDataLoad)&&v(a,{propName:t,layer:this.layer});case 44:case"end":return e.stop()}},e,this,[[8,28,32,42],[33,,37,41]])}));return function(t,n){return e.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(e,t,n){var i=(this.component?this.component.props:{}).dataTransform;return"data"!==e?t:i?i(t,n):n?n.concat(t):t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),$=0,ee=function(){function e(){o()(this,e),this.props=function(){for(var e=U(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i2&&void 0!==arguments[2]?arguments[2]:{}).url,i=null;return i=(i=i||function(e,t){var n=t.match(Pe),i=n&&n[0];return i&&function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object(xe.b)(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(e,i)}(t,void 0===n?"":n))||function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if("string"==typeof t){if(je(t,s))return s}else if(t instanceof ArrayBuffer&&ke(t,s))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(t,e)}function je(e,t){return t.testText&&t.testText(e)}function ke(e,t){switch(Array.isArray(t.test)?"array":Object(se.a)(t.test)){case"function":return t.test(e,t);case"string":case"array":return(Array.isArray(t.test)?t.test:[t.test]).some(function(t){return t===function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;if(e.byteLength<=t+n)return"";for(var i=new DataView(e),r="",a=0;a0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{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:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(T.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(ne.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(T.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){C.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){C.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitPositions",value:function(){return this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return C.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.props.extensions[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=A(e,o.getShaders.call(this,o))}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return e}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();if(t.dataChanged&&n){var i=t.dataChanged;if(Array.isArray(i)){var r=!0,a=!1,o=void 0;try{for(var s,u=i[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;n.invalidateAll(c)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}else n.invalidateAll()}}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(C.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(C.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;this._setModelAttributes(o,e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"_updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}}},{key:"updateTransition",value:function(){var e=this.getAttributeManager();e&&e.updateTransition(this.context.time)}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.numInstances,i=e.value,r=e.size;if(1!==i[0]){var a=qe.length/r;if(a2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=Object(O.c)(v),o[2*l+1]=Object(O.c)(g)),s[l]=1,l++}if(h)for(var m=0;m2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(147);n.d(t,"c",function(){return k}),n.d(t,"b",function(){return C}),n.d(t,"a",function(){return E});var w="\n\n".concat(x.a,"\n\n"),O=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),S={},j="precision highp float;\n\n";function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function C(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);S[e]=S[e]||{},S[e][o]=S[e][o]||{},Object(s.a)(!S[e][o][n],"Module injection already created"),S[e][o][n]={injection:i,order:a}}function E(e,t){var n=t.vs,i=t.fs,r=Object(o.d)(t.modules||[]);return{gl:e,vs:A(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:A(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:T(r),modules:M(r)}}function A(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=t.defines,c=void 0===u?{}:u,l=t.inject,f=void 0===l?{}:l,h=t.prologue,v=void 0===h||h,p=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var b=r===a.b,_=i.split("\n"),k=100,C="",E=i;0===_[0].indexOf("#version ")&&(k=300,C=_[0],E=_.slice(1).join("\n"));var A={};o.forEach(function(e){Object.assign(A,e.getDefines())}),Object.assign(A,c);var T=v?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(O[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(O[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(A),"\n").concat(b?"":j,"\n"):"".concat(C,"\n"),M=!1,L={},I={};for(var R in f){var F="string"==typeof f[R]?{injection:f[R],order:0}:f[R];R.match(/^(v|f)s:/)?"#"===R[3]?I[R]=[F]:L[R]=[F]:I[R]=[F]}var D=!0,N=!1,z=void 0;try{for(var B,U=o[Symbol.iterator]();!(D=(B=U.next()).done);D=!0){var V=B.value;switch(V.name){case"inject":M=!0;break;default:if(p&&V.checkDeprecations(E,p),T+=V.getModuleSource(r,k),S[V.name]){var G=S[V.name][r];for(var W in G)W.match(/^(v|f)s:#/)?(I[W]=I[W]||[],I[W].push(G[W])):(L[W]=L[W]||[],L[W].push(G[W]))}}}}catch(e){N=!0,z=e}finally{try{D||null==U.return||U.return()}finally{if(N)throw z}}return T+=w,T+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,L),T+=E,T=Object(x.c)(T,r,I,M)}function T(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function M(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.b)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(134),c=n(22),l=function(e,t){if(!e)throw new Error(t)},f=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t=0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(29),u=n(201),c=n(18),l={position:[0,0,0],lookAt:[0,0,0],up:[0,0,1],rotationX:0,rotationY:0,fov:50,near:1,far:100},f=function(){function e(t){r()(this,e);var n=t.width,i=t.height,a=t.position,o=void 0===a?l.position:a;Object(c.a)(Number.isFinite(n),"`width` must be supplied"),Object(c.a)(Number.isFinite(i),"`height` must be supplied"),this._viewportProps=this._applyConstraints(Object.assign({},t,{position:new s.a(o)}))}return o()(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getDirection",value:function(){return new u.a({bearing:this._viewportProps.bearing,pitch:this._viewportProps.pitch}).toVector3().normalize()}},{key:"getDirectionFromBearing",value:function(e){return new u.a({bearing:e,pitch:90}).toVector3().normalize()}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}()},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function i(e){for(var t=e.data,n=e.getIndex,i=e.dataRange,r=e.replace,a=i.startRow,o=void 0===a?0:a,s=i.endRow,u=void 0===s?1/0:s,c=t.length,l=c,f=c,h=0;hh&&d>=o&&(l=h),d>=u){f=h;break}}for(var v=l,g=f-l!==r.length,p=g&&t.slice(f),m=0;m=t.min)}},array:{validate:function(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function c(e){var t=l(e);return"object"===t?e?"type"in e?Object.assign({},e,u[e.type]):"value"in e?(t=l(e.value),Object.assign({type:t},e,u[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},u[t])}function l(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":Object(s.a)(e)}n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var f=function(){function e(t){var n=t.name,r=t.vs,a=t.fs,s=t.dependencies,u=void 0===s?[]:s,l=t.uniforms,f=t.getUniforms,h=t.deprecations,d=void 0===h?[]:h,v=t.defines,g=void 0===v?{}:v,p=t.vertexShader,m=t.fragmentShader;Object(i.a)(this,e),Object(o.a)("string"==typeof n),this.name=n,this.vs=r||p,this.fs=a||m,this.getModuleUniforms=f,this.dependencies=u,this.deprecations=this._parseDeprecationDefinitions(d),this.defines=g,l&&(this.uniforms=function(e){var t={};for(var n in e){var i=c(e[n]);t[n]=i}return t}(l))}return Object(r.a)(e,[{key:"getModuleSource",value:function(e,t){var n;switch(e){case"vs":n=a(this.vs||"",t,!0);break;case"fs":n=a(this.fs||"",t,!1);break;default:Object(o.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase(),"\n").concat(n,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,t){this.deprecations.forEach(function(n){n.regex.test(e)&&(n.deprecated?t.deprecated(n.old,n.new)():t.removed(n.old,n.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=this.uniforms;for(var i in n){var r=n[i];i in e&&!r.private?(r.validate&&Object(o.a)(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function h(e){if(!e.normalized&&(e.normalized=!0,e.uniforms&&!e.getUniforms)){var t=new f(e);e.getUniforms=t.getUniforms.bind(t)}return e}},function(e,t,n){"use strict";n.d(t,"b",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"a",function(){return g});var i=n(230),r=n.n(i);function a(e){if(e=e&&e.positions||e,!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new Error("invalid polygon")}function o(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(97),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return p}),n.d(t,"c",function(){return m});var i=n(5),r=n(10),a=n(9),o=n(11),s=n(4),u=n(29),c=n(67),l=[255,255,255],f=[0,0,1],h=[0,0,-1],d=[0,0,1],v=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e),this.id=t.id||Object(c.c)("light");var n=t.color,i=void 0===n?l:n;this.color=i;var r=t.intensity,a=void 0===r?1:r;this.intensity=a},g=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="ambient",e}return Object(o.a)(t,e),t}(v),p=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="directional";var i=n.direction,o=void 0===i?h:i;return e.direction=new u.a(o).normalize().toArray(),e}return Object(o.a)(t,e),t}(v),m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="point";var i=n.position,o=void 0===i?d:i;return e.position=o,e.attenuation=e._getAttenuation(n),e}return Object(o.a)(t,e),Object(i.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:f}}]),t}(v)},function(e,t,n){"use strict";var i,r=n(0),a=n(71),o=n(119);n.d(t,"a",function(){return u}),n.d(t,"c",function(){return h}),n.d(t,"b",function(){return d});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u="__LUMA_INJECT_DECLARATIONS__",c=/void main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,f=[];function h(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),f.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(65),r=n(24),a=n(25);function o(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var s={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(a.a)(t))},blendEquation:function(e,t){t=o(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(a.a)(t))},blendFunc:function(e,t){t=o(t)&&2===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,e.blendFuncSeparate.apply(e,Object(a.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(a.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(a.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(a.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(a.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(a.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(a.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=o(t)?t:[t,t],i=Object(r.a)(n,2),a=i[0],s=i[1];e.stencilMaskSeparate(1028,a),e.stencilMaskSeparate(1029,s)},stencilFunc:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilFuncSeparate(1028,s,u,c),e.stencilFuncSeparate(1029,l,f,h)},stencilOp:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilOpSeparate(1028,s,u,c),e.stencilOpSeparate(1029,l,f,h)},viewport:function(e,t){return e.viewport.apply(e,Object(a.a)(t))}};function u(e,t){for(var n in Object(i.f)(e,t),t){var r=s[n];r&&r(e,t[n],n)}}n.d(t,"a",function(){return u})},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(126),v=n(109),g=n(146),p=n(113),m=n(103),y=n(64),b=n(29),_=n(8),x=n.n(_),w=n(13),O=n.n(w),P=n(102),S=n(95),j=n(60),k=n(70),C=function(e){function t(e,n){var i,a,o;return r()(this,t),(o=u()(this,l()(t).call(this,e,n))).shadowMap=new d.a(e,{width:1,height:1,parameters:(i={},x()(i,10241,9729),x()(i,10240,9729),x()(i,10242,33071),x()(i,10243,33071),i)}),o.depthBuffer=new S.a(e,{format:33189,width:1,height:1}),o.fbo=new j.a(e,{id:"shadowmap",width:1,height:1,attachments:(a={},x()(a,36064,o.shadowMap),x()(a,36096,o.depthBuffer),a)}),o}return h()(t,e),o()(t,[{key:"render",value:function(e){var n=this,i=this.fbo;Object(k.a)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var r=e.viewports[0],a=r.width*n.props.pixelRatio,o=r.height*n.props.pixelRatio;a===i.width&&o===i.height||i.resize({width:a,height:o}),O()(l()(t.prototype),"render",n).call(n,Object.assign(e,{outputBuffer:i}))})}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,drawToShadowMap:!0,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{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)}}]),t}(P.a),E=n(163);n.d(t,"a",function(){return L});var A={color:[255,255,255],intensity:1},T=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],M=[0,0,0,200/255],L=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],n.shadowColor=M,n.shadowPasses=[],n.dummyShadowMaps=[],n.shadow=!1,e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n._applyDefaultLights(),n.directionalLights.some(function(e){return e.shadow})&&(n.shadow=!0,n._addShadowModule()),n}return h()(t,e),o()(t,[{key:"prepare",value:function(e,t){var n=t.layers,i=t.viewports,r=t.onViewportActive,a=t.views,o=t.pixelRatio;if(!this.shadow)return{};var s=this._createLightMatrix();0===this.shadowPasses.length&&this._createShadowPasses(e,o),0===this.dummyShadowMaps.length&&this._createDummyShadowMaps(e);for(var u=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.a)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new g.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(p.a)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(178).a),y=n(140);n.d(t,"a",function(){return b});var b=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(y.b)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=w(t),a=new m(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=w(t,r),s="".concat(n,"-").concat(a);return new m(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return _(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return x(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(16),r=n.n(i),a=n(31),o=n(136),s=n(37),u=n(40),c=n(27);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.n([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.m(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.overAlloc,i=void 0===n?2:n,a=t.poolSize,o=void 0===a?100:a;r()(this,e),this.overAlloc=i,this.poolSize=o,this._pool=[]}return o()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=void 0===i?1:i,a=n.type,o=n.padding,s=void 0===o?0:o,u=n.copy,c=void 0!==u&&u,l=a||e&&e.constructor||Float32Array,f=t*r+s;if(ArrayBuffer.isView(e)){if(f<=e.length)return e;if(f*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new l(e.buffer,0,f)}var h=this._allocate(l,f);return e&&c?h.set(e):h.fill(0,0,4),this._release(e),h}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,t){t=Math.max(Math.ceil(t*this.overAlloc),1);var n=this._pool,i=e.BYTES_PER_ELEMENT*t,r=n.findIndex(function(e){return e.byteLength>=i});return r>=0?new e(n.splice(r,1)[0],0,t):new e(t)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.poolSize&&t.shift()}}}]),e}();t.a=new s},function(e,t){function n(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise(function(r,a){var o=e.apply(t,i);function s(e){n(o,r,a,s,u,"next",e)}function u(e){n(o,r,a,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(32),c=n(24),l=n(55),f=n(27),h=n(20),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(200),p=n(47);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,O=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(f.l)(g);x=Math.max(.75,x);var S=Object(f.g)([d,l],P);S[2]=0;var j=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:O||1.01}),k=Object(f.f)({height:s,center:S,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:k,projectionMatrix:j}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=P,e.center=S,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,,function(e,t,n){"use strict";(function(e){var t=n(97),i=n(143);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return u({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},Object(a.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=s(t),r=o(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}}))},function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return l});var i=n(0),r=n(126),a=n(160),o=n(161),s=n(60),u=n(19);function c(e,t){Object(u.a)(e instanceof r.a||e instanceof a.a||e instanceof o.a);var n=e.constructor,i=e.gl,s=e.width,c=e.height,l=e.format,f=e.type,h=e.dataFormat,d=e.border,v=e.mipmaps;return new n(i,Object.assign({width:s,height:c,format:l,type:f,dataFormat:h,border:d,mipmaps:v},t))}function l(e,t){var n=e.gl,r=e.width,a=e.height,o=e.id;return new s.a(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(i.a)({},36064,e)}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(50),r=n.n(i),a=n(116),o=n(4),s=n(5),u=n(10),c=n(9),l=n(32),f=n(11),h=n(56),d=n(30),v=n(26),g=[34069,34070,34071,34072,34073,34074],p=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,t),Object(d.b)(e),(n=Object(u.a)(this,Object(c.a)(t).call(this,e,Object.assign({},i,{target:34067})))).initialize(i),Object.seal(Object(l.a)(n)),n}return Object(f.a)(t,e),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(a.a)(r.a.mark(function e(t){var n,i,a,o,s,u,c,l,f,h,d,p,m,y=this;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,a=t.pixels,o=t.data,s=t.border,u=void 0===s?0:s,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,p=a||o,e.next=5,Promise.all(g.map(function(e){var t=p[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:m=e.sent,this.bind(),g.forEach(function(e,t){m[t].length>1&&!1!==y.opts.mipmaps&&v.a.warn("".concat(y.id," has mipmap and multiple LODs."))(),m[t].forEach(function(t,r){n&&i?d.texImage2D(e,r,l,n,i,u,l,h,t):d.texImage2D(e,r,l,l,h,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(h.a);p.FACES=g},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(70),l=n(30),f=n(56),h=n(98),d=n(43),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.a)(e),s=Object.assign({depth:1},s,{target:32879,unpackFlipY:!1}),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(s.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,l=void 0===u?1:u,f=e.border,v=void 0===f?0:f,g=e.format,p=e.type,m=void 0===p?5121:p,y=e.offset,b=void 0===y?0:y,_=e.data,x=e.parameters,w=void 0===x?{}:x;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(c.a)(this.gl,w,function(){ArrayBuffer.isView(_)&&t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,_),_ instanceof d.a&&(t.gl.bindBuffer(35052,_.handle),t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,b))}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var O=h.a[this.dataFormat]||4,P=h.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*O*P,"Texture")}return this.loaded=!0,this}}]),t}(f.a)},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(77),r=n.n(i),a=n(16),o=n.n(a),s=n(132),u=n(42),c=n(64),l=n(29),f=n(94),h=n(27),d=Object(f.a)(function(e){var t=e.viewport,n=e.center;return new c.a(t.viewProjectionMatrix).invert().transformVector4(n)}),v=Object(f.a)(function(e){var t=e.viewport,n=e.shadowMatrices,i=[],a=t.pixelUnprojectionMatrix,s=[[0,0],[t.width,0],[0,t.height],[t.width,t.height],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(function(e){return function(e,t){var n=o()(e,3),i=n[0],r=n[1],a=n[2],s=Object(h.h)([i,r,a],t);if(Number.isFinite(a))return s;return[s[0],s[1],0]}(e,a)}),u=!0,f=!1,d=void 0;try{for(var v,g=function(){var e=v.value,n=e.clone().translate(new l.a(t.center).negate()),a=s.map(function(e){return n.transformVector3(e)}),o=(new c.a).ortho({left:Math.min.apply(Math,r()(a.map(function(e){return e[0]}))),right:Math.max.apply(Math,r()(a.map(function(e){return e[0]}))),bottom:Math.min.apply(Math,r()(a.map(function(e){return e[1]}))),top:Math.max.apply(Math,r()(a.map(function(e){return e[1]}))),near:Math.min.apply(Math,r()(a.map(function(e){return-e[2]}))),far:Math.max.apply(Math,r()(a.map(function(e){return-e[2]})))});i.push(o.multiplyRight(e))},p=n[Symbol.iterator]();!(u=(v=p.next()).done);u=!0)g()}catch(e){f=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(f)throw d}}return i});Object(s.b)("shadow",{hook:"vs:DECKGL_FILTER_GL_POSITION",injection:"\nposition = shadow_setVertexPosition(geometry.position);\n "}),Object(s.b)("shadow",{hook:"fs:DECKGL_FILTER_COLOR",injection:"\ncolor = shadow_filterShadowColor(color);\n "});var g=[0,0,0,1],p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];t.a={name:"shadow",dependencies:["project"],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap[max_lights];\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[i], shadow_uShadowMap[i]) * shadow_uColor.a / shadow_uLightCount;\n }\n }\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){var n={},i=e.shadowEnabled;return(void 0===i||i)&&e.shadowMatrices&&e.shadowMatrices.length>0?Object.assign(n,function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||g,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=d({viewport:e.viewport,center:t.project_uCenter}),r=[],a=v({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice(),o=0;o0?n["shadow_uShadowMap[".concat(f,"]")]=e.shadowMaps[f]:n["shadow_uShadowMap[".concat(f,"]")]=e.dummyShadowMaps[0];return n}(e,t)):Object.assign(n,{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}),n}return{}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(165),g=n(172),p=function(e){function t(e){return r()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:v.a})))}return h()(t,e),o()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.a})}}]),t}(d.a);p.displayName="MapView"},function(e,t,n){"use strict";n.d(t,"a",function(){return O});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(87),p=n.n(g),m=n(45),y=n(27),b=n(200),_=n(47),x=n(18),w="Illegal argument to WebMercatorViewport",O=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,O=void 0!==w&&w,P=n.width,S=n.height,j=n.altitude,k=void 0===j?1.5:j;P=P||1,S=S||1,k=Math.max(.75,k);var C=Object(y.e)({width:P,height:S,pitch:d,altitude:k,nearZMultiplier:b,farZMultiplier:x}),E=C.fov,A=C.aspect,T=C.focalDistance,M=C.near,L=C.far,I=Object(y.f)({height:S,pitch:d,bearing:g,altitude:k}),R=Object.assign({},n,{width:P,height:S,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:O,fovyRadians:E,aspect:A,orthographicFocalDistance:T,near:M,far:L});return(e=l()(this,h()(t).call(this,R))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=k,e.orthographic=O,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);O.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(77),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(18),l=n(190),f=n(41),h=n.n(f),d=n(130),v=n(99),g=n(15),p=n(75),m=n(267),y=n(45),b=n(69),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,mousePosition:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l.a({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(83),p=n(137),m=n(22),y=n(29);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(83),v=n(129),g=n(81),p=n(82),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(16),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(13),v=n.n(d),g=n(7),p=n.n(g),m=n(43),y=n(18),b=n(72),_=n(75),x=[],w=[[0,1/0]];var O=n(15),P=n(127),S=n(104),j=n(59),k=n(67),C=n(26),E=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(k.c)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(P.b)(t,S.a.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a),this._setAccessor(e);for(var o=this.elementOffset,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({offset:n.offset,stride:n.stride,normalized:n.normalized},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,T,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"delete",value:function(){v()(h()(t.prototype),"delete",this).call(this),A.a.release(this.userData.allocatedValue)}},{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;if(t.update){Object(y.a)(Number.isFinite(e));var n=Math.max(e,1),i=L(this.type||5126),r=t.allocatedValue,a=t.updateRanges!==w;return this.constant=!1,this.value=A.a.allocate(r,n,{size:this.size,type:i,padding:this.elementOffset,copy:a}),this.buffer&&this.buffer.byteLength=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return n+e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(E);function L(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}var I=n(224);function R(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.a){var l=new Float32Array(r),f=t.getData({}),h=n.size,d=n.constant,v=d?n.getValue():n.getBuffer().getData({}),g=d?function(e,t){return c(v,t)}:function(e,t){return c(v.subarray(e,e+h),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.offset,a=void 0===r?0:r,o=e.getData,s=e.sourceLayout,u=e.targetLayout;if(!Array.isArray(u))return R({source:t,target:n,getData:o}),n;for(var c=a,l=a,f=o&&function(e,t){return o(e+l,t)},h=Math.min(s.length,u.length),d=0;d0),this.needsRedraw=!0;var n=Object.assign({},U,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return H});function G(){}var W={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;O.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;W.savedMessages=[],W.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;W.savedMessages&&W.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-W.timeStart),a="".concat(r,"ms");O.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=W.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;O.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}O.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),W.savedMessages=null}},H=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new V(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(W.onLog=t||G),void 0!==n&&(W.onUpdateStart=n||G),void 0!==i&&(W.onUpdate=i||G),void 0!==r&&(W.onUpdateEnd=r||G)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in W.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h]||t.attributes&&t.attributes[h])||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&W.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&O.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new M(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),O.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&W.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);W.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(192),b=n(93),_=n(229),x=n.n(_),w=n(15),O=n(67),P=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(O.c)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;w.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:j},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:j},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=r.extensionsChanged;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new P({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);w.layerName="ScatterplotLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(22),p=n(83),m=n(137),y=n(154),b=n(55),_=85.05113,x=-85.05113;var w=n(18),O=n(81),P=n(82);n.d(t,"a",function(){return A});var S={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new O.a,transitionInterruption:P.a.BREAK},j={transitionDuration:0},k={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},C={pitch:0,bearing:0,altitude:1.5},E=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?C.bearing:c,d=n.pitch,v=void 0===d?C.pitch:d,g=n.altitude,p=void 0===g?C.altitude:g,m=n.maxZoom,y=void 0===m?k.maxZoom:m,b=n.minZoom,_=void 0===b?k.minZoom:b,x=n.maxPitch,O=void 0===x?k.maxPitch:x,P=n.minPitch,S=void 0===P?k.minPitch:P,j=n.startPanLngLat,E=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,M=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:O,minPitch:S})))._interactiveState={startPanLngLat:j,startZoomLngLat:E,startBearing:A,startPitch:T,startZoom:M},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,E,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return S}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,j,{isDragging:!0,isRotating:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(15),u=n(6),c=n.n(u),l=n(3),f=n.n(l),h=n(13),d=n.n(h),v=n(7),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(102).a),m=n(182),y=n(183),b=n(150),_=n(60);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h,pixelRatio:this.pixelRatio}),m=this.lastPostProcessEffect?this.screenBuffer:_.a.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.a(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.a(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.a.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(34),r=n(175);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(89))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(34);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(89))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(127),f=n(104),h=n(30),d=n(19),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(h.d)(e),i=Object(l.c)(e,f.a.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Object(d.a)(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(s.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(22),u=n(18),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(35),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(102),p=n(70),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.a)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";function i(e){return e&&"undefined"!=typeof window?window.devicePixelRatio:1}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(47),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,r=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,r=void 0===n?16:n,a=t.size,o=void 0===a?1:a,s="[",u=0;u0&&(s+=",".concat(u%o==0?" ":"")),s+=i(e[u],t);var c=e.length>r?"...":"]";return"".concat(s).concat(c)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return r?"0":"0.";if(r)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var a=e.toPrecision(2);return a.indexOf(".0")===a.length-2?a.slice(0,-1):a}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var i=n(115),r="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var a={name:"gouraud-lighting",dependencies:[i.a],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:u},o={name:"phong-lighting",dependencies:[i.a],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:u},s={};function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor.map(function(e){return e/255}),t}(t):{lighting_uEnabled:!1}}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(4),r=n(5),a=n(61),o=n(197),s=n(19),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Object(s.a)(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new a.c(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new a.a(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Object(s.a)(this._compareContexts(e,this.gl)),Object(s.a)("string"==typeof t.vs),Object(s.a)("string"==typeof t.fs),Object(s.a)("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new o.a(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(36),r=n(4),a=n(10),o=n(9),s=n(11),u=n(58),c=n(67),l=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]),f=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]),h=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]),d=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]),v={POSITION:{size:3,value:new Float32Array(f)},NORMAL:{size:3,value:new Float32Array(h)},TEXCOORD_0:{size:2,value:new Float32Array(d)}},g=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.id,s=void 0===n?Object(c.c)("cube-geometry"):n;return Object(a.a)(this,Object(o.a)(t).call(this,Object(i.a)({},e,{id:s,indices:{size:1,value:new Uint16Array(l)},attributes:Object(i.a)({},v,e.attributes)})))}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(11),u=n(128),c={ambient:.35,diffuse:.6,shininess:32,specularColor:[30,30,30]},l=function(e){function t(e){var n;return Object(i.a)(this,t),n=Object(r.a)(this,Object(a.a)(t).call(this,e)),e=Object.assign({},c,e),Object.assign(Object(o.a)(n),e),n}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(130),p=n(15),m=n(75),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){h()(l()(t.prototype),"setState",this).call(this,e),this.setLayerNeedsUpdate()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?Object.assign(t,{object:n.__source.object,index:n.__source.index}):t}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerRow",value:function(e,t,n){return e.__source={parent:this,object:t,index:n},e}},{key:"getSubLayerAccessor",value:function(e){if("function"==typeof e){var t={data:this.props.data,target:[]};return function(n,i){return n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,i)}}return e}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,f=t.coordinateOrigin,h=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,g=t.extensions,p=t._subLayerProps,m={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:v,extensions:g};if(e){var y=p&&p[e.id],b=y&&y.updateTriggers;Object.assign(m,e,y,{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers,b)})}var _=!0,x=!1,w=void 0;try{for(var O,P=g[Symbol.iterator]();!(_=(O=P.next()).done);_=!0){var S=O.value,j=S.getSubLayerProps.call(this,S);Object.assign(m,j,{updateTriggers:Object.assign(m.updateTriggers,j.updateTriggers)})}}catch(e){x=!0,w=e}finally{try{_||null==P.return||P.return()}finally{if(x)throw w}}return m}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?p.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,p.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(g.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(166),l=n(18),f=n(105),h=n(53),d=n(45),v=n(15),g=n(75),p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return u()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i={x:e[0],y:e[1]},r=n.length-1;r>=0;--r){var a=n[r];if(a.containsPixel(i)){var o=e.slice();return o[0]-=a.x,o[1]-=a.y,a.unproject(o,t)}}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(l.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(g.b)(e,{filter:Boolean}).map(function(e){return e instanceof d.a?new h.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(f.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):v.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),m=n(164),y=n(149),b=new y.a,_=function(){function e(){o()(this,e),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return u()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(f.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e,this._createInternalEffects()}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=!0,o=!1,s=void 0;try{for(var u,c=this._internalEffects[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){u.value.cleanup()}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some(function(e){return e instanceof y.a})||this._internalEffects.push(b)}}]),e}(),x=n(103),w=n(173),O=n(60),P=n(80),S=n(183),j=n(182),k={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function C(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,h=-1,d=0,g=0;gf)d+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,h=d)}d+=4}}if(h>=0){var x=t[h+3]-1,w=t.slice(h,h+4),O=n[x];if(O){var P=O.decodePickingColor(w);return{pickedColor:w,pickedLayer:O,pickedObjectIndex:P}}v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return k}function E(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=A({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function A(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var T=function(){function e(t){o()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new j.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return u()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(S.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new O.a(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-(r+1)*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=A({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(l.a)(r),Object(l.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(l.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,u=r.y,c=r.width,f=r.height,h=new Uint8Array(c*f*4);return Object(P.e)(o,{sourceX:s,sourceY:u,sourceWidth:c,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight,o=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-o,c=Math.min(a,n+i+1)-s;return u<=0||c<=0?null:{x:o,y:s,width:u,height:c}}},{key:"callLayerPickingCallbacks",value:function(e,t){var n=[],i=this.pickingEvent;return e.forEach(function(e){if(e.layer){var r=!1;switch(t){case"hover":r=e.layer.onHover(e,i);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}}),n}}]),e}(),M=n(196),L=n(204),I=n(91),R=n(90),F=n(148),D=n(107),N=n(267),z=n(24),B=n(4),U=n(5),V=1,G=2,W=4,H={mousedown:V,mousemove:G,mouseup:W};var X,q,Z=null;"undefined"!=typeof document&&(Z=n(256),X=Z.PointerEventInput,q=X.prototype.handler,X.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&G&&0===e.which&&(t=W),this.pressed&&(t&W&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var Y=Z;var K=Y?[[Y.Rotate,{enable:!1}],[Y.Pinch,{enable:!1}],[Y.Swipe,{enable:!1}],[Y.Pan,{threshold:0,enable:!1}],[Y.Press,{enable:!1}],[Y.Tap,{event:"doubletap",taps:2,enable:!1}],[Y.Tap,{event:"anytap",enable:!1}],[Y.Tap,{enable:!1}]]:null,Q={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},J={doubletap:["tap"]},$={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ee=["keydown","keyup"],te=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],ne=["wheel","mousewheel","DOMMouseScroll"],ie={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",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"},re={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ae=n(120),oe=-1!==ae.b.indexOf("firefox"),se=ne,ue=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=se.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!ae.a&&{passive:!1})})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;ae.c.WheelEvent&&(oe&&e.deltaMode===ae.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=ae.c.devicePixelRatio),e.deltaMode===ae.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ce=te,le=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=ce.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),fe=ee,he=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=fe.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),de=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(U.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ve=1,ge=2,pe=4,me={pointerdown:ve,pointermove:ge,pointerup:pe,mousedown:ve,mousemove:ge,mouseup:pe},ye=1,be=2,_e=3,xe=0,we=1,Oe=2,Pe=1,Se=2,je=4;var ke=function(){function e(t){Object(B.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(U.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(B.a)(this,e),this.options=Object.assign({},Ce,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(U.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||K}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(Q).forEach(function(e){var n=t.manager.get(e);n&&Q[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new ue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new le(e,this._onOtherEvent,{enable:!1}),this.keyInput=new he(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new de(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(z.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=J[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=re[e]||e,o=r.get(a);o||(o=new ke(this),r.set(a,o),o.recognizerName=ie[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=re[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=$[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),Ae=n(31);function Te(){}n.d(t,"a",function(){return Le});var Me={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:Te,onResize:Te,onViewStateChange:Te,onBeforeRender:Te,onAfterRender:Te,onLoad:Te,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Le=function(){function e(t){o()(this,e),t=Object.assign({},Me,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),function(){if(void 0===("undefined"==typeof window?"undefined":r()(window)))return!1;return-1!==((window.navigator||{}).userAgent||"").indexOf("Trident/")}()&&v.a.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new N.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return u()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&v.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&v.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(l.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new L.a({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(I.a)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new m.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.callback=this.props.onHover,t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(R.a)(e,{enable:!0,copyState:!0})),Object(F.a)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new Ee(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Ae.b)this.eventManager.on(t,this._onEvent);this.viewManager=new p({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(l.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new c.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new _,this.deckRenderer=new w.a(e),this.deckPicker=new T(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(F.a)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),v.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=Ae.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){var e=this.stats;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();var t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var e=this.metrics,t=this.stats;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();var n=D.a.get("Memory Usage");e.bufferMemory=n.get("Buffer Memory").count,e.textureMemory=n.get("Texture Memory").count,e.renderbufferMemory=n.get("Renderbuffer Memory").count,e.gpuMemory=n.get("GPU Memory").count}}]),e}();Le.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(x.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Le.defaultProps=Me,Le.VERSION=M.a.VERSION},function(e,t,n){"use strict";var i=n(109),r=n(132),a=n(205),o=n(189),s=n(206),u={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n} geometry;\n",fs:"\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n"},c=n(84),l={name:"project32",dependencies:[c.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"};function f(){Object(i.c)([a.a,c.a,l,o.a,o.b,s.a]),Object(i.e)([u,c.a]),Object(r.c)("vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)"),Object(r.c)("fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"),Object(r.b)("picking",{hook:"fs:DECKGL_FILTER_COLOR",order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n"})}n.d(t,"a",function(){return f})},function(e,t,n){"use strict";var i=n(117),r=n(122),a=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],o={name:"Images",extensions:a,parse:r.a&&r.d,loadAndParse:!r.a&&r.b},s=(r.e,r.c,n(108)),u=n(15);var c={name:"JSON",extensions:["json","geojson"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},l=n(195),f="7.2.0-beta.3";if(s.a.deck&&s.a.deck.VERSION!==f)throw new Error("deck.gl - multiple versions detected: ".concat(s.a.deck.VERSION," vs ").concat(f));s.a.deck||(u.a.log(0,"deck.gl ".concat(f," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),s.a.deck=s.a.deck||{VERSION:f,version:f,log:u.a},Object(i.b)([c,[o,{imageOrientation:"flipY"}]]),Object(l.a)());t.a=s.a.deck},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(32),s=n(9),u=n(66),c=n(11),l=n(52),f=n(56),h=n(60),d=n(74),v=n(61),g=n(59),p=n(30),m=n(73),y=function(){function e(t){Object(i.a)(this,e),this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}return Object(r.a)(e,[{key:"getAttributeInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var t=this.getAttributeInfo(e);return t?t.location:-1}},{key:"getAttributeAccessor",value:function(e){var t=this.getAttributeInfo(e);return t?t.accessor:null}},{key:"getVaryingInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var t=this.getVaryingInfo();return t?t.location:-1}},{key:"getVaryingAccessor",value:function(e){var t=this.getVaryingInfo();return t?t.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var t=e.gl,n=t.getProgramParameter(e.handle,35721),i=0;i=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(Object(p.d)(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(s.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",P),n._isCached=!1,n.initialize(r),Object.seal(Object(o.a)(n)),n._setId(r.id),n}return Object(c.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new v.c(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new v.a(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,Object(x.a)(this.vs instanceof v.c),Object(x.a)(this.fs instanceof v.a),this.uniforms={},i&&(Object(p.a)(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new y(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,f=void 0!==l&&l,h=e.indexType,d=void 0===h?5123:h,v=e.isInstanced,g=void 0!==v&&v,y=e.instanceCount,O=void 0===y?0:y,P=e.vertexArray,S=void 0===P?null:P,j=e.transformFeedback,k=e.framebuffer,C=e.parameters,E=void 0===C?{}:C,A=e.uniforms,T=e.samplers;if((A||T)&&(w.a.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(A||{})),void 0!==n){var M=k?k.id:"default",L="mode=".concat(Object(_.a)(this.gl,r)," verts=").concat(a," ")+"instances=".concat(O," indexType=").concat(Object(_.a)(this.gl,d)," ")+"isInstanced=".concat(g," isIndexed=").concat(f," ")+"Framebuffer=".concat(M);w.a.log(n,L)()}return Object(x.a)(S),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(S.bindForDraw(a,O,function(){if(void 0!==k&&(E=Object.assign({},E,{framebuffer:k})),j){var e=Object(m.c)(r);j.begin(e)}t._bindTextures(),Object(b.a)(t.gl,E,function(){f&&g?t.gl.drawElementsInstanced(r,a,d,s,O):f&&Object(p.d)(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):f?t.gl.drawElements(r,a,d,s):g?t.gl.drawArraysInstanced(r,s,a,O):t.gl.drawArrays(r,s,a)}),j&&j.end()}),!0)}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=!1,i={};for(var r in e)Object(d.a)(this.uniforms[r],e[r])||(n=!0,i[r]=e[r],this.uniforms[r]=Object(d.c)(e[r]));return n&&(t(),Object(d.b)(i,this.id,this._uniformSetters),this._setUniforms(i)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof h.a)i=i.texture;if(i instanceof f.a)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof h.a&&(n=n.texture),n instanceof f.a)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof h.a&&(n=n.texture),n instanceof f.a){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new v.c({handle:u});break;case 35632:n.fs=new v.a({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Object(O.c)(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),w.a.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),w.a.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||w.a.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1)for(var s=0;s0&&w[1]>0);var O=w[0]/x[0],P=w[1]/x[1],S=(u.right-u.left)/2/O,j=(u.bottom-u.top)/2/P,k=[(_[0]+b[0])/2+S,(_[1]+b[1])/2+j],C=y.unproject(k),E=y.zoom+Math.log2(Math.abs(Math.min(O,P)));return{longitude:C[0],latitude:C[1],zoom:E}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(24),r=n(4),a=n(5),o=n(22),s=n(29),u=n(40),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.g(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(43),f=n(30),h=n(67),d=n(26),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(f.a)(e),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(f.d)(e)}}]),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(h.a)(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,d.a.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof l.a==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(4),r=n(5),a=n(59),o=n(43),s=n(106),u=n(235),c=n(26),l=n(19),f=/^(.+)__LOCATION_([0-9]+)$/,h=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=s.a.isSupported(t)?new s.a(t):s.a.getDefaultArray(t),Object(u.a)(this,"VertexArray","v6.0",h),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new o.a(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof o.a){var a=n;if(r){var s=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,s)}else{var u=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,u)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c.a.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(34),r=n(50),a=n.n(r),o=n(116),s=n(4),u=n(5),c=n(91),l=n(107),f=n(125),h=n(177),d=n(135),v=n(30),g=n(65),p=n(60),m=n(26),y=n(19),b=0,_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e);var n=t.onCreateContext,i=void 0===n?function(e){return Object(c.a)(e)}:n,r=t.onAddHTML,a=void 0===r?null:r,o=t.onInitialize,u=void 0===o?function(){}:o,f=t.onRender,h=void 0===f?function(){}:f,d=t.onFinalize,v=void 0===d?function(){}:d,g=t.gl,p=void 0===g?null:g,y=t.glOptions,_=void 0===y?{}:y,x=t.debug,w=void 0!==x&&x,O=t.createFramebuffer,P=void 0!==O&&O,S=t.autoResizeViewport,j=void 0===S||S,k=t.autoResizeDrawingBuffer,C=void 0===k||k,E=t.stats,A=void 0===E?l.a.get("animation-loop-".concat(b++)):E,T=t.useDevicePixels,M=void 0===T||T;"useDevicePixelRatio"in t&&(m.a.deprecated("useDevicePixelRatio","useDevicePixels")(),M=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:a,onInitialize:u,onRender:h,onFinalize:v,gl:p,glOptions:_,debug:w,createFramebuffer:P},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=A,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:j,autoResizeDrawingBuffer:C,useDevicePixels:M}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(u.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Object(y.a)("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,Object(f.b)().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=h.a.isSupported(e.gl,["timers"])?new h.a(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),Object(d.a)(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(o.a)(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return m.a.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;Object(d.a)(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||Object(d.b)(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(i.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Object(c.c)(this.props.gl,e):this.onCreateContext(e),!Object(v.c)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(g.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Object(c.d)(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new p.a(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()&&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}}]),e}()},function(e,t,n){"use strict";t.a={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}},function(e,t,n){"use strict";var i={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};t.a={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}}},function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(0),r=n(43),a=n(68),o=n(73),s=n(187);function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=c(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),f=t.accessors[s.location];f&&(u="".concat(o,": ").concat(l(s.name,f))),r[u]=c(t,a[o],f,i)}}return r}function c(e,t,n,o){var u,c,l,f,h=e.gl,d="NOT PROVIDED",v="N/A",g="N/A",p="N/A";if(n&&(d=n.type,v=n.size,c=-1!==(d=String(d).replace("Array","")).indexOf("nt")),t instanceof r.a){var m,y,b=t,_=b.getDebugData(),x=_.data;if(l=_.modified?"*":"",f=x,g=(p=b.byteLength)/x.BYTES_PER_ELEMENT/v,n){var w=n.divisor>0;y="".concat(w?"I ":"P "," ").concat(g," (x").concat(v,"=").concat(p," bytes ").concat(Object(a.a)(h,d),")")}else c=!0,y="".concat(p," bytes");return m={},Object(i.a)(m,o,"".concat(l).concat(Object(s.a)(f,{size:v,isInteger:c}))),Object(i.a)(m,"Format ",y),m}return f=t,v=t.length,c=-1!==(d=String(t.constructor.name).replace("Array","")).indexOf("nt"),u={},Object(i.a)(u,o,"".concat(Object(s.a)(f,{size:v,isInteger:c})," (constant)")),Object(i.a)(u,"Format ","".concat(v,"x").concat(d," (constant)")),u}function l(e,t){var n=t.type,i=t.size,r=Object(o.b)(n,i);return r?"".concat(e," (").concat(r.name,")"):e}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(0),r=n(19),a=n(187);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,o=e.program,u=e.uniforms,c=e.undefinedOnly,l=void 0!==c&&c;Object(r.a)(o);var f=o._uniformSetters,h={},d=Object.keys(f).sort(),v=0,g=!0,p=!1,m=void 0;try{for(var y,b=d[Symbol.iterator]();!(g=(y=b.next()).done);g=!0){var _=y.value;_.match(".*_.*")||_.match(".*Matrix")||s({table:h,header:n,uniforms:u,uniformName:_,undefinedOnly:l})&&v++}}catch(e){p=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(p)throw m}}var x=!0,w=!1,O=void 0;try{for(var P,S=d[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;j.match(".*Matrix")&&s({table:h,header:n,uniforms:u,uniformName:j,undefinedOnly:l})&&v++}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}var k=!0,C=!1,E=void 0;try{for(var A,T=d[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h[M]||s({table:h,header:n,uniforms:u,uniformName:M,undefinedOnly:l})&&v++}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}var L=0,I={};if(!l)for(var R in u){var F=u[R];h[R]||(L++,I[R]=Object(i.a)({Type:"NOT USED: ".concat(F)},n,Object(a.a)(F)))}return{table:h,count:v,unusedTable:I,unusedCount:L}}function s(e){var t,n=e.table,r=e.header,o=e.uniforms,s=e.uniformName,u=e.undefinedOnly,c=o[s],l=function(e){return null!=e}(c);return(!u||!l)&&(n[s]=(t={},Object(i.a)(t,r,l?Object(a.a)(c):"N/A"),Object(i.a)(t,"Uniform Type",l?c:"NOT PROVIDED"),t),!0)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(0),r=n(73);function a(e){var t={},n="Accessors for ".concat(e.id),r=!0,a=!1,s=void 0;try{for(var u,c=e.attributeInfos[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var l=u.value;if(l){var f=o(l);t["in ".concat(f)]=Object(i.a)({},n,JSON.stringify(l.accessor))}}}catch(e){a=!0,s=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw s}}var h=!0,d=!1,v=void 0;try{for(var g,p=e.varyingInfos[Symbol.iterator]();!(h=(g=p.next()).done);h=!0){var m=g.value;if(m){var y=o(m);t["out ".concat(y)]=Object(i.a)({},n,JSON.stringify(m.accessor))}}}catch(e){d=!0,v=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw v}}return t}function o(e){var t=e.accessor,n=t.type,i=t.size,a=Object(r.b)(n,i);return a?"".concat(a.name," ").concat(e.name):e.name}},function(e,t,n){"use strict";function i(e){var t=100,n=e.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(25),r=n(4),a=n(5),o=n(10),s=n(9),u=n(66),c=n(11),l=n(64),f=n(26),h=n(92),d=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var i=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===i?[]:i;return f.a.assert(a.every(function(e){return e instanceof h.a}),"every child must an instance of ScenegraphNode"),(e=Object(o.a)(this,Object(s.a)(t).call(this,n))).children=a,e}return Object(c.a)(t,e),Object(a.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new l.a:n,r=new l.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;f instanceof t?f.traverse(e,{worldMatrix:r}):e(f,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return f.a.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(h.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(66),u=n(11),c=n(93),l=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof c.a?(n.model=e,n._setModelNodeProps(r)):n.model=new c.a(e,r),n.managedResources=r.managedResources||[],n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return Object(s.a)(Object(o.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(n(92).a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(201),p=n(64),m=n(167);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(1),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(129),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,O=e.zoom,P=void 0===O?0:O;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:P}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(1),u=n.n(s),c=n(6),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(168),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(191),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.a}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(170).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(192),v=n(72),g=n(193),p=n(131),m=n(114),y=n(141),b=n(139),_=new d.a,x={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags),i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(i&&Array.isArray(n.dataChanged)){var r=this.state.paths.slice(),a=n.dataChanged.map(function(e){return Object(b.a)({data:r,getIndex:function(e){return e.__source.index},dataRange:e,replace:t._getPaths(e)})});this.setState({paths:r,pathsDiff:a})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.data,i=t.getPolygon,r=[],a="XY"===t.positionFormat?2:3,o=e.startRow,s=e.endRow,u=Object(v.a)(n,o,s),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var g,p=c[Symbol.iterator]();!(f=(g=p.next()).done);f=!0){var m=g.value;l.index++;var b=y.c(i(m,l),a),_=b.positions,x=b.holeIndices;if(x)for(var w=0;w<=x.length;w++){var O=_.subarray(x[w-1]||0,x[w]||_.length);r.push(this.getSubLayerRow({path:O},m,l.index))}else r.push(this.getSubLayerRow({path:_},m,l.index))}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}return r}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e._dataDiff,i=e.stroked,r=e.filled,a=e.extruded,o=e.wireframe,s=e.elevationScale,u=e.transitions,c=e.positionFormat,l=this.props,f=l.lineWidthUnits,h=l.lineWidthScale,d=l.lineWidthMinPixels,v=l.lineWidthMaxPixels,g=l.lineJointRounded,y=l.lineMiterLimit,b=l.lineDashJustified,_=this.props,x=_.getFillColor,w=_.getLineColor,O=_.getLineWidth,P=_.getLineDashArray,S=_.getElevation,j=_.getPolygon,k=_.updateTriggers,C=_.material,E=this.state,A=E.paths,T=E.pathsDiff,M=this.getSubLayerClass("fill",p.a),L=this.getSubLayerClass("stroke",m.a),I=this.shouldRenderSubLayer("fill",A)&&new M({_dataDiff:n,extruded:a,elevationScale:s,filled:r,wireframe:o,getElevation:S,getFillColor:x,getLineColor:w,material:C,transitions:u},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:k.getPolygon,getElevation:k.getElevation,getFillColor:k.getFillColor,getLineColor:k.getLineColor}}),{data:t,positionFormat:c,getPolygon:j});return[!a&&I,!a&&i&&this.shouldRenderSubLayer("stroke",A)&&new L({_dataDiff:T&&function(){return T},widthUnits:f,widthScale:h,widthMinPixels:d,widthMaxPixels:v,rounded:g,miterLimit:y,dashJustified:b,transitions:u&&{getWidth:u.getLineWidth,getColor:u.getLineColor,getPath:u.getPolygon},getColor:this.getSubLayerAccessor(w),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:k.getLineWidth,getColor:k.getLineColor,getDashArray:k.getLineDashArray}}),{data:A,positionFormat:c,getPath:function(e){return e.path}}),a&&I]}}]),t}(g.a);w.layerName="PolygonLayer",w.defaultProps=x},function(e,t,n){"use strict";var i="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",r={name:"project2",vs:i,fs:i},a=n(115);t.a={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[r,a.a]}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var r="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",a="".concat(r,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),o={ONE:1};t.a={name:"fp64",vs:a,fs:null,fp64ify:i,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var a=4*n+r;i(e[4*r+n],t,2*a)}return t},getUniforms:function(){return Object.assign({},o)}},"".concat(r)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(93),b=n(58);n.d(t,"a",function(){return w});var _=[0,0,0,255],x={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:_},getTargetColor:{type:"accessor",value:_},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n vec2 source = project_position(geometry.worldPosition, instancePositions64Low.xy).xy;\n vec2 target = project_position(geometry.worldPositionAlt, instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:_},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:_},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]);var O=u(x,d);c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);w.layerName="ArcLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(93),b=n(58);n.d(t,"a",function(){return x});var _={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.), target_commonspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),O=u(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]),c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);x.layerName="LineLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(193),v=n(171),g=n(114),p=n(192),m=n(131),y=n(139),b=n(15);function _(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},r=n.startRow,a=void 0===r?0:r,o=n.endRow,s=void 0===o?e.length:o,u=a;u0;)t=t[0];return t&&Number.isFinite(t[0])}(a,o))switch(a){case"Point":s.push(n({geometry:e},i,r));break;case"MultiPoint":o.forEach(function(e){s.push(n({geometry:{type:"Point",coordinates:e}},i,r))});break;case"LineString":u.push(n({geometry:e},i,r));break;case"MultiLineString":o.forEach(function(e){u.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"Polygon":c.push(n({geometry:e},i,r)),o.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"MultiPolygon":o.forEach(function(e){c.push(n({geometry:{type:"Polygon",coordinates:e}},i,r)),e.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))})})}else b.a.warn("".concat(a," coordinates are malformed"))()}var w={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return j});var O=new p.a,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:O};function S(e){return e.geometry.coordinates}var j=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){var t=e.props,n=e.changeFlags;if(n.dataChanged){var i=function(e){if(Array.isArray(e))return e;switch(b.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return b.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data),r=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var a=this.state.features,o={},s={};for(var u in a)o[u]=a[u].slice(),s[u]=[];var c=!0,l=!1,f=void 0;try{for(var h,d=n.dataChanged[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value,g=_(i,r,v);for(var p in a)s[p].push(Object(y.a)({data:o[p],getIndex:function(e){return e.__source.index},dataRange:v,replace:g[p]}))}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}this.setState({features:o,featuresDiff:s})}else this.setState({features:_(i,r),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var e=this.state,t=e.features,n=e.featuresDiff,i=t.pointFeatures,r=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures,s=this.props,u=s.stroked,c=s.filled,l=s.extruded,f=s.wireframe,h=s.material,d=s.transitions,p=this.props,y=p.lineWidthUnits,b=p.lineWidthScale,_=p.lineWidthMinPixels,x=p.lineWidthMaxPixels,w=p.lineJointRounded,O=p.lineMiterLimit,P=p.pointRadiusScale,j=p.pointRadiusMinPixels,k=p.pointRadiusMaxPixels,C=p.elevationScale,E=p.lineDashJustified,A=this.props,T=A.getLineColor,M=A.getFillColor,L=A.getRadius,I=A.getLineWidth,R=A.getLineDashArray,F=A.getElevation,D=A.updateTriggers,N=this.getSubLayerClass("polygons-fill",m.a),z=this.getSubLayerClass("polygons-stroke",g.a),B=this.getSubLayerClass("line-strings",g.a),U=this.getSubLayerClass("points",v.a),V=this.shouldRenderSubLayer("polygons-fill",a)&&new N({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:l,elevationScale:C,filled:c,wireframe:f,material:h,getElevation:this.getSubLayerAccessor(F),getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),transitions:d&&{getPolygon:d.geometry,getElevation:d.getElevation,getFillColor:d.getFillColor,getLineColor:d.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:D.getElevation,getFillColor:D.getFillColor,getLineColor:D.getLineColor}}),{data:a,getPolygon:S});return[!l&&V,!l&&u&&this.shouldRenderSubLayer("polygons-stroke",o)&&new z({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:o,getPath:S}),this.shouldRenderSubLayer("linestrings",r)&&new B({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:r,getPath:S}),this.shouldRenderSubLayer("points",i)&&new U({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:u,filled:c,radiusScale:P,radiusMinPixels:j,radiusMaxPixels:k,lineWidthUnits:y,lineWidthScale:b,lineWidthMinPixels:_,lineWidthMaxPixels:x,getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),getRadius:this.getSubLayerAccessor(L),getLineWidth:this.getSubLayerAccessor(I),transitions:d&&{getPosition:d.geometry,getFillColor:d.getFillColor,getLineColor:d.getLineColor,getRadius:d.getRadius,getLineWidth:d.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:D.getFillColor,getLineColor:D.getLineColor,getRadius:D.getRadius,getLineWidth:D.getLineWidth}}),{data:i,getPosition:S}),l&&V]}}]),t}(d.a);j.layerName="GeoJsonLayer",j.defaultProps=P},function(e,t,n){"use strict";var i,r=n(4),a=n(5),o=n(0),s=n(147),u=n(123),c=n(207),l=n(30),f=n(43),h=n(80),d=n(126),v=n(159),g=n(202),p=n(60),m=n(211),y=n(19),b=n(26),_=n(67),x=n(93),w="transform_uSampler_",O="transform_uSize_",P="transform_position";function S(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,c={},l=t,f={};if(a>0||i){var h=l.split("\n"),d=h.slice();if(h.forEach(function(e,t,r){if(a>0){var l=function(e,t){var n={},i=function(e){return Object(u.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(w).concat(e),n="".concat(O).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),c=s.samplerName,l=s.sizeName,f=s.uniformDeclerations,h=Object(u.e)(r),d=" ".concat(r," ").concat(a," = transform_getInput(").concat(c,", ").concat(l,").").concat(h,";\n");n[c]=a;var v={"vs:#decl":f,"vs:#main-start":d};return{updatedLine:o,inject:v,samplerTextureMap:n}}return null}(e,n);if(l){var h=l.updatedLine,v=l.inject;d[t]=h,f=Object(s.b)([f,v]),Object.assign(c,l.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(u.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Object(y.a)(r);var v="".concat(O).concat(i),g={"vs:#decl":"uniform vec2 ".concat(v,";\n"),"vs:#main-start":" vec2 ".concat(P," = transform_getPos(").concat(v,");\n gl_Position = vec4(").concat(P,", 0, 1.);\n")};f=Object(s.b)([f,g])}l=d.join("\n")}return{vs:l,targetTextureType:o,inject:f,samplerTextureMap:c}}n.d(t,"a",function(){return k});var j=(i={},Object(o.a)(i,10241,9728),Object(o.a)(i,10240,9728),Object(o.a)(i,10242,33071),Object(o.a)(i,10243,33071),i),k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,e),Object(y.a)(Object(l.d)(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this.resources={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(a.a)(e,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(a.a)(e,[{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof f.a?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Object(y.a)(!n||n===this.targetTextureVarying);var o=Object(h.e)(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,c=Object(u.d)(this.targetTextureType),l=new s(o.length*c/4),f=0,d=0;d0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,s=this.framebuffers[this.currentIndex],Object(y.a)(s),r.viewport=[0,0,s.width,s.height],o&&s.clear({color:!0})),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){b.a.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Object(y.a)(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Object(y.a)(r[o]instanceof f.a||r[o].buffer instanceof f.a);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(j)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Object(y.a)(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(b.a.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(b.a.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,h=e._swapTexture;for(var v in Object(y.a)(a&&(s||n||c)&&o),t||{})Object(y.a)(t[v]instanceof f.a||t[v].buffer instanceof f.a);for(var g in u||{})Object(y.a)(u[g]instanceof d.a);return Object(y.a)(!c||l),Object(y.a)(!h||u[h]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n,0);Object(y.a)(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e,t){var n;if(e instanceof d.a)return e;var i=this.sourceTextures[0][e];if(!i)return null;this._targetRefTexName=e;var r=Object(v.a)(i,{parameters:(n={},Object(o.a)(n,10241,9728),Object(o.a)(n,10240,9728),Object(o.a)(n,10242,33071),Object(o.a)(n,10243,33071),n),pixelStore:Object(o.a)({},37440,!1)}),a="target-texture-".concat(t);return this.resources[a]&&this.resources[a].delete(),this.resources[a]=r,r}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=this._createNewBuffer(r,{byteLength:o,usage:s,accessor:u});this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new f.a(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=n,n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Object(y.a)(this.feedbackBuffers[t][i]instanceof f.a))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new x.a(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){Object(_.a)(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=this._createNewBuffer("elementIDBuffer",{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,l=Object(s.b)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:e._fs||Object(u.b)({version:Object(m.a)(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[c.a].concat(e.modules||[]):e.modules,uniforms:i,inject:l,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return S({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}()},function(e,t,n){"use strict";(function(e){var i=n(34);t.a="undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==Object(i.a)(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(89))},function(e,t,n){var i=n(255);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){e.exports=function(e){var t;if("function"==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(38),a=n.n(r),o=n(121);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(89))},function(e,t,n){var i=n(8);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===S(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(O(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),O(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),O(i),O(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details - */r=[],void 0===(a="function"==typeof(i=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},i={};function r(e,t){var r,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=i[e])?a:(r=o(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(a=n[e])?a:(r=o(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:v;if(t){if(e<0)return g;if(e>=f)return _}else{if(e<=-h)return x;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,n,i){return new e(t,n,i)}e.fromInt=r,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(s(n,8)),o=v,c=0;c>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(p)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,v=0;return d+=(v+=a+(65535&e.low))>>>16,h+=(d+=r+l)>>>16,f+=(h+=i+u)>>>16,f+=n+s,o((d&=65535)<<16|(v&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(t(e)||(e=c(e)),e.isZero())return v;if(this.eq(x))return e.isOdd()?x:v;if(e.eq(x))return this.isOdd()?x:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,y=0;return m+=(y+=s*h)>>>16,p+=(m+=r*h)>>>16,m&=65535,p+=(m+=s*f)>>>16,g+=(p+=i*h)>>>16,p&=65535,g+=(p+=r*f)>>>16,p&=65535,g+=(p+=s*l)>>>16,g+=n*h+i*f+r*l+s*u,o((m&=65535)<<16|(y&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:v;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;r=g}else{if(this.eq(x))return e.eq(p)||e.eq(y)?x:e.eq(x)?p:(n=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?p:y:(i=this.sub(e.mul(n)),r=n.add(i.div(e)));if(e.eq(x))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=v}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(n),f=l.mul(e);f.isNegative()||f.gt(i);)f=(l=a(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=p),r=r.add(l),i=i.sub(f)}return r},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;return e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?i.apply(t,r):i)||(e.exports=a)},function(e,t,n){"use strict";function i(e){for(var t in e)return!1;return!0}function r(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(26);function r(e,t,n){var r=n.removedProps,a=void 0===r?{}:r,o=n.deprecatedProps,s=void 0===o?{}:o,u=n.replacedProps,c=void 0===u?{}:u;for(var l in a)if(l in t){var f=a[l]?"".concat(e,".").concat(a[l]):"N/A";i.a.removed("".concat(e,".").concat(l),f)()}for(var h in s)if(h in t){var d=s[h];i.a.deprecated("".concat(e,".").concat(h),"".concat(e,".").concat(d))()}var v=null;for(var g in c)if(g in t){var p=c[g];i.a.deprecated("".concat(e,".").concat(g),"".concat(e,".").concat(p))(),(v=v||Object.assign({},t))[p]=t[g],delete v[g]}return v||t}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(26);function r(e,t,n,r){var a="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),o=Object.getPrototypeOf(e);r.forEach(function(e){o.methodName||(o[e]=function(){throw i.a.removed("Calling removed method ".concat(t,".").concat(e,": "),a)(),new Error(e)})})}},function(e,t,n){"use strict";var i=n(34),r=n(25),a=n(0),o=n(4),s=n(5),u=n(96);var c=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var f={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(e){return"string"==typeof e?f[e.toUpperCase()]||f.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(86);n.d(t,"a",function(){return b});var g={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!1,priority:0};function m(){}var y={};var b=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(243)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var f=new Image;return f.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(f,i,o)))},f.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=h(a),r="[".concat(a,"m").concat(r,"")),o&&(a=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();b.VERSION=u.a},function(e,t,n){const i=n(242);Object.assign(i,n(79),n(261),n(263),n(266),n(262),n(265),n(264)),e.exports=i},,,,,function(e,t,n){(function(t){const i=n(17),r=n(21),a=n(258).default,o="undefined"==typeof window?t:window;o.deck=o.deck||{},o.luma=o.luma||{},Object.assign(o.deck,r,{DeckGL:a}),Object.assign(o.luma,i),e.exports=o.deck}).call(this,n(78))},function(e,t){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var i=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(246),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=_;var f="suspendedStart",h="suspendedYield",d="executing",v="completed",g={},p={};p[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==i&&r.call(y,o)&&(p=y);var b=P.prototype=w.prototype=Object.create(p);O.prototype=b.constructor=P,P.constructor=O,P[u]=O.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===O||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,P):(e.__proto__=P,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},S(j.prototype),j.prototype[s]=function(){return this},l.AsyncIterator=j,l.async=function(e,t,n,i){var r=new j(_(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},S(b),b[u]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=T,A.prototype={constructor:A,reset:function(e){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(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:T(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function _(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new A(i||[]);return a._invoke=function(e,t,n){var i=f;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return M()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function O(){}function P(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function j(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function k(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,k(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; + */r=[],void 0===(a="function"==typeof(i=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},i={};function r(e,t){var r,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=i[e])?a:(r=o(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(a=n[e])?a:(r=o(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:v;if(t){if(e<0)return g;if(e>=f)return _}else{if(e<=-h)return x;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,n,i){return new e(t,n,i)}e.fromInt=r,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(s(n,8)),o=v,c=0;c>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(p)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,v=0;return d+=(v+=a+(65535&e.low))>>>16,h+=(d+=r+l)>>>16,f+=(h+=i+u)>>>16,f+=n+s,o((d&=65535)<<16|(v&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(t(e)||(e=c(e)),e.isZero())return v;if(this.eq(x))return e.isOdd()?x:v;if(e.eq(x))return this.isOdd()?x:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,y=0;return m+=(y+=s*h)>>>16,p+=(m+=r*h)>>>16,m&=65535,p+=(m+=s*f)>>>16,g+=(p+=i*h)>>>16,p&=65535,g+=(p+=r*f)>>>16,p&=65535,g+=(p+=s*l)>>>16,g+=n*h+i*f+r*l+s*u,o((m&=65535)<<16|(y&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:v;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;r=g}else{if(this.eq(x))return e.eq(p)||e.eq(y)?x:e.eq(x)?p:(n=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?p:y:(i=this.sub(e.mul(n)),r=n.add(i.div(e)));if(e.eq(x))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=v}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(n),f=l.mul(e);f.isNegative()||f.gt(i);)f=(l=a(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=p),r=r.add(l),i=i.sub(f)}return r},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;return e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?i.apply(t,r):i)||(e.exports=a)},function(e,t,n){"use strict";function i(e){for(var t in e)return!1;return!0}function r(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(26);function r(e,t,n){var r=n.removedProps,a=void 0===r?{}:r,o=n.deprecatedProps,s=void 0===o?{}:o,u=n.replacedProps,c=void 0===u?{}:u;for(var l in a)if(l in t){var f=a[l]?"".concat(e,".").concat(a[l]):"N/A";i.a.removed("".concat(e,".").concat(l),f)()}for(var h in s)if(h in t){var d=s[h];i.a.deprecated("".concat(e,".").concat(h),"".concat(e,".").concat(d))()}var v=null;for(var g in c)if(g in t){var p=c[g];i.a.deprecated("".concat(e,".").concat(g),"".concat(e,".").concat(p))(),(v=v||Object.assign({},t))[p]=t[g],delete v[g]}return v||t}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(26);function r(e,t,n,r){var a="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),o=Object.getPrototypeOf(e);r.forEach(function(e){o.methodName||(o[e]=function(){throw i.a.removed("Calling removed method ".concat(t,".").concat(e,": "),a)(),new Error(e)})})}},function(e,t,n){"use strict";var i=n(34),r=n(25),a=n(0),o=n(4),s=n(5),u=n(96);var c=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var f={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(e){return"string"==typeof e?f[e.toUpperCase()]||f.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(86);n.d(t,"a",function(){return b});var g={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!1,priority:0};function m(){}var y={};var b=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(243)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var f=new Image;return f.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(f,i,o)))},f.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=h(a),r="[".concat(a,"m").concat(r,"")),o&&(a=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();b.VERSION=u.a},function(e,t,n){const i=n(242);Object.assign(i,n(79),n(261),n(263),n(265),n(262),n(266),n(264)),e.exports=i},,,,,function(e,t,n){(function(t){const i=n(17),r=n(21),a=n(258).default,o="undefined"==typeof window?t:window;o.deck=o.deck||{},o.luma=o.luma||{},Object.assign(o.deck,r,{DeckGL:a}),Object.assign(o.luma,i),e.exports=o.deck}).call(this,n(78))},function(e,t){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var i=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(246),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=_;var f="suspendedStart",h="suspendedYield",d="executing",v="completed",g={},p={};p[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==i&&r.call(y,o)&&(p=y);var b=P.prototype=w.prototype=Object.create(p);O.prototype=b.constructor=P,P.constructor=O,P[u]=O.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===O||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,P):(e.__proto__=P,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},S(j.prototype),j.prototype[s]=function(){return this},l.AsyncIterator=j,l.async=function(e,t,n,i){var r=new j(_(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},S(b),b[u]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=T,A.prototype={constructor:A,reset:function(e){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(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:T(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function _(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new A(i||[]);return a._invoke=function(e,t,n){var i=f;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return M()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function O(){}function P(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function j(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function k(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,k(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; /*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * @@ -14,4 +14,4 @@ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ -!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),f="function",h=Math.round,d=Math.abs,v=Date.now;function g(e,t,n){return setTimeout(w(e,n),t)}function p(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function L(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==B&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(f=o.pointers,h=i,oe(h[0],h[1],$)/oe(f[0],f[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>z||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,f=re(u,c,l);i=f.x,r=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var f,h;var g=e.element;k(t.srcEvent.target,g)&&(g=t.srcEvent.target);t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?q:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(R(this.element),this.evWin,this.domHandler)}};var ue={mousedown:B,mousemove:U,mouseup:V},ce="mousedown",le="mousemove mouseup";function fe(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(fe,ee,{handler:function(e){var t=ue[e.type];t&B&&0===e.button&&(this.pressed=!0),t&U&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:B,pointermove:U,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",ge="pointermove pointerup pointercancel";function pe(){this.evEl=ve,this.evWin=ge,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",ge="MSPointerMove MSPointerUp MSPointerCancel"),x(pe,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=he[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=A(t,e.pointerId,"pointerId");r&B&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:B,touchmove:U,touchend:V,touchcancel:G},ye="touchstart",be="touchstart touchmove touchend touchcancel";function _e(){this.evTarget=ye,this.evWin=be,this.started=!1,ee.apply(this,arguments)}x(_e,ee,{handler:function(e){var t=me[e.type];if(t===B&&(this.started=!0),this.started){var n=function(e,t){var n=T(e.touches),i=T(e.changedTouches);t&(V|G)&&(n=M(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:B,touchmove:U,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Oe(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Oe,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=T(e.touches),i=this.targetIds;if(t&(B|U)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=T(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return k(e.target,u)}),t===B)for(r=0;r-1&&i.splice(e,1)},Pe)}}x(je,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,ke.call(this,t)):e&(V|G)&&ke.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Be&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return qe.prototype.attrTest.call(this,e)&&(this.state&Ne||!(this.state&Ne)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ye,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ne)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Ke,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&B)this.reset(),this._timer=g(function(){this.state=Ue,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ue;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ue&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Qe,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ne)}}),x(Je,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|K)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;j(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:C(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return o});var i=n(228),r=n(193);const a={position:"absolute",left:0,top:0,width:"100%",height:"100%"};class o extends r.a{constructor(e={}){if("undefined"==typeof document)throw Error("Deck can only be used in the browser");const{mapCanvas:t,deckCanvas:n}=function(e){let{container:t=document.body}=e;if("string"==typeof t&&(t=document.getElementById(t)),!t)throw Error("Deck: container not found");"static"===window.getComputedStyle(t).position&&(t.style.position="relative");const n=document.createElement("div");t.appendChild(n),Object.assign(n.style,a);const i=document.createElement("canvas");return t.appendChild(i),Object.assign(i.style,a),{container:t,mapCanvas:n,deckCanvas:i}}(e),r=e.initialViewState||function(e){if(!e.viewState&&"latitude"in e&&"longitude"in e&&"zoom"in e){const{latitude:t,longitude:n,zoom:i,pitch:r=0,bearing:a=0}=e;return{latitude:t,longitude:n,zoom:i,pitch:r,bearing:a}}return e.viewState}(e),o=Number.isFinite(r.latitude),{map:s=window.mapboxgl,controller:u=!0}=e;super(Object.assign({},e,{width:"100%",height:"100%",canvas:n,controller:u,initialViewState:r})),s&&s.Map?this._map=o&&new i.a(Object.assign({},e,{viewState:r,container:t,mapboxgl:s})):this._map=s,this._onBeforeRender=(e=>{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(260);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(21),p=n(72),m=n(15),y=n(164),b=n(129),_=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function x(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(Number.isFinite(e[0]))t=new i(e);else{t=new i(4*e.length);for(var r=0,a=0;ae?t:e}function U(e,t){return t1&&void 0!==arguments[1]?arguments[1]:{},n=t.width,i=void 0===n?1:n,r=t.height,a=void 0===r?1:r,o=t.data,s=void 0===o?null:o,u=t.unpackFlipY,c=void 0===u||u,l=t.parameters,f=void 0===l?ee:l;return new J.a(e,{data:s,format:34836,type:5126,border:0,mipmaps:!1,parameters:f,dataFormat:6408,width:i,height:a,unpackFlipY:c})}function ne(e,t){var n=t.id,i=t.width,r=void 0===i?1:i,a=t.height,o=void 0===a?1:a,s=t.texture;return new $.a(e,{id:n,width:r,height:o,attachments:P()({},36064,s)})}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(C.d)(t)&&Object(E.c)(this.gl,A.a.BLEND_EQUATION_MINMAX,A.a.COLOR_ATTACHMENT_RGBA32F,A.a.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.info("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,oe){var r=oe[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},H,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,W)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||Q,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},K,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,f=0;f=0&&P=0&&S0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new L.a(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n pos = floor(pos / cellSize);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?[F.a]:["project32"],shaderCache:n,vertexCount:0,drawMode:0})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new L.a(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:[k.a],shaderCache:t,vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new I.a(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,h=a.weights,d=[o,s],v={blend:!0,depthTest:!1,blendFunc:[1,1]},g={viewport:n},p={windowSize:u,cellSize:t,gridSize:d,uProjectionMatrix:i,uProjectionMatrixFP64:re(i),projectPoints:r};for(var m in h){var y=h[m],b=y.needMin,_=y.needMax,x=b&&_&&h[m].combineMaxMin;this.renderToWeightsTexture({id:m,parameters:v,moduleSettings:g,uniforms:p,gridSize:d}),x?this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:Z}),gridSize:d,minOrMaxFb:c[m],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:x}):(b&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:X}),gridSize:d,minOrMaxFb:l[m],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:x}),_&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:q}),gridSize:d,minOrMaxFb:f[m],combineMaxMin:x}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(R.a)(c,s,function(){c.clear(16384)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,f=this.gl,h=this.gridAggregationModel,d=l[t].operation;s[t].bind(),f.viewport(0,0,a[0],a[1]);var v=d===N.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(R.a)(f,{clearColor:v},function(){f.clear(16384)});var g={weights:c[t]};if(h.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:g}),s[t].unbind(),d===N.MEAN){var p=this.state,m=p.meanTextures,y=p.textures,b={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(b).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(P()({},36064,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,f=t.equations,h=t.weights,d={width:n,height:i};for(var v in h){var g=h[v],p=g.needMin,m=g.needMax,y=g.combineMaxMin,b=g.operation;r[v]=h[v].aggregationTexture||r[v]||te(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var _=r[v];b===N.MEAN&&(l[v]=l[v]||te(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),_=l[v]),a[v]?a[v].attach(P()({},36064,_)):a[v]=ne(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:_}),a[v].resize(d),f[v]=Y[b],(p||m)&&(p&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=te(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=ne(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(p&&(s[v]||(c["".concat(v,"-min")]=te(this.gl,{id:"".concat(v,"-minTex")}),s[v]=ne(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=te(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=ne(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof T.a?n[o].setData(u):(a["".concat(o,"-buffer")]=new T.a(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof T.a),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],h()(l()(t.prototype),"getShaders",this).call(this,e)}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:N.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new se(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&this._updateAggregation(n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||le,o=this.props.maxColor||fe,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,f=u.cellScale,h=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,g={minColor:a,maxColor:o,cellScale:f,colorRange:d,colorDomain:s,shouldUseMinMax:h};Object(C.d)(n)?l.bind({target:35345}):g.maxWeight=v,t=Object.assign(g,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(C.d)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=se.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new ue.a({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new T.a(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=ce(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(p.a)(t),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var m=v.value;l.index++;var y=n(m,l),b=i(m,l),_=l.index;a[2*_]=y[0],a[2*_+1]=y[1],Array.isArray(b)?(o[3*_]=b[0],o[3*_+1]=b[1],o[3*_+2]=b[2]):o[3*_]=b}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}s.color.values=o,this.setState({positions:a})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(C.d)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager();(e.cellSizeChanged||e.viewportChanged)&&(this._updateGridParams(),t.invalidateAll());var n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=N[this.props.aggregation.toUpperCase()]||N.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var f=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),h=f.color.maxData&&Number.isFinite(f.color.maxData[0])?f.color.maxData[0]:0;this.setState({maxWeight:h}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if(he.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,f=c>l?l:0;r.cellScale=new Float32Array([(c-f)/o*2,-(c-f)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new T.a(r,{byteLength:u,accessor:{size:4,type:5126,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(b.a);ve.layerName="ScreenGridLayer",ve.defaultProps=de;var ge=n(191),pe=n(192),me=n(216),ye=function(e){return e.length},be=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=j()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,P()({},t.i,t))},{})}}]),e}();function _e(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function xe(e,t){return function(n){return _e(e,t,n)}}function we(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var Oe=6378e3;function Pe(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(p.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,f=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}var g=function(e,t){var n=(o=e,o/Oe*(180/Math.PI)),i=(r=t,a=e,a/Oe*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(g.xOffset<=0||g.yOffset<=0)return{gridHash:{},gridOffset:g};var m={};u.index=-1;var y=!0,b=!1,_=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;u.index++;var P=i(O,u),S=j()(P,2),k=S[0],C=S[1];if(Number.isFinite(C)&&Number.isFinite(k)){var E=Math.floor((C+90)/g.yOffset),A=Math.floor((k+180)/g.xOffset),T="".concat(E,"-").concat(A);m[T]=m[T]||{count:0,points:[]},m[T].count+=1,m[T].points.push(O)}}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}return{gridHash:m,gridOffset:g}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function Se(){}var je={colorDomain:null,colorRange:_,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:Se,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:Se,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,material:new ge.a},ke=["getColorValue","colorAggregation","getColorWeight"],Ce=["getElevationValue","elevationAggregation","getElevationWeight"],Ee=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:Se,elevationScaleFunc:Se,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=Pe(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.transitions;return new(this.getSubLayerClass("grid-cell",me.a))({cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(pe.a);Ee.layerName="CPUGridLayer",Ee.defaultProps=je;var Ae=n(169),Te=Math.PI/3,Me=[0,Te,2*Te,3*Te,4*Te,5*Te];function Le(e){return e[0]}function Ie(e){return e[1]}var Re=function(){var e,t,n,i=0,r=0,a=1,o=1,s=Le,u=Ie;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var g=l-d,p=d+(ly*y+b*b&&(d=p+(1&h?1:-1)/2,h=m)}var _=d+"-"+h,x=r[_];x?x.push(c):(a.push(x=r[_]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return a}function l(e){var t=0,n=0;return Me.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.transitions,o=this.state,s=o.angle,u=o.radius;return new(this.getSubLayerClass("hexagon-cell",Ae.a))({radius:u,diskResolution:6,elevationScale:t,angle:s,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(pe.a);Be.layerName="HexagonLayer",Be.defaultProps=De;var Ue,Ve=n(22),Ge=n(221),We=n(130),He={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Xe=[He.W,He.SW,He.S],qe=[He.S,He.SE,He.E],Ze=[He.E,He.NE,He.N],Ye=[He.NW,He.W,He.N],Ke=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],Qe=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Je=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],$e=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],et=[He.W,He.SW,He.SE,He.E],tt=[He.S,He.SE,He.NE,He.N],nt=[He.NW,He.W,He.E,He.NE],it=[He.NW,He.SW,He.S,He.N],rt=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],at=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],ot=[He.NW,He.SW,He.SE,He.NE],st=[He.NW,He.SW,He.SE,He.E,He.N],ut=[He.W,He.SW,He.SE,He.NE,He.N],ct=[He.NW,He.W,He.S,He.SE,He.NE],lt=[He.NW,He.SW,He.S,He.E,He.NE],ft=[He.NW,He.W,[.5,-1/6],[.5,1/6],He.N],ht=[[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],dt=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E],vt=[He.W,He.SW,He.S,[1/6,.5],[-1/6,.5]],gt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.N],pt=[[-.5,1/6],[-.5,-1/6],He.E,He.NE,He.N],mt=[He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],yt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6]],bt=[He.W,He.SW,He.SE,He.E,[1/6,.5],[-1/6,.5]],_t=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.NE,He.N],xt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.E,He.NE],wt=[He.NW,He.SW,He.S,[.5,-1/6],[.5,1/6],He.N],Ot=[He.W,He.SW,He.S,He.E,He.NE,He.N],Pt=[He.NW,He.W,He.S,He.SE,He.E,He.N],St=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],jt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],kt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],He.N],Ct=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],Et=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],At={0:[],1:[[He.W,He.S]],2:[[He.S,He.E]],3:[[He.W,He.E]],4:[[He.N,He.E]],5:{0:[[He.W,He.S],[He.N,He.E]],1:[[He.W,He.N],[He.S,He.E]]},6:[[He.N,He.S]],7:[[He.W,He.N]],8:[[He.W,He.N]],9:[[He.N,He.S]],10:{0:[[He.W,He.N],[He.S,He.E]],1:[[He.W,He.S],[He.N,He.E]]},11:[[He.N,He.E]],12:[[He.W,He.E]],13:[[He.S,He.E]],14:[[He.W,He.S]],15:[]};function Tt(e){return parseInt(e,4)}var Mt=(Ue={},P()(Ue,Tt("0000"),[]),P()(Ue,Tt("2222"),[]),P()(Ue,Tt("2221"),[Xe]),P()(Ue,Tt("2212"),[qe]),P()(Ue,Tt("2122"),[Ze]),P()(Ue,Tt("1222"),[Ye]),P()(Ue,Tt("0001"),[Xe]),P()(Ue,Tt("0010"),[qe]),P()(Ue,Tt("0100"),[Ze]),P()(Ue,Tt("1000"),[Ye]),P()(Ue,Tt("2220"),[Ke]),P()(Ue,Tt("2202"),[Qe]),P()(Ue,Tt("2022"),[Je]),P()(Ue,Tt("0222"),[$e]),P()(Ue,Tt("0002"),[Ke]),P()(Ue,Tt("0020"),[Qe]),P()(Ue,Tt("0200"),[Je]),P()(Ue,Tt("2000"),[$e]),P()(Ue,Tt("0011"),[et]),P()(Ue,Tt("0110"),[tt]),P()(Ue,Tt("1100"),[nt]),P()(Ue,Tt("1001"),[it]),P()(Ue,Tt("2211"),[et]),P()(Ue,Tt("2112"),[tt]),P()(Ue,Tt("1122"),[nt]),P()(Ue,Tt("1221"),[it]),P()(Ue,Tt("2200"),[rt]),P()(Ue,Tt("2002"),[at]),P()(Ue,Tt("0022"),[rt]),P()(Ue,Tt("0220"),[at]),P()(Ue,Tt("1111"),[ot]),P()(Ue,Tt("1211"),[st]),P()(Ue,Tt("2111"),[ut]),P()(Ue,Tt("1112"),[ct]),P()(Ue,Tt("1121"),[lt]),P()(Ue,Tt("1011"),[st]),P()(Ue,Tt("0111"),[ut]),P()(Ue,Tt("1110"),[ct]),P()(Ue,Tt("1101"),[lt]),P()(Ue,Tt("1200"),[ft]),P()(Ue,Tt("0120"),[ht]),P()(Ue,Tt("0012"),[dt]),P()(Ue,Tt("2001"),[vt]),P()(Ue,Tt("1022"),[ft]),P()(Ue,Tt("2102"),[ht]),P()(Ue,Tt("2210"),[dt]),P()(Ue,Tt("0221"),[vt]),P()(Ue,Tt("1002"),[gt]),P()(Ue,Tt("2100"),[pt]),P()(Ue,Tt("0210"),[mt]),P()(Ue,Tt("0021"),[yt]),P()(Ue,Tt("1220"),[gt]),P()(Ue,Tt("0122"),[pt]),P()(Ue,Tt("2012"),[mt]),P()(Ue,Tt("2201"),[yt]),P()(Ue,Tt("0211"),[bt]),P()(Ue,Tt("2110"),[_t]),P()(Ue,Tt("1102"),[xt]),P()(Ue,Tt("1021"),[wt]),P()(Ue,Tt("2011"),[bt]),P()(Ue,Tt("0112"),[_t]),P()(Ue,Tt("1120"),[xt]),P()(Ue,Tt("1201"),[wt]),P()(Ue,Tt("2101"),[Ot]),P()(Ue,Tt("0121"),[Ot]),P()(Ue,Tt("1012"),[Pt]),P()(Ue,Tt("1210"),[Pt]),P()(Ue,Tt("0101"),{0:[Xe,Ze],1:[Ot],2:[Ot]}),P()(Ue,Tt("1010"),{0:[Ye,qe],1:[Pt],2:[Pt]}),P()(Ue,Tt("2121"),{0:[Ot],1:[Ot],2:[Xe,Ze]}),P()(Ue,Tt("1212"),{0:[Pt],1:[Pt],2:[Ye,qe]}),P()(Ue,Tt("2120"),{0:[St],1:[St],2:[Ke,Ze]}),P()(Ue,Tt("2021"),{0:[jt],1:[jt],2:[Xe,Je]}),P()(Ue,Tt("1202"),{0:[kt],1:[kt],2:[Ye,Qe]}),P()(Ue,Tt("0212"),{0:[Ct],1:[Ct],2:[qe,$e]}),P()(Ue,Tt("0102"),{0:[Ke,Ze],1:[St],2:[St]}),P()(Ue,Tt("0201"),{0:[Xe,Je],1:[jt],2:[jt]}),P()(Ue,Tt("1020"),{0:[Ye,Qe],1:[kt],2:[kt]}),P()(Ue,Tt("2010"),{0:[qe,$e],1:[Ct],2:[Ct]}),P()(Ue,Tt("2020"),{0:[$e,Qe],1:[Et],2:[Ke,Je]}),P()(Ue,Tt("0202"),{0:[Je,Ke],1:[Et],2:[$e,Qe]}),Ue),Lt={ISO_LINES:1,ISO_BANDS:2},It={zIndex:0,zOffset:.005};function Rt(e,t){return Array.isArray(t)?e=t?1:0}function Ft(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,f=s||u||c||l,h={},d={};s||l?d.top=0:(h.top=t[(i+1)*r+n],d.top=Rt(h.top,o)),u||l?d.topRight=0:(h.topRight=t[(i+1)*r+n+1],d.topRight=Rt(h.topRight,o)),u||c?d.right=0:(h.right=t[i*r+n+1],d.right=Rt(h.right,o)),s||c?d.current=0:(h.current=t[i*r+n],d.current=Rt(h.current,o));var v=d.top,g=d.topRight,p=d.right,y=d.current,b=-1;Number.isFinite(o)&&(b=v<<3|g<<2|p<<1|y),Array.isArray(o)&&(b=v<<6|g<<4|p<<2|y);var _=0;return f||(_=Rt((h.top+h.topRight+h.right+h.current)/4,o)),{code:b,meanCode:_}}function Dt(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?Lt.ISO_LINES:s,c=Object.assign({},It,e.thresholdData),l=u===Lt.ISO_BANDS?Mt[a]:At[a];Array.isArray(l)||(l=l[o]);var f=c.zIndex*c.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+h,g=t[1]+d;if(u===Lt.ISO_BANDS){var p=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=g+e[1]*n[1];t.push([i,r,f])}),p.push(t)}),p}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=g+e[1]*n[1];m.push([t,i,f])})}),m}var Nt=n(64),zt=n(31),Bt=g.experimental.count,Ut=k.a.fp64LowPart,Vt=6378e3;function Gt(e){return Number.isFinite(e)?e:0}function Wt(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,f=void 0===l?zt.a.LNGLAT:l,h=e.viewport,d=void 0===h?null:h,v=e.boundingBox,g=void 0===v?null:v,y={};o.dataChanged&&(g=(y=function(e,t,n){var i,r,a=Bt(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,f=-1/0,h={};for(var d in n)h[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(p.a)(e),g=v.iterable,m=v.objectInfo,y=!0,b=!1,_=void 0;try{for(var x,w=g[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;m.index++;var P=t(O,m),S=m.index;for(var j in r=P[0],i=P[1],o[2*S]=r,o[2*S+1]=i,s[2*S]=Ut(r),s[2*S+1]=Ut(i),n){var k=n[j].getWeight(O);Array.isArray(k)?(h[j].values[3*S]=k[0],h[j].values[3*S+1]=k[1],h[j].values[3*S+2]=k[2]):h[j].values[3*S]=k}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rf?r:f)}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var C={xMin:Gt(l),xMax:Gt(f),yMin:Gt(u),yMax:Gt(c)};return{positions:o,positions64xyLow:s,weights:h,boundingBox:C}}(t,n,s)).boundingBox);var b=[i,i],_=[0,0];switch(m.a.assert(f===zt.a.LNGLAT||f===zt.a.IDENTITY),f){case zt.a.LNGLAT:case zt.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/Vt*(180/Math.PI)),i=(r=t,a=e,a/Vt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(g,i);b=[x.xOffset,x.yOffset],_=[-180,-90];break;case zt.a.IDENTITY:_=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=Ht(o-i[0],n[0])+i[0],c=Ht(r-i[1],n[1])+i[1],l=(new Nt.a).translate([-1*u,-1*c,0]),f=[u,c],h=s-o+n[0],d=a-r+n[1],v=[Math.ceil(h/n[0]),Math.ceil(d/n[1])];return{gridOrigin:f,gridSize:v,width:h,height:d,gridTransformMatrix:l}}({boundingBox:g,cellSize:b,worldOrigin:_});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:b,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:b,boundingBox:g}}function Ht(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Xt=[255,255,255,255],qt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},Zt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new se(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ge.a(this._getLineLayerProps()),r&&new We.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:f,gridOrigin:h,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking",k.a]})}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new Kt.a,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,f=n.gridOffset,h=n.elevationRange,d=[Object(Yt.c)(l[0]),Object(Yt.c)(l[1])],v=[Object(Yt.c)(f[0]),Object(Yt.c)(f[1])],g=this.getDomainUniforms(),p={colorMaxMinBuffer:i.color.maxMinBuffer,elevationMaxMinBuffer:i.elevation.maxMinBuffer},m=x(this.props.colorRange);this.bindUniformBuffers(p),this.state.model.setUniforms(Object.assign({},t,g,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:d,gridOffset:f,gridOffsetLow:v,colorRange:m,elevationRange:h})).draw(),this.unbindUniformBuffers(p)}},{key:"bindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.bind({target:35345,index:0}),n.bind({target:35345,index:1})}},{key:"unbindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.unbind({target:35345,index:0}),n.unbind({target:35345,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(b.a);$t.layerName="GPUGridCellLayer",$t.defaultProps=Jt;var en={colorDomain:null,colorRange:_,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new ge.a,gpuAggregation:!0},tn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=se.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new se(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,f=c.getPosition,h=this.state.gridHash;if(!h)h=Pe(l,this.props.cellSize,f).gridHash,this.setState({gridHash:h});var d=h[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,f=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:N[s]||N[en.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:N[c]||N[en.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),h=f.weights,d=f.gridSize,v=f.gridOrigin,g=f.cellSize,p=f.boundingBox;this.setState({weights:h,gridSize:d,gridOrigin:v,cellSize:g,boundingBox:p})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.elevationRange,s=e.colorDomain,u=e.elevationDomain,c=this.state,l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=x(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",$t))({gridSize:f,gridOrigin:h,gridOffset:d,colorRange:v,elevationRange:o,colorDomain:s,elevationDomain:u,cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:l,numInstances:f[0]*f[1]})}}]),t}(pe.a);tn.layerName="GPUGridLayer",tn.defaultProps=en;var nn=Object.assign({},tn.defaultProps,Ee.defaultProps,{gpuAggregation:!1}),rn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",tn):this.getSubLayerClass("CPU",Ee))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!se.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(pe.a);rn.layerName="GridLayer",rn.defaultProps=nn;var an=new Float32Array(12);function on(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=0,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0)for(var u=o.value,c=0;c 0.5) {\n discard;\n }\n gl_FragColor.rgb = weightsTexture.rgb * gaussianKDE(2. * dist);\n gl_FragColor.a = 1.0;\n}\n",modules:["project32"],elementCount:1,_targetTexture:n,_targetTextureVarying:"weightsTexture"});this.state={textureSize:t,weightsTexture:n,maxWeightsTexture:i,weightsTransform:r,model:r.model,maxWeightTransform:new I.a(e,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:n},_targetTexture:i,_targetTextureVarying:"outTexture",vs:"#version 300 es\nin vec4 inTexture;\nout vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\n}\n",elementCount:t*t}),zoom:null,triPositionBuffer:new T.a(e,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new T.a(e,{byteLength:48,accessor:{size:2}})}}},{key:"_updateMaxWeightValue",value:function(){this.state.maxWeightTransform.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}},{key:"_updateBounds",value:function(){var e,t,n,i,r,a,o,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0],u=this.state.textureSize,c=this.context.viewport,l=[c.unproject([0,0]),c.unproject([c.width,0]),c.unproject([c.width,c.height]),c.unproject([0,c.height])],f=(t=(e=l).map(function(e){return e[0]}),n=e.map(function(e){return e[1]}),i=Math.min.apply(null,t),r=Math.max.apply(null,t),[i,Math.min.apply(null,n),r,Math.max.apply(null,n)]),h=this._worldToCommonBounds(f),d={visibleWorldBounds:f,viewportCorners:l},v=!1;if(s||!this.state.worldBounds||(a=this.state.worldBounds,!((o=f)[0]>=a[0]&&o[2]<=a[2]&&o[1]>=a[1]&&o[3]<=a[3]))){var g=sn(h,2*u,2*u),p=this._commonToWorldBounds(g);this.props.coordinateSystem===zt.a.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 m=this._worldToCommonBounds(p,{scaleToAspect:!0,normalize:!0,width:2*u,height:2*u});d.worldBounds=p,d.normalizedCommonBounds=m,v=!0}return this.setState(d),v}},{key:"_updateTextureRenderingBounds",value:function(){var e=this.state,t=e.triPositionBuffer,n=e.triTexCoordBuffer,i=e.normalizedCommonBounds,r=e.viewportCorners,a=this.context.viewport,o=i.map(function(e){return e*a.scale});t.subData(on(r,3));var s=r.map(function(e){return t=a.projectPosition(e),n=o,i=j()(n,4),r=i[0],s=i[1],u=i[2],c=i[3],[(t[0]-r)/(u-r),(t[1]-s)/(c-s)];var t,n,i,r,s,u,c});n.subData(on(s,2))}},{key:"_updateColorTexture",value:function(e){var t=e.props.colorRange,n=this.state.colorTexture,i=x(t,!0);n?n.setImageData({data:i,width:t.length}):n=te(this.context.gl,{data:i,width:t.length,parameters:hn}),this.setState({colorTexture:n})}},{key:"_updateWeightmap",value:function(){var e=this.props.radiusPixels,t=this.state,n=t.weightsTransform,i=t.worldBounds,r=t.textureSize;this._updateAttributes(this.props);var a=Object.assign(Object.create(this.props),{viewport:this.context.viewport,pickingActive:0}),o=this._worldToCommonBounds(i,{useLayerCoordinateSystem:!0,scaleToAspect:!0,width:2*r,height:2*r}),s=Object.assign({},n.model.getModuleUniforms(a),{radiusPixels:e,commonBounds:o,textureWidth:r});n.update({elementCount:this.getNumInstances()}),n.run({uniforms:s,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0}),this._updateMaxWeightValue(),this.setState({lastUpdate:Date.now()})}},{key:"_debouncedUpdateWeightmap",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.state.updateTimer,n=Date.now()-this.state.lastUpdate;e&&(t=null),n>=500?(this._updateBounds(!0),this._updateWeightmap(),this._updateTextureRenderingBounds()):t||(t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),500-n)),this.setState({updateTimer:t})}},{key:"_worldToCommonBounds",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.useLayerCoordinateSystem,a=void 0!==r&&r,o=i.scaleToAspect,s=void 0!==o&&o,u=i.width,c=i.height,l=j()(e,4),f=l[0],h=l[1],d=l[2],v=l[3],g=this.context.viewport;a?(t=this.projectPosition([f,v,0]),n=this.projectPosition([d,h,0])):(t=g.projectPosition([f,v,0]),n=g.projectPosition([d,h,0]));var p=t.slice(0,2).concat(n.slice(0,2));return s&&(p=sn(p,u,c)),i.normalize&&(p=p.map(function(e){return e/g.scale})),p}},{key:"_commonToWorldBounds",value:function(e){var t=j()(e,4),n=t[0],i=t[1],r=t[2],a=t[3],o=this.context.viewport,s=o.unprojectPosition([n,a]),u=o.unprojectPosition([r,i]);return s.slice(0,2).concat(u.slice(0,2))}}]),t}(pe.a);vn.layerName="HeatmapLayer",vn.defaultProps=dn,n.d(t,"experimental",function(){return gn}),n.d(t,"ScreenGridLayer",function(){return ve}),n.d(t,"CPUGridLayer",function(){return Ee}),n.d(t,"HexagonLayer",function(){return Be}),n.d(t,"ContourLayer",function(){return Zt}),n.d(t,"GridLayer",function(){return rn}),n.d(t,"GPUGridLayer",function(){return tn}),n.d(t,"AGGREGATION_OPERATION",function(){return N}),n.d(t,"HeatmapLayer",function(){return vn}),n.d(t,"_GPUGridAggregator",function(){return se});var gn={BinSorter:be,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:we,quantizeScale:_e,getQuantizeScale:xe,defaultColorRange:_}},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(129),y=n(125),b=n(58),_=n(191),x=n(30),w=n(93),O=Math.PI/180,P=new Float32Array(16),S=new Float32Array(12);function j(e,t,n){var i=t[0]*O,r=t[1]*O,a=t[2]*O,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),f=Math.cos(r),h=n[0],d=n[1],v=n[2];e[0]=h*f*l,e[1]=h*u*l,e[2]=h*-s,e[3]=d*(-u*c+f*s*o),e[4]=d*(f*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+f*s*c),e[7]=v*(-f*o+u*s*c),e[8]=v*l*c}function k(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var C={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),f=l&&16===c.length,h=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),p=f||!l&&Boolean(c(a[0]));e.constant=p?f:d&&h&&v;var m=e.value;if(e.constant){var y;if(p)P.set(c),y=k(P);else j(y=S,o,s),y.set(u,9);e.value=new Float32Array(y)}else{var b=n*e.size,_=Object(g.a)(a,n,i),x=_.iterable,w=_.objectInfo,O=!0,C=!1,E=void 0;try{for(var A,T=x[Symbol.iterator]();!(O=(A=T.next()).done);O=!0){var M=A.value;w.index++;var L=void 0;if(p)P.set(f?c:c(M,w)),L=k(P);else j(L=S,d?o:o(M,w),h?s:s(M,w)),L.set(v?u:u(M,w),9);m[b++]=L[0],m[b++]=L[1],m[b++]=L[2],m[b++]=L[3],m[b++]=L[4],m[b++]=L[5],m[b++]=L[6],m[b++]=L[7],m[b++]=L[8],m[b++]=L[9],m[b++]=L[10],m[b++]=L[11]}}catch(e){C=!0,E=e}finally{try{O||null==T.return||T.return()}finally{if(C)throw E}}}}};function E(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function A(e){if(e.attributes)return E(e.attributes),e instanceof b.a?e:new b.a(e);if(e.positions||e.POSITION)return E(e),new b.a({attributes:e});throw Error("Invalid mesh")}var T={mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},wireframe:!1,material:new _.a,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},M=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=Object(x.d)(this.context.gl),n=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n",i=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor, color.a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";return h()(l()(t.prototype),"getShaders",this).call(this,{vs:n,fs:i,modules:["project32","phong-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:C}),this.setState({emptyTexture:new y.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||r.extensionsChanged){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new w.a(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:A(e),isInstanced:!0,shaderCache:this.context.shaderCache})),n=this.state,i=n.texture,r=n.emptyTexture;return t.setUniforms({sampler:i||r,hasTexture:Boolean(i)}),t}},{key:"setTexture",value:function(e){var t=this.context.gl,n=this.state,i=n.emptyTexture,r=n.model;this.state.texture&&this.state.texture.delete();var a=e?function(e,t,n){return t instanceof y.a?t:new y.a(e,Object.assign({data:t},n))}(t,e):null;this.setState({texture:a}),r&&r.setUniforms({sampler:a||i,hasTexture:Boolean(a)})}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);M.layerName="SimpleMeshLayer",M.defaultProps=T;var L=n(35),I=n.n(L),R=n(92),F=n(26),D=n(218),N=n(4),z=n(5),B=n(64),U=n(211),V=n(43),G=n(59),W=n(19),H=n(10),X=n(9),q=n(11),Z=n(133),Y=n(22),K=n(12);var Q=n(40),J=n(37);function $(){var e=new K.a(4);return K.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ee(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function te(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=i*l+o*s+r*c-a*u,e[1]=r*l+o*u+a*s-i*c,e[2]=a*l+o*c+i*u-r*s,e[3]=o*l-i*s-r*u-a*c,e}function ne(e,t,n,i){var r,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=n[0],v=n[1],g=n[2],p=n[3];return(a=c*d+l*v+f*g+h*p)<0&&(a=-a,d=-d,v=-v,g=-g,p=-p),1-a>K.b?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,u=Math.sin(i*r)/o):(s=1-i,u=i),e[0]=s*c+u*d,e[1]=s*l+u*v,e[2]=s*f+u*g,e[3]=s*h+u*p,e}function ie(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*n,n=.5/n,e[3]=(t[3*a+o]-t[3*o+a])*n,e[a]=(t[3*a+r]+t[3*r+a])*n,e[o]=(t[3*o+r]+t[3*r+o])*n}return e}J.b,J.g,J.c;var re,ae,oe,se,ue,ce,le,fe=J.l,he=J.a,de=J.k,ve=J.d,ge=J.i,pe=J.h,me=J.m,ye=J.j,be=(J.f,J.e,re=Q.b(),ae=Q.e(1,0,0),oe=Q.e(0,1,0),function(e,t,n){var i=Q.d(t,n);return i<-.999999?(Q.c(re,ae,t),Q.f(re)<1e-6&&Q.c(re,oe,t),Q.i(re,re),ee(e,re,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Q.c(re,t,n),e[0]=re[0],e[1]=re[1],e[2]=re[2],e[3]=1+i,ye(e,e))}),_e=(se=$(),ue=$(),ce=new K.a(9),K.a!=Float32Array&&(ce[1]=0,ce[2]=0,ce[3]=0,ce[5]=0,ce[6]=0,ce[7]=0),ce[0]=1,ce[4]=1,ce[8]=1,le=ce,[0,0,0,1]);var xe=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(N.a)(this,t),e=Object(H.a)(this,Object(X.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,a),e}return Object(q.a)(t,e),Object(z.a)(t,[{key:"fromMatrix3",value:function(e){return ie(this,e),this.check()}},{key:"fromValues",value:function(e,t,n,i){return this.set(e,t,n,i)}},{key:"identity",value:function(){var e;return(e=this)[0]=0,e[1]=0,e[2]=0,e[3]=1,this.check()}},{key:"length",value:function(){return pe(this)}},{key:"squaredLength",value:function(e){return me(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ve(this,e)}},{key:"rotationTo",value:function(e,t){return be(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return he(this,e),this.check()}},{key:"calculateW",value:function(){var e,t,n,i,r;return e=this,n=(t=this)[0],i=t[1],r=t[2],e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),this.check()}},{key:"conjugate",value:function(){var e,t;return t=this,(e=this)[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],this.check()}},{key:"invert",value:function(){var e,t,n,i,r,a,o,s;return e=this,n=(t=this)[0],i=t[1],r=t[2],a=t[3],s=(o=n*n+i*i+r*r+a*a)?1/o:0,e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=a*s,this.check()}},{key:"lerp",value:function(e,t,n){return ge(this,e,t,n),this.check()}},{key:"multiply",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.multiply only takes one argument");return te(this,this,e),this.check()}},{key:"normalize",value:function(){return ye(this,this),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+o*s,e[1]=r*u+a*s,e[2]=a*u-r*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u-a*s,e[1]=r*u+o*s,e[2]=a*u+i*s,e[3]=o*u-r*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return de(this,this,e),this.check()}},{key:"set",value:function(e,t,n,i){return fe(this,e,t,n,i),this.check()}},{key:"setAxisAngle",value:function(e,t){return ee(this,e,t),this.check()}},{key:"slerp",value:function(e){var t=e.start;return ne(this,void 0===t?_e:t,e.target,e.ratio),this.check()}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=Object(Y.a)(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=Object(Y.a)(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(Y.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(Y.a)(e)}}]),t}(Z.a),we={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Oe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Pe(e){if(!e._animation){var t=Oe[e.componentType],n=we[e.type],i=n*e.count,r=e.bufferView.data,a=new t(r.buffer,r.byteOffset+(e.byteOffset||0),i);if(1===n)e._animation=Array.from(a);else{for(var o=[],s=0;s=s}),c=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:F.a.warn("Bad animation path ".concat(i))()}Object(W.a)(n[i].length===o[c].length);var l=r[c],f=r[u];switch(a){case"STEP":!function(e,t,n){for(var i=0;il){var h=(s-l)/(f-l);!function(e,t,n,i,r){if("rotation"===t){je.slerp({start:n,target:i,ratio:r});for(var a=0;al){var d=(s-l)/(f-l),v=f-l;!function(e,t,n){for(var i=n.p0,r=n.outTangent0,a=n.inTangent1,o=n.p1,s=n.tDiff,u=n.ratio,c=0;c2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},r=new y.a(this.gl,{id:e.name||e.id,parameters:i,pixelStore:Object(Me.a)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1),data:e.texture.source.getImageAsync()});this.uniforms[t]=r,this.defineIfPresent(n,n),this.generatedTextures.push(r)}},{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 t=e.metallicFactor,n=void 0===t?1:t,i=e.roughnessFactor,r=void 0===i?1:i;this.uniforms.u_MetallicRoughnessValues=[n,r]}},{key:"parseMaterial",value:function(e){if(e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,n=void 0===t?1:t;this.uniforms.u_NormalScale=n}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,r=void 0===i?1:i;this.uniforms.u_OcclusionStrength=r}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(F.a.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]}))}}]),e}(),Ie="\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n",Re="\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n";function Fe(e,t){return Object(x.d)(e)?"#version 300 es\n".concat(t):t}var De={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ne={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},ze=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(N.a)(this,e),this.gl=t,this.options=Object.assign({},Ne,n)}return Object(z.a)(e,[{key:"instantiate",value:function(e){var t=this;return this.gltf=e,(e.scenes||[]).map(function(e){return t.createScene(e)})}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new Ee(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new U.a({id:e.name||e.id,children:n})}},{key:"createNode",value:function(e){var t=this;if(!e._node){var n=(e.children||[]).map(function(e){return t.createNode(e)});e.mesh&&n.push(this.createMesh(e.mesh));var i=new U.a({id:e.name||e.id,children:n});if(e.matrix)i.setMatrix(e.matrix);else{if(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation){var r=(new B.a).fromQuaternion(e.rotation);i.matrix.multiplyRight(r)}e.scale&&i.matrix.scale(e.scale)}e._node=i}return e._node}},{key:"createMesh",value:function(e){var t=this;if(!e._mesh){var n=(e.primitives||[]).map(function(n,i){return t.createPrimitive(n,i,e)}),i=new U.a({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){F.a.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,t,n){return function(e,t){var n=t.id,i=t.drawMode,r=t.vertexCount,a=t.attributes,o=t.modelOptions,s=new Le(e,t);F.a.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,Object(Ae.a)(s.generatedTextures)),u.push.apply(u,Object(Ae.a)(Object.values(a).map(function(e){return e.buffer})));var c=new Te.a(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[D.a],defines:s.defines,parameters:s.parameters,vs:Fe(e,Ie),fs:Fe(e,Re),managedResources:u},o));return c.setProps({attributes:a}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:e.name||"".concat(n.name||n.id,"-primitive-").concat(t),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))}},{key:"createAttributes",value:function(e,t){var n=this,i={};return Object.keys(e).forEach(function(t){i[t]=n.createAccessor(e[t],n.createBuffer(e[t],n.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),F.a.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}},{key:"createBuffer",value:function(e,t){e.bufferView||(e.bufferView={});var n=e.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new V.a(this.gl,{id:"from-".concat(n.id),data:n.data||e.value,target:t})),n.lumaBuffers[t]}},{key:"createAccessor",value:function(e,t){return new G.a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:De[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();var Be=n(50),Ue=n.n(Be),Ve=n(152),Ge=n.n(Ve);function We(){return(We=Ge()(Ue.a.mark(function e(t){var n;return Ue.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach(function(e){e.traverse(function(e){Object.values(e.model.program.uniforms).forEach(function(e){!1===e.loaded&&n.push(e)})})}),e.next=4,He(function(){return n.some(function(e){return!e.loaded})});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function He(e){return Xe.apply(this,arguments)}function Xe(){return(Xe=Ge()(Ue.a.mark(function e(t){return Ue.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise(function(e){return requestAnimationFrame(e)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}var qe=[255,255,255,255],Ze={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"===I()(e.scene)?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:qe},_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:[]}},Ye=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:qe,transition:!0},instanceModelMatrix:C})}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;n.scenegraph!==i.scenegraph?this._updateScenegraph(n):n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t,n=this,i=this.context.gl;if(e.scenegraph instanceof R.a)t={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,a=function(e,t,n){var i=new ze(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(i,r,this.getLoadOptions());t=Object.assign({gltf:r},a),function(e){return We.apply(this,arguments)}(a).then(function(){return n.setNeedsRedraw()})}else F.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader"),t=e.scenegraph;var o={layer:this,gl:i},s=e.getScene(t,o),u=e.getAnimator(t,o);s instanceof R.a?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&F.a.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).sort().forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r0)return e;e=function(e){var t=e.padEnd(16,"0");return O.a.fromString(t,16)}(e)}return x.S2.S2Cell.toHilbertQuadkey(e.toString())}function k(e){var t=j(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],f=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,S*Math.pow(2,-c)),d=0;d<4;d++)for(var v=f[d].slice(0),g=f[d+1],p=(g[0]-v[0])/h,m=(g[1]-v[1])/h,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(L.g)([r[0],r[3]],e.scale).map(R),o=_()(a,2),s=o[0],u=o[1],c=Object(L.g)([r[2],r[1]],e.scale).map(R),l=_()(c,2),f=l[0],h=l[1];s=Math.max(0,Math.floor(s)),f=Math.min(e.scale,Math.ceil(f)),u=Math.max(0,Math.floor(u)),h=Math.min(e.scale,Math.ceil(h));for(var d=[],v=s;vt?d.push(F({x:v,y:g,z:i},t)):d.push({x:v,y:g,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),N={renderSubLayers:{type:"function",value:function(e){return new A.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},z=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new D({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new D({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var f=i.viewport,h=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==f.id&&this.state.tileCache.update(f,function(e){var n=e.filter(function(e){return e.z===h}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"color.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){h()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),h()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),f=Object(U.a)(a,n,i),h=f.iterable,d=f.objectInfo,v=0,g=0;g180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function Q(e,t,n){var i=e(t,n),r=Object(G.h3ToGeo)(i),a=_()(r,2),o=a[0];return[a[1],o]}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(G.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(G.h3ToGeo)(e),r=_()(i,2),a=r[0],o=r[1],s=t.length;K(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(G.edgeLength)(i,G.UNITS.km):0,hasPentagon:r})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(G.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(G.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=J(a),u=Object(G.h3ToGeo)(a),c=_()(u,2),l=c[0],f=c[1],h=e.projectFlat([f,l]),d=_()(h,2),v=d[0],g=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-g)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.material,i=e.coverage,r=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getColor,d=e.getFillColor,v=e.getElevation,g=e.getLineColor,p=e.getLineWidth,m=e.updateTriggers;return{elevationScale:t,extruded:r,coverage:i,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:n,getElevation:v,getFillColor:h||d,getLineColor:g,getLineWidth:p,updateTriggers:{getFillColor:m.getColor||m.getFillColor,getElevation:m.getElevation,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===q()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return J(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",Y.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Q.bind(null,n)})}}]),t}(m.a);ee.defaultProps=$,ee.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return p}),n.d(t,"S2Layer",function(){return E}),n.d(t,"TileLayer",function(){return z}),n.d(t,"TripsLayer",function(){return V}),n.d(t,"H3ClusterLayer",function(){return H}),n.d(t,"H3HexagonLayer",function(){return ee})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(35),u=n.n(s);var c=n(163),l=n(213),f=n(214),h=n(215),d=n(6),v=n.n(d),g=n(3),p=n.n(g),m=n(7),y=n.n(m),b={fetch:function(e){return JSON.parse(e)},configuration:[]},_=function(e){function t(){return r()(this,t),v()(this,p()(t).apply(this,arguments))}return y()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layers:[]}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps;(e.changeFlags.dataChanged||t.configuration!==n.configuration)&&(this.state.layers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t){var n={};for(var i in e){var r=e[i];i.startsWith("get")?n[i]=D(r,t):n[i]=r}return n}(e,t);return r.fetch=N,i&&new i(r)})}(t.data,t.configuration))}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(192).a);function x(e,t){var n=function(e){if("string"==typeof e){var t=O[e];return t||(t=e.split("."),O[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=w(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function w(e){return null!==e&&"object"===u()(e)}_.layerName="JSONLayer",_.defaultProps=b;var O={};var P={},S={},j=34,k=10,C=13;function E(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var A=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return S;if(c)return c=!1,P;var t,i,r=o;if(e.charCodeAt(r)===j){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===k?c=!0:i===C&&(c=!0,e.charCodeAt(o)===k&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u]);Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var z=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=F(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return z}),n.d(t,"_JSONLayer",function(){return _})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(193),u=n(164);function c(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[770,771,1,771],blendEquation:32774},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:l(t)}),i=new s.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:l(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=h(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[f(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function l(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new u.a(Object.assign({x:0,y:0,width:e.width,height:e.height},l(t),n?{nearZMultiplier:e.height?1/e.height:1,farZMultiplier:1}:{nearZMultiplier:.1,farZMultiplier:10}))}function h(e,t){return e.layerManager.getLayers().filter(t)}function d(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function v(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var g=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=c({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),v(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),v(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&v(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=f(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:h(n,function(e){return d(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return g})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(193);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},f=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":t="pointermove",i=e._onPointerMove;break;case"mouseout":t="pointerleave",i=e._onPointerMove;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv().firstChild,i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),f=new google.maps.Point(0,0),h=a.fromContainerPixelToLatLng(f),d=a.fromLatLngToDivPixel(h),v=(c.x-l.x)/i,g=Math.log2(v)+e.getZoom()-1,p=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(p),y=m.lat(),b=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:g,pitch:e.getTilt(),latitude:y,longitude:b}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,f=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:f?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return f})},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(86),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()}])}); +!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),f="function",h=Math.round,d=Math.abs,v=Date.now;function g(e,t,n){return setTimeout(w(e,n),t)}function p(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function L(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==B&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(f=o.pointers,h=i,oe(h[0],h[1],$)/oe(f[0],f[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>z||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,f=re(u,c,l);i=f.x,r=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var f,h;var g=e.element;k(t.srcEvent.target,g)&&(g=t.srcEvent.target);t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?q:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(R(this.element),this.evWin,this.domHandler)}};var ue={mousedown:B,mousemove:U,mouseup:V},ce="mousedown",le="mousemove mouseup";function fe(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(fe,ee,{handler:function(e){var t=ue[e.type];t&B&&0===e.button&&(this.pressed=!0),t&U&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:B,pointermove:U,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",ge="pointermove pointerup pointercancel";function pe(){this.evEl=ve,this.evWin=ge,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",ge="MSPointerMove MSPointerUp MSPointerCancel"),x(pe,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=he[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=A(t,e.pointerId,"pointerId");r&B&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:B,touchmove:U,touchend:V,touchcancel:G},ye="touchstart",be="touchstart touchmove touchend touchcancel";function _e(){this.evTarget=ye,this.evWin=be,this.started=!1,ee.apply(this,arguments)}x(_e,ee,{handler:function(e){var t=me[e.type];if(t===B&&(this.started=!0),this.started){var n=function(e,t){var n=T(e.touches),i=T(e.changedTouches);t&(V|G)&&(n=M(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:B,touchmove:U,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Oe(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Oe,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=T(e.touches),i=this.targetIds;if(t&(B|U)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=T(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return k(e.target,u)}),t===B)for(r=0;r-1&&i.splice(e,1)},Pe)}}x(je,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,ke.call(this,t)):e&(V|G)&&ke.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Be&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return qe.prototype.attrTest.call(this,e)&&(this.state&Ne||!(this.state&Ne)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ye,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ne)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Ke,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&B)this.reset(),this._timer=g(function(){this.state=Ue,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ue;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ue&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Qe,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ne)}}),x(Je,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|K)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;j(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:C(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return o});var i=n(228),r=n(194);const a={position:"absolute",left:0,top:0,width:"100%",height:"100%"};class o extends r.a{constructor(e={}){if("undefined"==typeof document)throw Error("Deck can only be used in the browser");const{mapCanvas:t,deckCanvas:n}=function(e){let{container:t=document.body}=e;if("string"==typeof t&&(t=document.getElementById(t)),!t)throw Error("Deck: container not found");"static"===window.getComputedStyle(t).position&&(t.style.position="relative");const n=document.createElement("div");t.appendChild(n),Object.assign(n.style,a);const i=document.createElement("canvas");return t.appendChild(i),Object.assign(i.style,a),{container:t,mapCanvas:n,deckCanvas:i}}(e),r=e.initialViewState||function(e){if(!e.viewState&&"latitude"in e&&"longitude"in e&&"zoom"in e){const{latitude:t,longitude:n,zoom:i,pitch:r=0,bearing:a=0}=e;return{latitude:t,longitude:n,zoom:i,pitch:r,bearing:a}}return e.viewState}(e),o=Number.isFinite(r.latitude),{map:s=window.mapboxgl,controller:u=!0}=e;super(Object.assign({},e,{width:"100%",height:"100%",canvas:n,controller:u,initialViewState:r})),s&&s.Map?this._map=o&&new i.a(Object.assign({},e,{viewState:r,container:t,mapboxgl:s})):this._map=s,this._onBeforeRender=(e=>{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(260);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(21),p=n(72),m=n(15),y=n(165),b=n(130),_=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function x(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(Number.isFinite(e[0]))t=new i(e);else{t=new i(4*e.length);for(var r=0,a=0;ae?t:e}function U(e,t){return t1&&void 0!==arguments[1]?arguments[1]:{},n=t.width,i=void 0===n?1:n,r=t.height,a=void 0===r?1:r,o=t.data,s=void 0===o?null:o,u=t.unpackFlipY,c=void 0===u||u,l=t.parameters,f=void 0===l?ee:l;return new J.a(e,{data:s,format:34836,type:5126,border:0,mipmaps:!1,parameters:f,dataFormat:6408,width:i,height:a,unpackFlipY:c})}function ne(e,t){var n=t.id,i=t.width,r=void 0===i?1:i,a=t.height,o=void 0===a?1:a,s=t.texture;return new $.a(e,{id:n,width:r,height:o,attachments:P()({},36064,s)})}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(C.d)(t)&&Object(E.c)(this.gl,A.a.BLEND_EQUATION_MINMAX,A.a.COLOR_ATTACHMENT_RGBA32F,A.a.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.warn("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,oe){var r=oe[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},H,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,W)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||Q,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},K,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,f=0;f=0&&P=0&&S0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new L.a(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n pos = floor(pos / cellSize);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?[F.a]:["project32"],shaderCache:n,vertexCount:0,drawMode:0})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new L.a(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:[k.a],shaderCache:t,vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new I.a(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,h=a.weights,d=[o,s],v={blend:!0,depthTest:!1,blendFunc:[1,1]},g={viewport:n},p={windowSize:u,cellSize:t,gridSize:d,uProjectionMatrix:i,uProjectionMatrixFP64:re(i),projectPoints:r};for(var m in h){var y=h[m],b=y.needMin,_=y.needMax,x=b&&_&&h[m].combineMaxMin;this.renderToWeightsTexture({id:m,parameters:v,moduleSettings:g,uniforms:p,gridSize:d}),x?this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:Z}),gridSize:d,minOrMaxFb:c[m],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:x}):(b&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:X}),gridSize:d,minOrMaxFb:l[m],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:x}),_&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:q}),gridSize:d,minOrMaxFb:f[m],combineMaxMin:x}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(R.a)(c,s,function(){c.clear(16384)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,f=this.gl,h=this.gridAggregationModel,d=l[t].operation;s[t].bind(),f.viewport(0,0,a[0],a[1]);var v=d===N.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(R.a)(f,{clearColor:v},function(){f.clear(16384)});var g={weights:c[t]};if(h.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:g}),s[t].unbind(),d===N.MEAN){var p=this.state,m=p.meanTextures,y=p.textures,b={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(b).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(P()({},36064,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,f=t.equations,h=t.weights,d={width:n,height:i};for(var v in h){var g=h[v],p=g.needMin,m=g.needMax,y=g.combineMaxMin,b=g.operation;r[v]=h[v].aggregationTexture||r[v]||te(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var _=r[v];b===N.MEAN&&(l[v]=l[v]||te(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),_=l[v]),a[v]?a[v].attach(P()({},36064,_)):a[v]=ne(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:_}),a[v].resize(d),f[v]=Y[b],(p||m)&&(p&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=te(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=ne(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(p&&(s[v]||(c["".concat(v,"-min")]=te(this.gl,{id:"".concat(v,"-minTex")}),s[v]=ne(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=te(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=ne(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof T.a?n[o].setData(u):(a["".concat(o,"-buffer")]=new T.a(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof T.a),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],h()(l()(t.prototype),"getShaders",this).call(this,e)}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:N.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new se(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&((n.cellSizeChanged||n.viewportChanged)&&this._updateGridParams(),this.state.pointCount>0&&this._updateAggregation(n))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||le,o=this.props.maxColor||fe,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,f=u.cellScale,h=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,g={minColor:a,maxColor:o,cellScale:f,colorRange:d,colorDomain:s,shouldUseMinMax:h};Object(C.d)(n)?l.bind({target:35345}):g.maxWeight=v,t=Object.assign(g,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(C.d)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=se.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new ue.a({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new T.a(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=ce(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(p.a)(t),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var m=v.value;l.index++;var y=n(m,l),b=i(m,l),_=l.index;a[2*_]=y[0],a[2*_+1]=y[1],Array.isArray(b)?(o[3*_]=b[0],o[3*_+1]=b[1],o[3*_+2]=b[2]):o[3*_]=b}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}s.color.values=o,this.setState({positions:a,pointCount:r})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(C.d)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager(),n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=N[this.props.aggregation.toUpperCase()]||N.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var f=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),h=f.color.maxData&&Number.isFinite(f.color.maxData[0])?f.color.maxData[0]:0;this.setState({maxWeight:h}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if(he.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,f=c>l?l:0;r.cellScale=new Float32Array([(c-f)/o*2,-(c-f)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){this.getAttributeManager().invalidateAll();var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new T.a(r,{byteLength:u,accessor:{size:4,type:5126,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(b.a);ve.layerName="ScreenGridLayer",ve.defaultProps=de;var ge=n(192),pe=n(193),me=n(217),ye=function(e){return e.length},be=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=j()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,P()({},t.i,t))},{})}}]),e}();function _e(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function xe(e,t){return function(n){return _e(e,t,n)}}function we(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var Oe=6378e3;function Pe(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(p.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,f=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}var g=function(e,t){var n=(o=e,o/Oe*(180/Math.PI)),i=(r=t,a=e,a/Oe*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(g.xOffset<=0||g.yOffset<=0)return{gridHash:{},gridOffset:g};var m={};u.index=-1;var y=!0,b=!1,_=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;u.index++;var P=i(O,u),S=j()(P,2),k=S[0],C=S[1];if(Number.isFinite(C)&&Number.isFinite(k)){var E=Math.floor((C+90)/g.yOffset),A=Math.floor((k+180)/g.xOffset),T="".concat(E,"-").concat(A);m[T]=m[T]||{count:0,points:[]},m[T].count+=1,m[T].points.push(O)}}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}return{gridHash:m,gridOffset:g}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function Se(){}var je={colorDomain:null,colorRange:_,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:Se,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:Se,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,material:new ge.a},ke=["getColorValue","colorAggregation","getColorWeight"],Ce=["getElevationValue","elevationAggregation","getElevationWeight"],Ee=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:Se,elevationScaleFunc:Se,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=Pe(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.transitions;return new(this.getSubLayerClass("grid-cell",me.a))({cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(pe.a);Ee.layerName="CPUGridLayer",Ee.defaultProps=je;var Ae=n(170),Te=Math.PI/3,Me=[0,Te,2*Te,3*Te,4*Te,5*Te];function Le(e){return e[0]}function Ie(e){return e[1]}var Re=function(){var e,t,n,i=0,r=0,a=1,o=1,s=Le,u=Ie;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var g=l-d,p=d+(ly*y+b*b&&(d=p+(1&h?1:-1)/2,h=m)}var _=d+"-"+h,x=r[_];x?x.push(c):(a.push(x=r[_]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return a}function l(e){var t=0,n=0;return Me.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.transitions,o=this.state,s=o.angle,u=o.radius;return new(this.getSubLayerClass("hexagon-cell",Ae.a))({radius:u,diskResolution:6,elevationScale:t,angle:s,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(pe.a);Be.layerName="HexagonLayer",Be.defaultProps=De;var Ue,Ve=n(22),Ge=n(222),We=n(131),He={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Xe=[He.W,He.SW,He.S],qe=[He.S,He.SE,He.E],Ze=[He.E,He.NE,He.N],Ye=[He.NW,He.W,He.N],Ke=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],Qe=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Je=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],$e=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],et=[He.W,He.SW,He.SE,He.E],tt=[He.S,He.SE,He.NE,He.N],nt=[He.NW,He.W,He.E,He.NE],it=[He.NW,He.SW,He.S,He.N],rt=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],at=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],ot=[He.NW,He.SW,He.SE,He.NE],st=[He.NW,He.SW,He.SE,He.E,He.N],ut=[He.W,He.SW,He.SE,He.NE,He.N],ct=[He.NW,He.W,He.S,He.SE,He.NE],lt=[He.NW,He.SW,He.S,He.E,He.NE],ft=[He.NW,He.W,[.5,-1/6],[.5,1/6],He.N],ht=[[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],dt=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E],vt=[He.W,He.SW,He.S,[1/6,.5],[-1/6,.5]],gt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.N],pt=[[-.5,1/6],[-.5,-1/6],He.E,He.NE,He.N],mt=[He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],yt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6]],bt=[He.W,He.SW,He.SE,He.E,[1/6,.5],[-1/6,.5]],_t=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.NE,He.N],xt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.E,He.NE],wt=[He.NW,He.SW,He.S,[.5,-1/6],[.5,1/6],He.N],Ot=[He.W,He.SW,He.S,He.E,He.NE,He.N],Pt=[He.NW,He.W,He.S,He.SE,He.E,He.N],St=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],jt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],kt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],He.N],Ct=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],Et=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],At={0:[],1:[[He.W,He.S]],2:[[He.S,He.E]],3:[[He.W,He.E]],4:[[He.N,He.E]],5:{0:[[He.W,He.S],[He.N,He.E]],1:[[He.W,He.N],[He.S,He.E]]},6:[[He.N,He.S]],7:[[He.W,He.N]],8:[[He.W,He.N]],9:[[He.N,He.S]],10:{0:[[He.W,He.N],[He.S,He.E]],1:[[He.W,He.S],[He.N,He.E]]},11:[[He.N,He.E]],12:[[He.W,He.E]],13:[[He.S,He.E]],14:[[He.W,He.S]],15:[]};function Tt(e){return parseInt(e,4)}var Mt=(Ue={},P()(Ue,Tt("0000"),[]),P()(Ue,Tt("2222"),[]),P()(Ue,Tt("2221"),[Xe]),P()(Ue,Tt("2212"),[qe]),P()(Ue,Tt("2122"),[Ze]),P()(Ue,Tt("1222"),[Ye]),P()(Ue,Tt("0001"),[Xe]),P()(Ue,Tt("0010"),[qe]),P()(Ue,Tt("0100"),[Ze]),P()(Ue,Tt("1000"),[Ye]),P()(Ue,Tt("2220"),[Ke]),P()(Ue,Tt("2202"),[Qe]),P()(Ue,Tt("2022"),[Je]),P()(Ue,Tt("0222"),[$e]),P()(Ue,Tt("0002"),[Ke]),P()(Ue,Tt("0020"),[Qe]),P()(Ue,Tt("0200"),[Je]),P()(Ue,Tt("2000"),[$e]),P()(Ue,Tt("0011"),[et]),P()(Ue,Tt("0110"),[tt]),P()(Ue,Tt("1100"),[nt]),P()(Ue,Tt("1001"),[it]),P()(Ue,Tt("2211"),[et]),P()(Ue,Tt("2112"),[tt]),P()(Ue,Tt("1122"),[nt]),P()(Ue,Tt("1221"),[it]),P()(Ue,Tt("2200"),[rt]),P()(Ue,Tt("2002"),[at]),P()(Ue,Tt("0022"),[rt]),P()(Ue,Tt("0220"),[at]),P()(Ue,Tt("1111"),[ot]),P()(Ue,Tt("1211"),[st]),P()(Ue,Tt("2111"),[ut]),P()(Ue,Tt("1112"),[ct]),P()(Ue,Tt("1121"),[lt]),P()(Ue,Tt("1011"),[st]),P()(Ue,Tt("0111"),[ut]),P()(Ue,Tt("1110"),[ct]),P()(Ue,Tt("1101"),[lt]),P()(Ue,Tt("1200"),[ft]),P()(Ue,Tt("0120"),[ht]),P()(Ue,Tt("0012"),[dt]),P()(Ue,Tt("2001"),[vt]),P()(Ue,Tt("1022"),[ft]),P()(Ue,Tt("2102"),[ht]),P()(Ue,Tt("2210"),[dt]),P()(Ue,Tt("0221"),[vt]),P()(Ue,Tt("1002"),[gt]),P()(Ue,Tt("2100"),[pt]),P()(Ue,Tt("0210"),[mt]),P()(Ue,Tt("0021"),[yt]),P()(Ue,Tt("1220"),[gt]),P()(Ue,Tt("0122"),[pt]),P()(Ue,Tt("2012"),[mt]),P()(Ue,Tt("2201"),[yt]),P()(Ue,Tt("0211"),[bt]),P()(Ue,Tt("2110"),[_t]),P()(Ue,Tt("1102"),[xt]),P()(Ue,Tt("1021"),[wt]),P()(Ue,Tt("2011"),[bt]),P()(Ue,Tt("0112"),[_t]),P()(Ue,Tt("1120"),[xt]),P()(Ue,Tt("1201"),[wt]),P()(Ue,Tt("2101"),[Ot]),P()(Ue,Tt("0121"),[Ot]),P()(Ue,Tt("1012"),[Pt]),P()(Ue,Tt("1210"),[Pt]),P()(Ue,Tt("0101"),{0:[Xe,Ze],1:[Ot],2:[Ot]}),P()(Ue,Tt("1010"),{0:[Ye,qe],1:[Pt],2:[Pt]}),P()(Ue,Tt("2121"),{0:[Ot],1:[Ot],2:[Xe,Ze]}),P()(Ue,Tt("1212"),{0:[Pt],1:[Pt],2:[Ye,qe]}),P()(Ue,Tt("2120"),{0:[St],1:[St],2:[Ke,Ze]}),P()(Ue,Tt("2021"),{0:[jt],1:[jt],2:[Xe,Je]}),P()(Ue,Tt("1202"),{0:[kt],1:[kt],2:[Ye,Qe]}),P()(Ue,Tt("0212"),{0:[Ct],1:[Ct],2:[qe,$e]}),P()(Ue,Tt("0102"),{0:[Ke,Ze],1:[St],2:[St]}),P()(Ue,Tt("0201"),{0:[Xe,Je],1:[jt],2:[jt]}),P()(Ue,Tt("1020"),{0:[Ye,Qe],1:[kt],2:[kt]}),P()(Ue,Tt("2010"),{0:[qe,$e],1:[Ct],2:[Ct]}),P()(Ue,Tt("2020"),{0:[$e,Qe],1:[Et],2:[Ke,Je]}),P()(Ue,Tt("0202"),{0:[Je,Ke],1:[Et],2:[$e,Qe]}),Ue),Lt={ISO_LINES:1,ISO_BANDS:2},It={zIndex:0,zOffset:.005};function Rt(e,t){return Array.isArray(t)?e=t?1:0}function Ft(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,f=s||u||c||l,h={},d={};s||l?d.top=0:(h.top=t[(i+1)*r+n],d.top=Rt(h.top,o)),u||l?d.topRight=0:(h.topRight=t[(i+1)*r+n+1],d.topRight=Rt(h.topRight,o)),u||c?d.right=0:(h.right=t[i*r+n+1],d.right=Rt(h.right,o)),s||c?d.current=0:(h.current=t[i*r+n],d.current=Rt(h.current,o));var v=d.top,g=d.topRight,p=d.right,y=d.current,b=-1;Number.isFinite(o)&&(b=v<<3|g<<2|p<<1|y),Array.isArray(o)&&(b=v<<6|g<<4|p<<2|y);var _=0;return f||(_=Rt((h.top+h.topRight+h.right+h.current)/4,o)),{code:b,meanCode:_}}function Dt(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?Lt.ISO_LINES:s,c=Object.assign({},It,e.thresholdData),l=u===Lt.ISO_BANDS?Mt[a]:At[a];Array.isArray(l)||(l=l[o]);var f=c.zIndex*c.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+h,g=t[1]+d;if(u===Lt.ISO_BANDS){var p=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=g+e[1]*n[1];t.push([i,r,f])}),p.push(t)}),p}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=g+e[1]*n[1];m.push([t,i,f])})}),m}var Nt=n(64),zt=n(31),Bt=g.experimental.count,Ut=k.a.fp64LowPart,Vt=6378e3;function Gt(e){return Number.isFinite(e)?e:0}function Wt(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,f=void 0===l?zt.a.LNGLAT:l,h=e.viewport,d=void 0===h?null:h,v=e.boundingBox,g=void 0===v?null:v,y={};o.dataChanged&&(g=(y=function(e,t,n){var i,r,a=Bt(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,f=-1/0,h={};for(var d in n)h[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(p.a)(e),g=v.iterable,m=v.objectInfo,y=!0,b=!1,_=void 0;try{for(var x,w=g[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;m.index++;var P=t(O,m),S=m.index;for(var j in r=P[0],i=P[1],o[2*S]=r,o[2*S+1]=i,s[2*S]=Ut(r),s[2*S+1]=Ut(i),n){var k=n[j].getWeight(O);Array.isArray(k)?(h[j].values[3*S]=k[0],h[j].values[3*S+1]=k[1],h[j].values[3*S+2]=k[2]):h[j].values[3*S]=k}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rf?r:f)}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var C={xMin:Gt(l),xMax:Gt(f),yMin:Gt(u),yMax:Gt(c)};return{positions:o,positions64xyLow:s,weights:h,boundingBox:C}}(t,n,s)).boundingBox);var b=[i,i],_=[0,0];switch(m.a.assert(f===zt.a.LNGLAT||f===zt.a.IDENTITY),f){case zt.a.LNGLAT:case zt.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/Vt*(180/Math.PI)),i=(r=t,a=e,a/Vt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(g,i);b=[x.xOffset,x.yOffset],_=[-180,-90];break;case zt.a.IDENTITY:_=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=Ht(o-i[0],n[0])+i[0],c=Ht(r-i[1],n[1])+i[1],l=(new Nt.a).translate([-1*u,-1*c,0]),f=[u,c],h=s-o+n[0],d=a-r+n[1],v=[Math.ceil(h/n[0]),Math.ceil(d/n[1])];return{gridOrigin:f,gridSize:v,width:h,height:d,gridTransformMatrix:l}}({boundingBox:g,cellSize:b,worldOrigin:_});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:b,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:b,boundingBox:g}}function Ht(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Xt=[255,255,255,255],qt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},Zt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new se(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ge.a(this._getLineLayerProps()),r&&new We.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:f,gridOrigin:h,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking",k.a]})}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new Kt.a,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,f=n.gridOffset,h=n.elevationRange,d=[Object(Yt.c)(l[0]),Object(Yt.c)(l[1])],v=[Object(Yt.c)(f[0]),Object(Yt.c)(f[1])],g=this.getDomainUniforms(),p={colorMaxMinBuffer:i.color.maxMinBuffer,elevationMaxMinBuffer:i.elevation.maxMinBuffer},m=x(this.props.colorRange);this.bindUniformBuffers(p),this.state.model.setUniforms(Object.assign({},t,g,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:d,gridOffset:f,gridOffsetLow:v,colorRange:m,elevationRange:h})).draw(),this.unbindUniformBuffers(p)}},{key:"bindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.bind({target:35345,index:0}),n.bind({target:35345,index:1})}},{key:"unbindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.unbind({target:35345,index:0}),n.unbind({target:35345,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(b.a);$t.layerName="GPUGridCellLayer",$t.defaultProps=Jt;var en={colorDomain:null,colorRange:_,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new ge.a,gpuAggregation:!0},tn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=se.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new se(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,f=c.getPosition,h=this.state.gridHash;if(!h)h=Pe(l,this.props.cellSize,f).gridHash,this.setState({gridHash:h});var d=h[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,f=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:N[s]||N[en.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:N[c]||N[en.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),h=f.weights,d=f.gridSize,v=f.gridOrigin,g=f.cellSize,p=f.boundingBox;this.setState({weights:h,gridSize:d,gridOrigin:v,cellSize:g,boundingBox:p})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.elevationRange,s=e.colorDomain,u=e.elevationDomain,c=this.state,l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=x(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",$t))({gridSize:f,gridOrigin:h,gridOffset:d,colorRange:v,elevationRange:o,colorDomain:s,elevationDomain:u,cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:l,numInstances:f[0]*f[1]})}}]),t}(pe.a);tn.layerName="GPUGridLayer",tn.defaultProps=en;var nn=Object.assign({},tn.defaultProps,Ee.defaultProps,{gpuAggregation:!1}),rn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",tn):this.getSubLayerClass("CPU",Ee))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!se.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(pe.a);rn.layerName="GridLayer",rn.defaultProps=nn;var an=new Float32Array(12);function on(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=0,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0)for(var u=o.value,c=0;c 0.5) {\n discard;\n }\n gl_FragColor.rgb = weightsTexture.rgb * gaussianKDE(2. * dist);\n gl_FragColor.a = 1.0;\n}\n",modules:["project32"],elementCount:1,_targetTexture:n,_targetTextureVarying:"weightsTexture"});this.setState({weightsTexture:n,maxWeightsTexture:i,weightsTransform:r,model:r.model,maxWeightTransform:new I.a(e,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:n},_targetTexture:i,_targetTextureVarying:"outTexture",vs:"#version 300 es\nin vec4 inTexture;\nout vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\n}\n",elementCount:t*t}),zoom:null,triPositionBuffer:new T.a(e,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new T.a(e,{byteLength:48,accessor:{size:2}})})}},{key:"_updateMaxWeightValue",value:function(){this.state.maxWeightTransform.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}},{key:"_updateBounds",value:function(){var e,t,n,i,r,a,o,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0],u=this.state.textureSize,c=this.context.viewport,l=[c.unproject([0,0]),c.unproject([c.width,0]),c.unproject([c.width,c.height]),c.unproject([0,c.height])],f=(t=(e=l).map(function(e){return e[0]}),n=e.map(function(e){return e[1]}),i=Math.min.apply(null,t),r=Math.max.apply(null,t),[i,Math.min.apply(null,n),r,Math.max.apply(null,n)]),h=this._worldToCommonBounds(f),d={visibleWorldBounds:f,viewportCorners:l},v=!1;if(s||!this.state.worldBounds||(a=this.state.worldBounds,!((o=f)[0]>=a[0]&&o[2]<=a[2]&&o[1]>=a[1]&&o[3]<=a[3]))){var g=sn(h,2*u,2*u),p=this._commonToWorldBounds(g);this.props.coordinateSystem===zt.a.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 m=this._worldToCommonBounds(p,{scaleToAspect:!0,normalize:!0,width:2*u,height:2*u});d.worldBounds=p,d.normalizedCommonBounds=m,v=!0}return this.setState(d),v}},{key:"_updateTextureRenderingBounds",value:function(){var e=this.state,t=e.triPositionBuffer,n=e.triTexCoordBuffer,i=e.normalizedCommonBounds,r=e.viewportCorners,a=this.context.viewport,o=i.map(function(e){return e*a.scale});t.subData(on(r,3));var s=r.map(function(e){return t=a.projectPosition(e),n=o,i=j()(n,4),r=i[0],s=i[1],u=i[2],c=i[3],[(t[0]-r)/(u-r),(t[1]-s)/(c-s)];var t,n,i,r,s,u,c});n.subData(on(s,2))}},{key:"_updateColorTexture",value:function(e){var t=e.props.colorRange,n=this.state.colorTexture,i=x(t,!0);n?n.setImageData({data:i,width:t.length}):n=te(this.context.gl,{data:i,width:t.length,parameters:hn}),this.setState({colorTexture:n})}},{key:"_updateWeightmap",value:function(){var e=this.props.radiusPixels,t=this.state,n=t.weightsTransform,i=t.worldBounds,r=t.textureSize;this._updateAttributes(this.props);var a=Object.assign(Object.create(this.props),{viewport:this.context.viewport,pickingActive:0}),o=this._worldToCommonBounds(i,{useLayerCoordinateSystem:!0,scaleToAspect:!0,width:2*r,height:2*r}),s=Object.assign({},n.model.getModuleUniforms(a),{radiusPixels:e,commonBounds:o,textureWidth:r});n.update({elementCount:this.getNumInstances()}),n.run({uniforms:s,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0}),this._updateMaxWeightValue(),this.setState({lastUpdate:Date.now()})}},{key:"_debouncedUpdateWeightmap",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.state.updateTimer,n=Date.now()-this.state.lastUpdate;e&&(t=null),n>=500?(this._updateBounds(!0),this._updateWeightmap(),this._updateTextureRenderingBounds()):t||(t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),500-n)),this.setState({updateTimer:t})}},{key:"_worldToCommonBounds",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.useLayerCoordinateSystem,a=void 0!==r&&r,o=i.scaleToAspect,s=void 0!==o&&o,u=i.width,c=i.height,l=j()(e,4),f=l[0],h=l[1],d=l[2],v=l[3],g=this.context.viewport;a?(t=this.projectPosition([f,v,0]),n=this.projectPosition([d,h,0])):(t=g.projectPosition([f,v,0]),n=g.projectPosition([d,h,0]));var p=t.slice(0,2).concat(n.slice(0,2));return s&&(p=sn(p,u,c)),i.normalize&&(p=p.map(function(e){return e/g.scale})),p}},{key:"_commonToWorldBounds",value:function(e){var t=j()(e,4),n=t[0],i=t[1],r=t[2],a=t[3],o=this.context.viewport,s=o.unprojectPosition([n,a]),u=o.unprojectPosition([r,i]);return s.slice(0,2).concat(u.slice(0,2))}}]),t}(pe.a);vn.layerName="HeatmapLayer",vn.defaultProps=dn,n.d(t,"experimental",function(){return gn}),n.d(t,"ScreenGridLayer",function(){return ve}),n.d(t,"CPUGridLayer",function(){return Ee}),n.d(t,"HexagonLayer",function(){return Be}),n.d(t,"ContourLayer",function(){return Zt}),n.d(t,"GridLayer",function(){return rn}),n.d(t,"GPUGridLayer",function(){return tn}),n.d(t,"AGGREGATION_OPERATION",function(){return N}),n.d(t,"HeatmapLayer",function(){return vn}),n.d(t,"_GPUGridAggregator",function(){return se});var gn={BinSorter:be,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:we,quantizeScale:_e,getQuantizeScale:xe,defaultColorRange:_}},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(126),b=n(58),_=n(192),x=n(30),w=n(93),O=Math.PI/180,P=new Float32Array(16),S=new Float32Array(12);function j(e,t,n){var i=t[0]*O,r=t[1]*O,a=t[2]*O,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),f=Math.cos(r),h=n[0],d=n[1],v=n[2];e[0]=h*f*l,e[1]=h*u*l,e[2]=h*-s,e[3]=d*(-u*c+f*s*o),e[4]=d*(f*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+f*s*c),e[7]=v*(-f*o+u*s*c),e[8]=v*l*c}function k(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var C={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),f=l&&16===c.length,h=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),p=f||!l&&Boolean(c(a[0]));e.constant=p?f:d&&h&&v;var m=e.value;if(e.constant){var y;if(p)P.set(c),y=k(P);else j(y=S,o,s),y.set(u,9);e.value=new Float32Array(y)}else{var b=n*e.size,_=Object(g.a)(a,n,i),x=_.iterable,w=_.objectInfo,O=!0,C=!1,E=void 0;try{for(var A,T=x[Symbol.iterator]();!(O=(A=T.next()).done);O=!0){var M=A.value;w.index++;var L=void 0;if(p)P.set(f?c:c(M,w)),L=k(P);else j(L=S,d?o:o(M,w),h?s:s(M,w)),L.set(v?u:u(M,w),9);m[b++]=L[0],m[b++]=L[1],m[b++]=L[2],m[b++]=L[3],m[b++]=L[4],m[b++]=L[5],m[b++]=L[6],m[b++]=L[7],m[b++]=L[8],m[b++]=L[9],m[b++]=L[10],m[b++]=L[11]}}catch(e){C=!0,E=e}finally{try{O||null==T.return||T.return()}finally{if(C)throw E}}}}};function E(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function A(e){if(e.attributes)return E(e.attributes),e instanceof b.a?e:new b.a(e);if(e.positions||e.POSITION)return E(e),new b.a({attributes:e});throw Error("Invalid mesh")}var T={mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},wireframe:!1,material:new _.a,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},M=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=Object(x.d)(this.context.gl),n=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n",i=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor, color.a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";return h()(l()(t.prototype),"getShaders",this).call(this,{vs:n,fs:i,modules:["project32","phong-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:C}),this.setState({emptyTexture:new y.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||r.extensionsChanged){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new w.a(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:A(e),isInstanced:!0,shaderCache:this.context.shaderCache})),n=this.state,i=n.texture,r=n.emptyTexture;return t.setUniforms({sampler:i||r,hasTexture:Boolean(i)}),t}},{key:"setTexture",value:function(e){var t=this.context.gl,n=this.state,i=n.emptyTexture,r=n.model;this.state.texture&&this.state.texture.delete();var a=e?function(e,t,n){return t instanceof y.a?t:new y.a(e,Object.assign({data:t},n))}(t,e):null;this.setState({texture:a}),r&&r.setUniforms({sampler:a||i,hasTexture:Boolean(a)})}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);M.layerName="SimpleMeshLayer",M.defaultProps=T;var L=n(35),I=n.n(L),R=n(92),F=n(26),D=n(219),N=n(4),z=n(5),B=n(64),U=n(212),V=n(43),G=n(59),W=n(19),H=n(10),X=n(9),q=n(11),Z=n(134),Y=n(22),K=n(12);var Q=n(40),J=n(37);function $(){var e=new K.a(4);return K.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ee(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function te(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=i*l+o*s+r*c-a*u,e[1]=r*l+o*u+a*s-i*c,e[2]=a*l+o*c+i*u-r*s,e[3]=o*l-i*s-r*u-a*c,e}function ne(e,t,n,i){var r,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=n[0],v=n[1],g=n[2],p=n[3];return(a=c*d+l*v+f*g+h*p)<0&&(a=-a,d=-d,v=-v,g=-g,p=-p),1-a>K.b?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,u=Math.sin(i*r)/o):(s=1-i,u=i),e[0]=s*c+u*d,e[1]=s*l+u*v,e[2]=s*f+u*g,e[3]=s*h+u*p,e}function ie(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*n,n=.5/n,e[3]=(t[3*a+o]-t[3*o+a])*n,e[a]=(t[3*a+r]+t[3*r+a])*n,e[o]=(t[3*o+r]+t[3*r+o])*n}return e}J.b,J.g,J.c;var re,ae,oe,se,ue,ce,le,fe=J.l,he=J.a,de=J.k,ve=J.d,ge=J.i,pe=J.h,me=J.m,ye=J.j,be=(J.f,J.e,re=Q.b(),ae=Q.e(1,0,0),oe=Q.e(0,1,0),function(e,t,n){var i=Q.d(t,n);return i<-.999999?(Q.c(re,ae,t),Q.f(re)<1e-6&&Q.c(re,oe,t),Q.i(re,re),ee(e,re,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Q.c(re,t,n),e[0]=re[0],e[1]=re[1],e[2]=re[2],e[3]=1+i,ye(e,e))}),_e=(se=$(),ue=$(),ce=new K.a(9),K.a!=Float32Array&&(ce[1]=0,ce[2]=0,ce[3]=0,ce[5]=0,ce[6]=0,ce[7]=0),ce[0]=1,ce[4]=1,ce[8]=1,le=ce,[0,0,0,1]);var xe=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(N.a)(this,t),e=Object(H.a)(this,Object(X.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,a),e}return Object(q.a)(t,e),Object(z.a)(t,[{key:"fromMatrix3",value:function(e){return ie(this,e),this.check()}},{key:"fromValues",value:function(e,t,n,i){return this.set(e,t,n,i)}},{key:"identity",value:function(){var e;return(e=this)[0]=0,e[1]=0,e[2]=0,e[3]=1,this.check()}},{key:"length",value:function(){return pe(this)}},{key:"squaredLength",value:function(e){return me(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ve(this,e)}},{key:"rotationTo",value:function(e,t){return be(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return he(this,e),this.check()}},{key:"calculateW",value:function(){var e,t,n,i,r;return e=this,n=(t=this)[0],i=t[1],r=t[2],e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),this.check()}},{key:"conjugate",value:function(){var e,t;return t=this,(e=this)[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],this.check()}},{key:"invert",value:function(){var e,t,n,i,r,a,o,s;return e=this,n=(t=this)[0],i=t[1],r=t[2],a=t[3],s=(o=n*n+i*i+r*r+a*a)?1/o:0,e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=a*s,this.check()}},{key:"lerp",value:function(e,t,n){return ge(this,e,t,n),this.check()}},{key:"multiply",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.multiply only takes one argument");return te(this,this,e),this.check()}},{key:"normalize",value:function(){return ye(this,this),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+o*s,e[1]=r*u+a*s,e[2]=a*u-r*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u-a*s,e[1]=r*u+o*s,e[2]=a*u+i*s,e[3]=o*u-r*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return de(this,this,e),this.check()}},{key:"set",value:function(e,t,n,i){return fe(this,e,t,n,i),this.check()}},{key:"setAxisAngle",value:function(e,t){return ee(this,e,t),this.check()}},{key:"slerp",value:function(e){var t=e.start;return ne(this,void 0===t?_e:t,e.target,e.ratio),this.check()}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=Object(Y.a)(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=Object(Y.a)(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(Y.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(Y.a)(e)}}]),t}(Z.a),we={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Oe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Pe(e){if(!e._animation){var t=Oe[e.componentType],n=we[e.type],i=n*e.count,r=e.bufferView.data,a=new t(r.buffer,r.byteOffset+(e.byteOffset||0),i);if(1===n)e._animation=Array.from(a);else{for(var o=[],s=0;s=s}),c=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:F.a.warn("Bad animation path ".concat(i))()}Object(W.a)(n[i].length===o[c].length);var l=r[c],f=r[u];switch(a){case"STEP":!function(e,t,n){for(var i=0;il){var h=(s-l)/(f-l);!function(e,t,n,i,r){if("rotation"===t){je.slerp({start:n,target:i,ratio:r});for(var a=0;al){var d=(s-l)/(f-l),v=f-l;!function(e,t,n){for(var i=n.p0,r=n.outTangent0,a=n.inTangent1,o=n.p1,s=n.tDiff,u=n.ratio,c=0;c2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},r=new y.a(this.gl,{id:e.name||e.id,parameters:i,pixelStore:Object(Me.a)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1),data:e.texture.source.getImageAsync()});this.uniforms[t]=r,this.defineIfPresent(n,n),this.generatedTextures.push(r)}},{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 t=e.metallicFactor,n=void 0===t?1:t,i=e.roughnessFactor,r=void 0===i?1:i;this.uniforms.u_MetallicRoughnessValues=[n,r]}},{key:"parseMaterial",value:function(e){if(e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,n=void 0===t?1:t;this.uniforms.u_NormalScale=n}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,r=void 0===i?1:i;this.uniforms.u_OcclusionStrength=r}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(F.a.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]}))}}]),e}(),Ie="\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n",Re="\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n";function Fe(e,t){return Object(x.d)(e)?"#version 300 es\n".concat(t):t}var De={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ne={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},ze=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(N.a)(this,e),this.gl=t,this.options=Object.assign({},Ne,n)}return Object(z.a)(e,[{key:"instantiate",value:function(e){var t=this;return this.gltf=e,(e.scenes||[]).map(function(e){return t.createScene(e)})}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new Ee(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new U.a({id:e.name||e.id,children:n})}},{key:"createNode",value:function(e){var t=this;if(!e._node){var n=(e.children||[]).map(function(e){return t.createNode(e)});e.mesh&&n.push(this.createMesh(e.mesh));var i=new U.a({id:e.name||e.id,children:n});if(e.matrix)i.setMatrix(e.matrix);else{if(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation){var r=(new B.a).fromQuaternion(e.rotation);i.matrix.multiplyRight(r)}e.scale&&i.matrix.scale(e.scale)}e._node=i}return e._node}},{key:"createMesh",value:function(e){var t=this;if(!e._mesh){var n=(e.primitives||[]).map(function(n,i){return t.createPrimitive(n,i,e)}),i=new U.a({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){F.a.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,t,n){return function(e,t){var n=t.id,i=t.drawMode,r=t.vertexCount,a=t.attributes,o=t.modelOptions,s=new Le(e,t);F.a.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,Object(Ae.a)(s.generatedTextures)),u.push.apply(u,Object(Ae.a)(Object.values(a).map(function(e){return e.buffer})));var c=new Te.a(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[D.a],defines:s.defines,parameters:s.parameters,vs:Fe(e,Ie),fs:Fe(e,Re),managedResources:u},o));return c.setProps({attributes:a}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:e.name||"".concat(n.name||n.id,"-primitive-").concat(t),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))}},{key:"createAttributes",value:function(e,t){var n=this,i={};return Object.keys(e).forEach(function(t){i[t]=n.createAccessor(e[t],n.createBuffer(e[t],n.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),F.a.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}},{key:"createBuffer",value:function(e,t){e.bufferView||(e.bufferView={});var n=e.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new V.a(this.gl,{id:"from-".concat(n.id),data:n.data||e.value,target:t})),n.lumaBuffers[t]}},{key:"createAccessor",value:function(e,t){return new G.a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:De[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();var Be=n(50),Ue=n.n(Be),Ve=n(153),Ge=n.n(Ve);function We(){return(We=Ge()(Ue.a.mark(function e(t){var n;return Ue.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach(function(e){e.traverse(function(e){Object.values(e.model.program.uniforms).forEach(function(e){!1===e.loaded&&n.push(e)})})}),e.next=4,He(function(){return n.some(function(e){return!e.loaded})});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function He(e){return Xe.apply(this,arguments)}function Xe(){return(Xe=Ge()(Ue.a.mark(function e(t){return Ue.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise(function(e){return requestAnimationFrame(e)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}var qe=[255,255,255,255],Ze={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"===I()(e.scene)?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:qe},_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:[]}},Ye=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:qe,transition:!0},instanceModelMatrix:C})}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;n.scenegraph!==i.scenegraph?this._updateScenegraph(n):n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t,n=this,i=this.context.gl;if(e.scenegraph instanceof R.a)t={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,a=function(e,t,n){var i=new ze(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(i,r,this.getLoadOptions());t=Object.assign({gltf:r},a),function(e){return We.apply(this,arguments)}(a).then(function(){return n.setNeedsRedraw()})}else F.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader"),t=e.scenegraph;var o={layer:this,gl:i},s=e.getScene(t,o),u=e.getAnimator(t,o);s instanceof R.a?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&F.a.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).sort().forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r0)return e;e=function(e){var t=e.padEnd(16,"0");return O.a.fromString(t,16)}(e)}return x.S2.S2Cell.toHilbertQuadkey(e.toString())}function k(e){var t=j(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],f=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,S*Math.pow(2,-c)),d=0;d<4;d++)for(var v=f[d].slice(0),g=f[d+1],p=(g[0]-v[0])/h,m=(g[1]-v[1])/h,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(L.g)([r[0],r[3]],e.scale).map(R),o=_()(a,2),s=o[0],u=o[1],c=Object(L.g)([r[2],r[1]],e.scale).map(R),l=_()(c,2),f=l[0],h=l[1];s=Math.max(0,Math.floor(s)),f=Math.min(e.scale,Math.ceil(f)),u=Math.max(0,Math.floor(u)),h=Math.min(e.scale,Math.ceil(h));for(var d=[],v=s;vt?d.push(F({x:v,y:g,z:i},t)):d.push({x:v,y:g,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),N={renderSubLayers:{type:"function",value:function(e){return new A.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},z=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new D({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new D({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var f=i.viewport,h=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==f.id&&this.state.tileCache.update(f,function(e){var n=e.filter(function(e){return e.z===h}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"color.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){h()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),h()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),f=Object(U.a)(a,n,i),h=f.iterable,d=f.objectInfo,v=0,g=0;g180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function Q(e,t,n){var i=e(t,n),r=Object(G.h3ToGeo)(i),a=_()(r,2),o=a[0];return[a[1],o]}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(G.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(G.h3ToGeo)(e),r=_()(i,2),a=r[0],o=r[1],s=t.length;K(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(G.edgeLength)(i,G.UNITS.km):0,hasPentagon:r})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(G.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(G.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=J(a),u=Object(G.h3ToGeo)(a),c=_()(u,2),l=c[0],f=c[1],h=e.projectFlat([f,l]),d=_()(h,2),v=d[0],g=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-g)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.material,i=e.coverage,r=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getColor,d=e.getFillColor,v=e.getElevation,g=e.getLineColor,p=e.getLineWidth,m=e.updateTriggers;return{elevationScale:t,extruded:r,coverage:i,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:n,getElevation:v,getFillColor:h||d,getLineColor:g,getLineWidth:p,updateTriggers:{getFillColor:m.getColor||m.getFillColor,getElevation:m.getElevation,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===q()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return J(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",Y.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Q.bind(null,n)})}}]),t}(m.a);ee.defaultProps=$,ee.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return p}),n.d(t,"S2Layer",function(){return E}),n.d(t,"TileLayer",function(){return z}),n.d(t,"TripsLayer",function(){return V}),n.d(t,"H3ClusterLayer",function(){return H}),n.d(t,"H3HexagonLayer",function(){return ee})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(35),u=n.n(s);var c=n(164),l=n(214),f=n(215),h=n(216),d=n(6),v=n.n(d),g=n(3),p=n.n(g),m=n(7),y=n.n(m),b={fetch:function(e){return JSON.parse(e)},configuration:[]},_=function(e){function t(){return r()(this,t),v()(this,p()(t).apply(this,arguments))}return y()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layers:[]}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps;(e.changeFlags.dataChanged||t.configuration!==n.configuration)&&(this.state.layers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t){var n={};for(var i in e){var r=e[i];i.startsWith("get")?n[i]=D(r,t):n[i]=r}return n}(e,t);return r.fetch=N,i&&new i(r)})}(t.data,t.configuration))}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(193).a);function x(e,t){var n=function(e){if("string"==typeof e){var t=O[e];return t||(t=e.split("."),O[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=w(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function w(e){return null!==e&&"object"===u()(e)}_.layerName="JSONLayer",_.defaultProps=b;var O={};var P={},S={},j=34,k=10,C=13;function E(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var A=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return S;if(c)return c=!1,P;var t,i,r=o;if(e.charCodeAt(r)===j){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===k?c=!0:i===C&&(c=!0,e.charCodeAt(o)===k&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u]);Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var z=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=F(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return z}),n.d(t,"_JSONLayer",function(){return _})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(194);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},f=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":t="pointermove",i=e._onPointerMove;break;case"mouseout":t="pointerleave",i=e._onPointerMove;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv().firstChild,i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),f=new google.maps.Point(0,0),h=a.fromContainerPixelToLatLng(f),d=a.fromLatLngToDivPixel(h),v=(c.x-l.x)/i,g=Math.log2(v)+e.getZoom()-1,p=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(p),y=m.lat(),b=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:g,pitch:e.getTilt(),latitude:y,longitude:b}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,f=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:f?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return f})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(194),u=n(165);function c(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[770,771,1,771],blendEquation:32774},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:l(t)}),i=new s.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:l(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=h(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[f(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function l(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new u.a(Object.assign({x:0,y:0,width:e.width,height:e.height},l(t),n?{nearZMultiplier:e.height?1/e.height:1,farZMultiplier:1}:{nearZMultiplier:.1,farZMultiplier:10}))}function h(e,t){return e.layerManager.getLayers().filter(t)}function d(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function v(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var g=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=c({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),v(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),v(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&v(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=f(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:h(n,function(e){return d(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return g})},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(86),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()}])}); From f88400f03d92d2242b8a732e72982bb6de2566b2 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Wed, 14 Aug 2019 08:08:15 +1000 Subject: [PATCH 12/24] deckgl 7.2.1 --- R/mapdeck_dependencies.R | 2 +- inst/htmlwidgets/lib/deckgl.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/mapdeck_dependencies.R b/R/mapdeck_dependencies.R index f6c224d6..496b62b6 100644 --- a/R/mapdeck_dependencies.R +++ b/R/mapdeck_dependencies.R @@ -157,7 +157,7 @@ deckgl_min_js <- function() { list( createHtmlDependency( name = "deckgl", - version = "7.2.0", + version = "7.2.1", src = system.file("htmlwidgets/lib/", package = "mapdeck"), script = c("deckgl.min.js"), all_files = FALSE diff --git a/inst/htmlwidgets/lib/deckgl.min.js b/inst/htmlwidgets/lib/deckgl.min.js index 312323e2..3e8acda5 100644 --- a/inst/htmlwidgets/lib/deckgl.min.js +++ b/inst/htmlwidgets/lib/deckgl.min.js @@ -1,4 +1,4 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("h3"),require("S2"));else if("function"==typeof define&&define.amd)define(["h3","S2"],t);else{var n="object"==typeof exports?t(require("h3"),require("S2")):t(e.h3,e.S2);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=237)}([function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return i})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},i=g.b[t];if(Object(m.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in y)return y[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),y[t]=s,s}var _=n(59),x=n(43),w=n(61),O=n(197),P=n(60),S=n(95),j=n(126),k=n(160),C=n(112),E=n(80),A=n(177),T=n(161),M=n(202),L=n(106),I=n(203),R=n(4),F=n(5),D=n(73),N=5126,z=5124,B=5125,U=function(){function e(t){var n;for(var i in Object(R.a)(this,e),this.layout={},this.size=0,t)this._addUniform(i,t[i]);this.size+=(4-this.size%4)%4;var r=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,N,r),Object(c.a)(n,z,new Int32Array(r.buffer)),Object(c.a)(n,B,new Uint32Array(r.buffer)),n)}return Object(F.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[N]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Object(m.a)(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Object(D.a)(t);Object(m.a)(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}(),V=n(124),G=n(26),W=n(67),H=n(46);n.d(t,"S",function(){return r.a}),n.d(t,"A",function(){return a.a}),n.d(t,"B",function(){return a.b}),n.d(t,"V",function(){return a.d}),n.d(t,"X",function(){return a.e}),n.d(t,"N",function(){return o.c}),n.d(t,"O",function(){return o.d}),n.d(t,"w",function(){return s.a}),n.d(t,"J",function(){return u.b}),n.d(t,"I",function(){return u.a}),n.d(t,"E",function(){return v}),n.d(t,"H",function(){return d}),n.d(t,"F",function(){return h}),n.d(t,"D",function(){return f.a}),n.d(t,"c",function(){return g.a}),n.d(t,"L",function(){return p.b}),n.d(t,"M",function(){return p.c}),n.d(t,"G",function(){return p.a}),n.d(t,"t",function(){return b}),n.d(t,"a",function(){return _.a}),n.d(t,"b",function(){return x.a}),n.d(t,"i",function(){return w.b}),n.d(t,"q",function(){return w.c}),n.d(t,"d",function(){return w.a}),n.d(t,"f",function(){return O.a}),n.d(t,"e",function(){return P.a}),n.d(t,"h",function(){return S.a}),n.d(t,"j",function(){return j.a}),n.d(t,"l",function(){return k.a}),n.d(t,"u",function(){return C.a}),n.d(t,"v",function(){return C.b}),n.d(t,"T",function(){return E.e}),n.d(t,"U",function(){return E.f}),n.d(t,"x",function(){return E.b}),n.d(t,"y",function(){return E.c}),n.d(t,"z",function(){return E.d}),n.d(t,"s",function(){return E.a}),n.d(t,"g",function(){return A.a}),n.d(t,"k",function(){return T.a}),n.d(t,"m",function(){return M.a}),n.d(t,"p",function(){return L.a}),n.d(t,"o",function(){return I.a}),n.d(t,"n",function(){return U}),n.d(t,"Y",function(){return V.c}),n.d(t,"P",function(){return V.a}),n.d(t,"Q",function(){return V.b}),n.d(t,"R",function(){return G.a}),n.d(t,"r",function(){return m.a}),n.d(t,"Z",function(){return W.c}),n.d(t,"W",function(){return H.c}),n.d(t,"ab",function(){return H.d}),n.d(t,"K",function(){return H.b}),n.d(t,"C",function(){return H.a})},function(e,t,n){"use strict";var i=n(236);t.a=new i.a({id:"deck"}).enable()},function(e,t,n){var i=n(252),r=n(253),a=n(254);e.exports=function(e,t){return i(e)||r(e,t)||a()}},function(e,t,n){"use strict";n.r(t);var i=n(14),r=n(51),a=n(58),o=n(128),s=n(146),u=n(204),c=n(24),l=new Uint8Array([0,0,0]);function f(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function h(e){var t=Object(c.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function d(){return l}var v=n(93),g=n(224),p=n(101),m=n(190),y=n(34),b=n(4),_=n(5),x=n(125),w=n(135),O=n(19),P=n(26);var S=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.onInitialize,r=void 0===i?function(){}:i,a=n.onFinalize,o=void 0===a?function(){}:a,s=n.useDevicePixels,u=void 0===s||s,c=n.autoResizeDrawingBuffer,l=void 0===c||c;this.props={onInitialize:r,onFinalize:o},this.setProps({autoResizeDrawingBuffer:l,useDevicePixels:u}),Object(O.a)(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(_.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.onmessage=function(n){var i,r,a,o=n.data;switch(o.command){case"start":i=t,r=o.opts.canvas,a=new Map,r.addEventListener=function(e,t){i.postMessage({command:"addEventListener",type:e}),a.has(e)||a.set(e,[]),a.get(e).push(t)},r.removeEventListener=function(e,t){i.postMessage({command:"removeEventListener",type:e});var n=a.get(e);n&&n.splice(n.indexOf(t),1)},r.dispatchEvent=function(e,t){var n=a.get(e);n&&n.forEach(function(e){return e(t)})},i.canvas=r,e.start(o.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=o.width,t.canvas.height=o.height;break;case"event":t.canvas.dispatchEvent(o.type,o.event)}}}}}]),Object(_.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,Object(x.b)().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=Object(w.b)(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(Object(w.a)(this._animationFrameId),this._animationFrameId=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(y.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._animationFrameId=Object(w.b)(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=Object(x.a)(e);t.transferControlToOffscreen||P.a.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),j=n(10),k=n(9),C=n(11),E=n(60),A=n(70),T=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.id,r=void 0===i?"pass":i;this.id=r,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(_.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=E.a.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),Object(A.a)(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),M=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(T),L=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(b.a)(this,e),this.gl=t,this.framebuffer1=new E.a(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new E.a(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(_.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),I=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),i=Array.isArray(i)?{passes:i}:i,(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"multi-pass"},i)))).renderState=new L(e,i),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(M),R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){var e=this.gl,t=this.props.clearBits,n=void 0===t?16640:t;e.clear(n)}}]),t}(T),F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(T),D="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",N=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},i)))).clipspace=new p.a(e,{id:"copy-pass",fs:D}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),z="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",B=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,t),n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"texture-pass"},i)));var r=i.texture,a=i.opacity,o=void 0===a?1:a;return n.clipspace=new p.a(e,{id:"texture-pass",fs:z,uniforms:{uDiffuseSampler:r,uOpacity:o}}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),U=n(140),V=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),G=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(b.a)(this,t);var a="".concat(n.name,"-pass");Object(U.b)(n);var o=function(e,t,n,i){if(t.filter||t.sampler){var r=q(t),a=new V(e,{id:n,model:W(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=q(t,r),s="".concat(n,"-").concat(o.length+1);return new V(e,Object.assign({id:s,model:W(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,a,r);return(i=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:a,passes:o},r)))).module=n,i}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.props.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1;var l=c.props,f=l.uniforms,h=l.model;f&&h.setUniforms(f),h.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(M);function W(e,t,n,i,r){var a=new p.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var H=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},X=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return H(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return X(i)}return null}var Z=n(36),Y=n(67),K={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Q=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("truncated-code-geometry"):n,r=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,O=x(b),P=_(b),S=v?-2:0,j=l+(p?2:0),k=u+1,C=new Uint16Array(u*(l+m)*6),E=K[h],A=new Float32Array(3*y),T=new Float32Array(3*y),M=new Float32Array(2*y),L=0,I=0,R=S;R<=j;R++){var F=R/l,D=o*F,N=void 0;R<0?(D=0,F=1,N=n):R>l?(D=o,F=1,N=r):N=n+R/l*(r-n),-2!==R&&R!==l+2||(N=0,F=0),D-=o/2;for(var z=0;zl?0:B*O,T[L+E[1]]=R<0?-1:R>l?1:P,T[L+E[2]]=R<0||R>l?0:U*O,M[I+0]=z/u,M[I+1]=F,I+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cone-geometry"):n,r=e.radius,a=void 0===r?1:r,o=e.cap,s=void 0===o||o;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,topRadius:0,topCap:Boolean(s),bottomCap:Boolean(s),bottomRadius:a})))}return Object(C.a)(t,e),t}(Q),$=n(191),ee=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cylinder-geometry"):n,r=e.radius,a=void 0===r?1:r;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,bottomRadius:a,topRadius:a})))}return Object(C.a)(t,e),t}(Q),te=n(29),ne=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],ie=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],re=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("ico-sphere-geometry"):n,r=function(e){var t=e.iterations,n=void 0===t?0:t,i=Math.PI,r=2*i,a=[].concat(ne),o=[].concat(ie);a.push(),o.push();for(var s=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,r=t>n?t:n,o="".concat(i,"|").concat(r);if(o in e)return e[o];var s=a[t],u=a[t+1],c=a[t+2],l=a[n],f=a[n+1],h=a[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,a.push(d,v,g),e[o]=a.length/3-1}}(),u=0;u=0;p-=3){var m=o[p+0],y=o[p+1],b=o[p+2],_=3*m,x=3*y,w=3*b,O=2*m,P=2*y,S=2*b,j=a[_+0],k=a[_+1],C=a[_+2],E=Math.acos(C/Math.sqrt(j*j+k*k+C*C)),A=Math.atan2(k,j)+i,T=E/i,M=1-A/r,L=a[x+0],I=a[x+1],R=a[x+2],F=Math.acos(R/Math.sqrt(L*L+I*I+R*R)),D=Math.atan2(I,L)+i,N=F/i,z=1-D/r,B=a[w+0],U=a[w+1],V=a[w+2],G=Math.acos(V/Math.sqrt(B*B+U*U+V*V)),W=Math.atan2(U,B)+i,H=G/i,X=1-W/r,q=[B-L,U-I,V-R],Z=[j-L,k-I,C-R],Y=new te.a(q).cross(Z).normalize(),K=void 0;(0===M||0===z||0===X)&&(0===M||M>.5)&&(0===z||z>.5)&&(0===X||X>.5)&&(a.push(a[_+0],a[_+1],a[_+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=T,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[x+0],a[x+1],a[x+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=N,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[w+0],a[w+1],a[w+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=H,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z),v[_+0]=v[x+0]=v[w+0]=Y.x,v[_+1]=v[x+1]=v[w+1]=Y.y,v[_+2]=v[x+2]=v[w+2]=Y.z,g[O+0]=M,g[O+1]=T,g[P+0]=z,g[P+1]=N,g[S+0]=X,g[S+1]=H}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(g)}}}}(e),a=r.indices,o=r.attributes;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,indices:a,attributes:Object(Z.a)({},o,e.attributes)})))}return Object(C.a)(t,e),t}(a.a);var ae=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("plane-geometry"):n,r=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")]||1,f=e["".concat(c[1],"len")]||1,h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,O=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=O,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*O-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*O-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*O-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}y+=2,b+=3}for(var P=h+1,S=new Uint16Array(h*d*6),j=0;j0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("sphere-geometry"):n,r=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,O=s*y,P=Math.sin(w),S=Math.cos(w),j=Math.sin(O),k=Math.cos(O),C=S*j,E=k,A=P*j,T=o(C,E,A,m,y);f[x+0]=T*C,f[x+1]=T*E,f[x+2]=T*A,h[x+0]=C,h[x+1]=E,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var M=n+1,L=0;L0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.a)(this,t),(e=Object(j.a)(this,Object(k.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(C.a)(t,e),t}(ce.a),de=n(28);n.d(t,"isWebGL",function(){return i.N}),n.d(t,"isWebGL2",function(){return i.O}),n.d(t,"lumaStats",function(){return i.S}),n.d(t,"createGLContext",function(){return i.A}),n.d(t,"destroyGLContext",function(){return i.B}),n.d(t,"resizeGLContext",function(){return i.V}),n.d(t,"setGLContextDefaults",function(){return i.X}),n.d(t,"getContextInfo",function(){return i.E}),n.d(t,"getGLContextInfo",function(){return i.H}),n.d(t,"getContextLimits",function(){return i.F}),n.d(t,"FEATURES",function(){return i.c}),n.d(t,"hasFeature",function(){return i.L}),n.d(t,"hasFeatures",function(){return i.M}),n.d(t,"getFeatures",function(){return i.G}),n.d(t,"canCompileGLGSExtension",function(){return i.t}),n.d(t,"cloneTextureFrom",function(){return i.w}),n.d(t,"getKeyValue",function(){return i.J}),n.d(t,"getKey",function(){return i.I}),n.d(t,"setContextDefaults",function(){return i.X}),n.d(t,"glGetDebugInfo",function(){return i.D}),n.d(t,"trackContextState",function(){return r.g}),n.d(t,"resetParameters",function(){return r.d}),n.d(t,"getParameter",function(){return r.b}),n.d(t,"getParameters",function(){return r.c}),n.d(t,"setParameter",function(){return r.e}),n.d(t,"setParameters",function(){return r.f}),n.d(t,"withParameters",function(){return r.h}),n.d(t,"getModifiedParameters",function(){return r.a}),n.d(t,"Buffer",function(){return i.b}),n.d(t,"Shader",function(){return i.i}),n.d(t,"VertexShader",function(){return i.q}),n.d(t,"FragmentShader",function(){return i.d}),n.d(t,"Program",function(){return i.f}),n.d(t,"Framebuffer",function(){return i.e}),n.d(t,"Renderbuffer",function(){return i.h}),n.d(t,"Texture2D",function(){return i.j}),n.d(t,"TextureCube",function(){return i.l}),n.d(t,"clear",function(){return i.u}),n.d(t,"clearBuffer",function(){return i.v}),n.d(t,"readPixelsToArray",function(){return i.T}),n.d(t,"readPixelsToBuffer",function(){return i.U}),n.d(t,"copyToDataUrl",function(){return i.x}),n.d(t,"copyToImage",function(){return i.y}),n.d(t,"copyToTexture",function(){return i.z}),n.d(t,"blit",function(){return i.s}),n.d(t,"Query",function(){return i.g}),n.d(t,"Texture3D",function(){return i.k}),n.d(t,"TransformFeedback",function(){return i.m}),n.d(t,"VertexArrayObject",function(){return i.p}),n.d(t,"VertexArray",function(){return i.o}),n.d(t,"UniformBufferLayout",function(){return i.n}),n.d(t,"setPathPrefix",function(){return i.Y}),n.d(t,"loadFile",function(){return i.P}),n.d(t,"loadImage",function(){return i.Q}),n.d(t,"_Accessor",function(){return i.a}),n.d(t,"_clearBuffer",function(){return i.v}),n.d(t,"Geometry",function(){return a.a}),n.d(t,"Material",function(){return o.a}),n.d(t,"AmbientLight",function(){return s.a}),n.d(t,"DirectionalLight",function(){return s.b}),n.d(t,"PointLight",function(){return s.c}),n.d(t,"AnimationLoop",function(){return u.a}),n.d(t,"encodePickingColor",function(){return f}),n.d(t,"decodePickingColor",function(){return h}),n.d(t,"getNullPickingColor",function(){return d}),n.d(t,"Model",function(){return v.a}),n.d(t,"Transform",function(){return g.a}),n.d(t,"ClipSpace",function(){return p.a}),n.d(t,"_ShaderCache",function(){return m.a}),n.d(t,"_AnimationLoopProxy",function(){return S}),n.d(t,"_MultiPassRenderer",function(){return I}),n.d(t,"_RenderState",function(){return L}),n.d(t,"_Pass",function(){return T}),n.d(t,"_CompositePass",function(){return M}),n.d(t,"_ClearPass",function(){return R}),n.d(t,"_RenderPass",function(){return F}),n.d(t,"_CopyPass",function(){return N}),n.d(t,"_TexturePass",function(){return B}),n.d(t,"_ShaderModulePass",function(){return G}),n.d(t,"ConeGeometry",function(){return J}),n.d(t,"CubeGeometry",function(){return $.a}),n.d(t,"CylinderGeometry",function(){return ee}),n.d(t,"IcoSphereGeometry",function(){return re}),n.d(t,"PlaneGeometry",function(){return ae}),n.d(t,"SphereGeometry",function(){return oe}),n.d(t,"TruncatedConeGeometry",function(){return Q}),n.d(t,"PhongMaterial",function(){return se.a}),n.d(t,"PBRMaterial",function(){return ue}),n.d(t,"ScenegraphNode",function(){return ce.a}),n.d(t,"GroupNode",function(){return le.a}),n.d(t,"ModelNode",function(){return fe.a}),n.d(t,"CameraNode",function(){return he}),n.d(t,"registerShaderModules",function(){return de.v}),n.d(t,"setDefaultShaderModules",function(){return de.w}),n.d(t,"getDefaultShaderModules",function(){return de.l}),n.d(t,"assembleShaders",function(){return de.c}),n.d(t,"createShaderHook",function(){return de.g}),n.d(t,"createModuleInjection",function(){return de.f}),n.d(t,"combineInjects",function(){return de.d}),n.d(t,"normalizeShaderModule",function(){return de.q}),n.d(t,"fp32",function(){return de.j}),n.d(t,"fp64",function(){return de.k}),n.d(t,"project",function(){return de.u}),n.d(t,"lights",function(){return de.p}),n.d(t,"dirlight",function(){return de.i}),n.d(t,"picking",function(){return de.t}),n.d(t,"diffuse",function(){return de.h}),n.d(t,"gouraudlighting",function(){return de.o}),n.d(t,"phonglighting",function(){return de.s}),n.d(t,"pbr",function(){return de.r}),n.d(t,"_transform",function(){return de.b}),n.d(t,"MODULAR_SHADERS",function(){return de.a}),n.d(t,"getQualifierDetails",function(){return de.n}),n.d(t,"getPassthroughFS",function(){return de.m}),n.d(t,"typeToChannelSuffix",function(){return de.y}),n.d(t,"typeToChannelCount",function(){return de.x}),n.d(t,"convertToVec4",function(){return de.e}),n.d(t,"log",function(){return i.R}),n.d(t,"assert",function(){return i.r}),n.d(t,"uid",function(){return i.Z}),n.d(t,"self",function(){return i.W}),n.d(t,"window",function(){return i.ab}),n.d(t,"global",function(){return i.K}),n.d(t,"document",function(){return i.C})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return g}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return b});var i=n(12);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],g=t[13],p=t[14],m=t[15],y=n*s-i*o,b=n*u-r*o,_=n*c-a*o,x=i*u-r*s,w=i*c-a*s,O=r*c-a*u,P=l*g-f*v,S=l*p-h*v,j=l*m-d*v,k=f*p-h*g,C=f*m-d*g,E=h*m-d*p,A=y*E-b*C+_*k+x*j-w*S+O*P;return A?(A=1/A,e[0]=(s*E-u*C+c*k)*A,e[1]=(r*C-i*E-a*k)*A,e[2]=(g*O-p*w+m*x)*A,e[3]=(h*w-f*O-d*x)*A,e[4]=(u*j-o*E-c*S)*A,e[5]=(n*E-r*j+a*S)*A,e[6]=(p*_-v*O-m*b)*A,e[7]=(l*O-h*_+d*b)*A,e[8]=(o*C-s*j+c*P)*A,e[9]=(i*j-n*C-a*P)*A,e[10]=(v*w-g*_+m*y)*A,e[11]=(f*_-l*w-d*y)*A,e[12]=(s*S-o*k-u*P)*A,e[13]=(n*k-i*S+r*P)*A,e[14]=(g*b-v*x-p*y)*A,e[15]=(l*x-f*b+h*y)*A,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],v=e[13],g=e[14],p=e[15];return(t*o-n*a)*(f*p-h*g)-(t*s-i*a)*(l*p-h*v)+(t*u-r*a)*(l*g-f*v)+(n*s-i*o)*(c*p-h*d)-(n*u-r*o)*(c*g-f*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],g=t[12],p=t[13],m=t[14],y=t[15],b=n[0],_=n[1],x=n[2],w=n[3];return e[0]=b*i+_*s+x*f+w*g,e[1]=b*r+_*u+x*h+w*p,e[2]=b*a+_*c+x*d+w*m,e[3]=b*o+_*l+x*v+w*y,b=n[4],_=n[5],x=n[6],w=n[7],e[4]=b*i+_*s+x*f+w*g,e[5]=b*r+_*u+x*h+w*p,e[6]=b*a+_*c+x*d+w*m,e[7]=b*o+_*l+x*v+w*y,b=n[8],_=n[9],x=n[10],w=n[11],e[8]=b*i+_*s+x*f+w*g,e[9]=b*r+_*u+x*h+w*p,e[10]=b*a+_*c+x*d+w*m,e[11]=b*o+_*l+x*v+w*y,b=n[12],_=n[13],x=n[14],w=n[15],e[12]=b*i+_*s+x*f+w*g,e[13]=b*r+_*u+x*h+w*p,e[14]=b*a+_*c+x*d+w*m,e[15]=b*o+_*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,f,h,d,v,g=n[0],p=n[1],m=n[2];return t===e?(e[12]=t[0]*g+t[4]*p+t[8]*m+t[12],e[13]=t[1]*g+t[5]*p+t[9]*m+t[13],e[14]=t[2]*g+t[6]*p+t[10]*m+t[14],e[15]=t[3]*g+t[7]*p+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=v,e[12]=i*g+s*p+f*m+t[12],e[13]=r*g+u*p+h*m+t[13],e[14]=a*g+c*p+d*m+t[14],e[15]=o*g+l*p+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,f,h,d,v,g,p,m,y,b,_,x,w,O,P,S,j,k,C,E=r[0],A=r[1],T=r[2],M=Math.sqrt(E*E+A*A+T*T);return M0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=Ce.a,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return u()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64,a=e.dataChanged;if(this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,Array.isArray(a)){var o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;this._rebuildGeometry(f)}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(je.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.opts=t}return u()(e,[{key:"equals",value:function(e){return this===e||this.constructor===e.constructor&&Object(Le.a)(this.opts,e.opts)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var t=e.constructor.defaultProps,n=void 0===t?{}:t,i={updateTriggers:{}};for(var r in n)if(r in this.props){var a=n[r],o=this.props[r];i[r]=o,a&&"accessor"===a.type&&(i.updateTriggers[r]=this.props.updateTriggers[r],"function"==typeof o&&(i[r]=this.getSubLayerAccessor(o,!0)))}return i}},{key:"initializeState",value:function(e,t){}},{key:"updateState",value:function(e,t){}},{key:"finalizeState",value:function(e){}}]),e}();n.d(t,"experimental",function(){return Re}),n.d(t,"COORDINATE_SYSTEM",function(){return i.a}),n.d(t,"LightingEffect",function(){return r.a}),n.d(t,"PointLight",function(){return m}),n.d(t,"DirectionalLight",function(){return y.a}),n.d(t,"_CameraLight",function(){return _}),n.d(t,"_SunLight",function(){return F}),n.d(t,"PostProcessEffect",function(){return D.a}),n.d(t,"_LayersPass",function(){return N.a}),n.d(t,"Deck",function(){return z.a}),n.d(t,"LayerManager",function(){return B.a}),n.d(t,"AttributeManager",function(){return U.a}),n.d(t,"Layer",function(){return V.a}),n.d(t,"CompositeLayer",function(){return G.a}),n.d(t,"DeckRenderer",function(){return W.a}),n.d(t,"Viewport",function(){return H.a}),n.d(t,"WebMercatorViewport",function(){return X.a}),n.d(t,"project",function(){return q.a}),n.d(t,"project64",function(){return Z.a}),n.d(t,"View",function(){return Y.a}),n.d(t,"MapView",function(){return K.a}),n.d(t,"FirstPersonView",function(){return Q.a}),n.d(t,"ThirdPersonView",function(){return te}),n.d(t,"OrbitView",function(){return ne.a}),n.d(t,"PerspectiveView",function(){return ae}),n.d(t,"OrthographicView",function(){return oe.a}),n.d(t,"Controller",function(){return se.a}),n.d(t,"MapController",function(){return ue.a}),n.d(t,"_FirstPersonController",function(){return ce.a}),n.d(t,"_OrbitController",function(){return le.b}),n.d(t,"_OrthographicController",function(){return fe.a}),n.d(t,"Effect",function(){return he.a}),n.d(t,"TRANSITION_EVENTS",function(){return de.a}),n.d(t,"LinearInterpolator",function(){return ve.a}),n.d(t,"FlyToInterpolator",function(){return Oe}),n.d(t,"log",function(){return Pe.a}),n.d(t,"createIterable",function(){return je.a}),n.d(t,"fp64LowPart",function(){return ke.c}),n.d(t,"AmbientLight",function(){return Me.AmbientLight}),n.d(t,"LayerExtension",function(){return Ie});var Re={Tesselator:Ee,flattenVertices:Se.c,fillArray:Se.a,count:Ae.a,memoize:Te.a}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"e",function(){return d});var i={};function r(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function a(e){return Math.round(e/i.EPSILON)*i.EPSILON}function o(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function O(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.h([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function S(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function j(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){"use strict";var i=n(109),r=n(132),a=n(147),o=n(140),s=n(123),u=n(205),c=n(220),l=n(64),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h={modelMatrix:f,viewMatrix:f,projectionMatrix:f,cameraPositionWorld:[0,0,0]};var d="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",v={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new l.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(d,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(d)},g=n(115),p={lightDirection:new Float32Array([1,1,2])};var m={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[v]},y=n(206),b={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var _={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},x=n(189),w=n(219),O=n(207);n.d(t,"a",function(){return P}),n.d(t,"v",function(){return i.c}),n.d(t,"w",function(){return i.e}),n.d(t,"l",function(){return i.a}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.b}),n.d(t,"q",function(){return o.b}),n.d(t,"n",function(){return s.c}),n.d(t,"m",function(){return s.b}),n.d(t,"y",function(){return s.e}),n.d(t,"x",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u.a}),n.d(t,"k",function(){return c.a}),n.d(t,"u",function(){return v}),n.d(t,"p",function(){return g.a}),n.d(t,"i",function(){return m}),n.d(t,"t",function(){return y.a}),n.d(t,"h",function(){return _}),n.d(t,"o",function(){return x.a}),n.d(t,"s",function(){return x.b}),n.d(t,"r",function(){return w.a}),n.d(t,"b",function(){return O.a});var P={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",uniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(22),l=n(40),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.c(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.j(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.k(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.l(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,n,i){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e[3]=s+i*(n[3]-s),e}function g(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}function p(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function m(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=i.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-u)<=i.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=i.b*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var y,b;y=new i.a(4),i.a!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),b=y},function(e,t,n){e.exports=n(259)()},,function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"g",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"n",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return v}),n.d(t,"a",function(){return g}),n.d(t,"m",function(){return m}),n.d(t,"f",function(){return y});var i=n(12);function r(){var e=new i.a(3);return i.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function l(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function f(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function v(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function g(e,t){var n=o(e[0],e[1],e[2]),i=o(t[0],t[1],t[2]);u(n,n),u(i,i);var r=c(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var p,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},y=a;p=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={LNG_LAT:1,LNGLAT_AUTO_OFFSET:4,METER_OFFSETS:2,LNGLAT_OFFSETS:3,IDENTITY:0}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(32),u=n(11),c=n(52),l=n(59),f=n(30),h=n(118),d=n(234),v=n(19),g=n(26),p={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"},m={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:p},y={removedProps:p},b=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(s.a)(n)),n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=Object(d.a)("Buffer",e,m),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=Object(d.a)("Buffer",e,y))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new l.a(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Object(v.a)(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(Object(f.a)(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return Object(f.a)(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;Object(f.a)(this.gl);var c,l,d=Object(h.c)(this.accessor.type||5126,{clamped:!1}),g=this._getAvailableElementCount(r),p=o;n?c=(l=n.length)-p:l=p+(c=Math.min(g,u||g));var m=Math.min(g,c);return u=u||m,Object(v.a)(u<=m),n=n||new d(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Object(v.a)(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=Object(h.b)(e);return Object(v.a)(i),this.setAccessor(new l.a(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/Object(h.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new l.a(this.accessor,{type:Object(h.b)(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return g.a.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return g.a.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new l.a(this.accessor,e),this}},{key:"type",get:function(){return g.a.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return g.a.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(c.a)},,function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(15),l=n(85),f=n(22),h=n(64),d=n(29),v=n(20),g=n(27),p=n(18),m=Math.PI/180,y=Object(l.a)(),b=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Object(o.b)(t);var r=n.id,a=n.userData,s=void 0===a?{}:a;this.gl=t,this.id=r||Object(u.c)(this.constructor.name),this.userData=s,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=Object(o.d)(this.gl),u={},c=n||Object.keys(r),l=!0,f=!1,h=void 0;try{for(var d,v=c[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value,p=r[g];if(p&&(!("webgl2"in p)||a)&&(!("extension"in p)||this.gl.getExtension(p.extension))){var m=i?Object(s.a)(this.gl,g):g;u[m]=this.getParameter(g,e),i&&"GLenum"===p.type&&(u[m]=Object(s.a)(this.gl,u[m]))}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return u}},{key:"setParameter",value:function(e,t){e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Object(s.b)(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return Object(l.a)(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(f)}},{key:"_deleteHandle",value:function(){throw new Error(f)}},{key:"_bindHandle",value:function(){throw new Error(f)}},{key:"_getOptsFromHandle",value:function(){throw new Error(f)}},{key:"_getParameter",value:function(e,t){throw new Error(f)}},{key:"_setParameter",value:function(e,t){throw new Error(f)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=a.a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;a.a.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=a.a.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=a.a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}()},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(45),l=/([0-9]+\.?[0-9]*)(%|px)/;function f(e){switch(r()(e)){case"number":return{position:e,relative:!1};case"string":var t=e.match(l);if(t&&t.length>=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(105),v=n(18);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,O=t.modelMatrix,P=void 0===O?null:O,S=t.viewportInstance,j=void 0===S?null:S,k=t.type,C=void 0===k?c.a:k;Object(v.a)(!j||j instanceof c.a),this.viewportInstance=j,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(34),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(78),n(89))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(37);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.n([],t,e);return i.k(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(0),r=n(4),a=n(10),o=n(9),s=n(5),u=n(11),c=n(52),l=n(43),f=n(98),h=n(70),d=n(30),v=n(49),g=n(67),p=n(26),m=n(19),y=[9729,9728],b=function(e){function t(e,n){var i;Object(r.a)(this,t);var s=n.id,u=void 0===s?Object(g.c)("texture"):s,c=n.handle,l=n.target;return(i=Object(a.a)(this,Object(o.a)(t).call(this,e,{id:u,handle:c}))).target=l,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&Object(f.d)(e,n))&&(!i||Object(f.e)(e,n))),r}}]),Object(s.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var r=t.pixels,a=void 0===r?null:r,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,v=t.pixelStore,g=void 0===v?{}:v,m=t.textureUnit,y=void 0===m?void 0:m,b=t.unpackFlipY,_=void 0===b||b,x=t.mipmaps,w=void 0===x||x;n||(n=a);var O=t.width,P=t.height,S=t.dataFormat,j=t.type,k=t.depth,C=void 0===k?0:k,E=this._deduceParameters({format:s,type:j,dataFormat:S,compressed:!1,data:n,width:O,height:P});O=E.width,P=E.height,S=E.dataFormat,j=E.type,this.width=O,this.height=P,this.depth=C,this.format=s,this.type=j,this.dataFormat=S,this.border=c,this.textureUnit=y,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var A=Object(i.a)({},37440,_),T=Object.assign({},A,g);return w&&this._isNPOT()&&(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),w=!1,this._updateForNPOT(d)),this.mipmaps=w,this.setImageData({data:n,width:O,height:P,depth:C,format:s,type:j,dataFormat:S,border:c,mipmaps:w,parameters:T}),w&&this.generateMipmap(),this.setParameters(d),f&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.height,n=e.width,i=e.mipmaps,r=void 0!==i&&i;return n!==this.width||t!==this.height?this.initialize({width:n,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,v=e.offset,g=void 0===v?0:v,p=e.parameters,y=void 0===p?{}:p,b=e.data,_=void 0===b?null:b,x=e.type,w=void 0===x?this.type:x,O=e.width,P=void 0===O?this.width:O,S=e.height,j=void 0===S?this.height:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E;_||(_=r);var T=this._deduceParameters({format:u,type:w,dataFormat:C,compressed:A,data:_,width:P,height:j});w=T.type,C=T.dataFormat,A=T.compressed,P=T.width,j=T.height;var M=this.gl;M.bindTexture(this.target,this.handle);var L,I=this._getDataType({data:_,compressed:A});if(_=I.data,L=I.dataType,Object(h.a)(this.gl,y,function(){switch(L){case"null":M.texImage2D(n,o,u,P,j,l,C,w,_);break;case"typed-array":M.texImage2D(n,o,u,P,j,l,C,w,_,g);break;case"buffer":Object(d.a)(M),M.bindBuffer(35052,_.handle||_),M.texImage2D(n,o,u,P,j,l,C,w,g),M.bindBuffer(35052,null);break;case"browser-object":Object(d.d)(M)?M.texImage2D(n,o,u,P,j,l,C,w,_):M.texImage2D(n,o,u,C,w,_);break;case"compressed":M.compressedTexImage2D(n,o,u,P,j,l,_);break;default:Object(m.a)(!1,"Unknown image data type")}}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var R=f.a[this.dataFormat]||4,F=f.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,f=e.y,g=void 0===f?0:f,p=e.width,y=void 0===p?this.width:p,b=e.height,_=void 0===b?this.height:b,x=e.level,w=void 0===x?0:x,O=e.format,P=void 0===O?this.format:O,S=e.type,j=void 0===S?this.type:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E,T=e.offset,M=void 0===T?0:T,L=e.border,I=(void 0===L&&this.border,e.parameters),R=void 0===I?{}:I,F=this._deduceParameters({format:P,type:j,dataFormat:C,compressed:A,data:s,width:y,height:_});if(j=F.type,C=F.dataFormat,A=F.compressed,y=F.width,_=F.height,Object(m.a)(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var D=s;s=D.data,y=D.shape[0],_=D.shape[1]}s instanceof l.a&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,R,function(){A?t.gl.compressedTexSubImage2D(i,w,c,g,y,_,P,s):null===s?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s,M):s instanceof v.b?(Object(d.a)(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,w,c,g,y,_,C,j,M),t.gl.bindBuffer(35052,null)):Object(d.d)(t.gl)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s):t.gl.texSubImage2D(i,w,c,g,C,j,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p.a.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof l.a?{data:t.handle,dataType:"buffer"}:t instanceof v.b?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=f.b[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},Object(m.a)(i,"Could not deduced texture size"),Object(m.a)(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Object(m.a)(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Object(m.a)(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Object(d.d)(this.gl)&&(!(!this.width||!this.height)&&(!Object(g.b)(this.width)||!Object(g.b)(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===y.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(c.a)},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(76);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function o(e){for(var t=1;t0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}n.d(t,"a",function(){return s}),n.d(t,"b",function(){return u})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(36),r=n(4),a=n(5),o=n(67),s=n(19),u={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,e);var n=t.id,i=void 0===n?Object(o.c)("geometry"):n,a=t.drawMode,s=void 0===a?u.TRIANGLES:a,c=t.attributes,l=void 0===c?{}:c,f=t.indices,h=void 0===f?null:f,d=t.vertexCount,v=void 0===d?null:d;this.id=i,this.drawMode=0|s,this.attributes={},this.userData={},this._setAttributes(l,h),this.vertexCount=v||this._calculateVertexCount(this.attributes,this.indices)}return Object(a.a)(e,null,[{key:"DRAW_MODE",get:function(){return u}}]),Object(a.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?Object(i.a)({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Object(s.a)(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||i.size||(i.size=3),"indices"===n?(Object(s.a)(!this.indices),this.indices=i):this.attributes[n]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}return Object(s.a)(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}()},function(e,t,n){"use strict";var i=n(176);function r(e,t,n){return(r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Object(i.a)(a,n.prototype),a}).apply(null,arguments)}var a=n(4),o=n(5),s=n(118),u=n(19),c=n(234);n.d(t,"a",function(){return h});var l={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},f={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},h=function(){function e(){var t=this;Object(a.a)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=Object(c.a)("Accessor",e,f)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(0),r=n(24),a=n(4),o=n(10),s=n(9),u=n(32),c=n(5),l=n(11),f=n(52),h=n(126),d=n(95),v=n(112),g=n(80),p=n(127),m=n(30),y=n(68),b=n(19),_=n(26),x=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this,t),(n=Object(o.a)(this,Object(s.a)(t).call(this,e,i))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(i),Object.seal(Object(u.a)(n)),n}return Object(l.a)(t,e),Object(c.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(c.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(Object(b.a)(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Object(b.a)(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&_.a.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,a=void 0!==i&&i,o=n.resizeAttachments,s=void 0===o||o,u={};a&&Object.keys(this.attachments).forEach(function(e){u[e]=null}),Object.assign(u,e);var c=this.gl.bindFramebuffer(36160,this.handle);for(var l in u){Object(b.a)(void 0!==l,"Misspelled framebuffer binding point?");var f=Number(l),h=u[f],v=h;if(v)if(v instanceof d.a)this._attachRenderbuffer({attachment:f,renderbuffer:v});else if(Array.isArray(h)){var g=Object(r.a)(h,3),p=g[0],m=g[1],y=void 0===m?0:m,_=g[2],x=void 0===_?0:_;v=p,this._attachTexture({attachment:f,texture:p,layer:y,level:x})}else this._attachTexture({attachment:f,texture:v,layer:0,level:0});else this._unattach(f);s&&v&&v.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(w(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&Object(v.a)(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){Object(v.b)({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;Object(m.a)(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Object(y.a)(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?Object(y.a)(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>_.a.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Object(g.b)(this,{maxHeight:100});return _.a.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,r,a){var o,s=null;e&&((s=s||{})[36064]=new h.a(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:r,height:a,mipmaps:!1,parameters:(o={},Object(i.a)(o,10241,9729),Object(i.a)(o,10240,9729),Object(i.a)(o,10242,33071),Object(i.a)(o,10243,33071),o)}));return t&&n?(s=s||{})[33306]=new d.a(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:r,height:111}):t?(s=s||{})[36096]=new d.a(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:r,height:a}):n&&Object(b.a)(!1),s}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof d.a?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Object(b.a)(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;Object(m.d)(t)?t.readBuffer(e):Object(b.a)(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(Object(m.d)(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Object(b.a)(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=Object(p.a)(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(f.a);function w(e){return(x.STATUS||{})[e]||"Framebuffer error ".concat(e)}x.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(9),o=n(5),s=n(11),u=n(162),c=35632,l=35633;function f(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Object(u.a)(t)||"(unnamed)",f="".concat(function(e){switch(e){case c:return"fragment";case l:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),v=0;v1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=d(a,r-o);return s+n+e})}(t);return{shaderName:f,errors:h(a,b),warnings:h(o,b)}}function h(e,t){for(var n="",i=0;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(133).a),p=n(20),m=n(47),y=n(40),b=n(37);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.n(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.n(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.n(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.n(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.n(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(62),r=n(198),a=n(144);function o(e,t,n){var r=i.c[t],o=r?r(e,Number(t)):e.getParameter(Number(t)),s=i.d[t];return Object(a.a)("function"==typeof s),s(e,n,Number(t)),o}function s(e,t){var n={};for(var r in t){var a=Number(r),o=i.d[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],a))}var s=e.state&&e.state.cache;if(s){var u=Object.assign({},s,t);for(var c in n){(0,i.a[c])(e,u)}}}function u(e,t){var n=i.c[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function c(e,t){t=t||i.b;var n=Array.isArray(t)?t:Object.keys(t),r={},a=!0,o=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;r[f]=u(e,f)}}catch(e){o=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return r}function l(e){s(e,Object.assign({},i.b,{}))}function f(e){var t=c(e,Object.keys(i.b)),n={};for(var a in i.b)Object(r.a)(t[a],i.b[a])||(n[a]=t[a]);return n}},function(e,t,n){"use strict";var i=n(9);function r(e,t,n){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(i.a)(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i=n(19),r={};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";r[e]=r[e]||1;var t=r[e]++;return"".concat(e,"-").concat(t)}function o(e){return Object(i.a)("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function s(e){var t=!0;for(var n in e){t=!1;break}return t}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var i=n(19);function r(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var r=e[t=t.replace(/^.*\./,"")];return Object(i.a)(void 0!==r,"Accessing undefined constant GL.".concat(t)),r}function a(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(77),r=n.n(i),a=n(41),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(90),r=n(148),a=n(233),o=n(144);function s(e,t,n){if(Object(a.a)(t))return n(e);var s,u=t.nocatch,c=void 0===u||u;if(Object(o.a)(!t.frameBuffer),Object(i.c)(e),Object(r.a)(e,t),c)s=n(e),Object(i.b)(e);else try{s=n(e)}finally{Object(i.b)(e)}return s}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});var i="vs",r="fs"},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}function o(e){return e&&e[Symbol.asyncIterator]}},function(e,t,n){"use strict";n.d(t,"c",function(){return _}),n.d(t,"a",function(){return x}),n.d(t,"b",function(){return w});var i,r=n(24),a=n(0),o=n(19),s=5120,u=5121,c=5122,l=5123,f=0,h=1,d=2,v=3,g=4,p=5,m=6,y=5126,b=(i={},Object(a.a)(i,y,[y,1,"float"]),Object(a.a)(i,35664,[y,2,"vec2"]),Object(a.a)(i,35665,[y,3,"vec3"]),Object(a.a)(i,35666,[y,4,"vec4"]),Object(a.a)(i,5124,[5124,1,"int"]),Object(a.a)(i,35667,[5124,2,"ivec2"]),Object(a.a)(i,35668,[5124,3,"ivec3"]),Object(a.a)(i,35669,[5124,4,"ivec4"]),Object(a.a)(i,5125,[5125,1,"uint"]),Object(a.a)(i,36294,[5125,2,"uvec2"]),Object(a.a)(i,36295,[5125,3,"uvec3"]),Object(a.a)(i,36296,[5125,4,"uvec4"]),Object(a.a)(i,35670,[y,1,"bool"]),Object(a.a)(i,35671,[y,2,"bvec2"]),Object(a.a)(i,35672,[y,3,"bvec3"]),Object(a.a)(i,35673,[y,4,"bvec4"]),Object(a.a)(i,35674,[y,8,"mat2"]),Object(a.a)(i,35685,[y,8,"mat2x3"]),Object(a.a)(i,35686,[y,8,"mat2x4"]),Object(a.a)(i,35675,[y,12,"mat3"]),Object(a.a)(i,35687,[y,12,"mat3x2"]),Object(a.a)(i,35688,[y,12,"mat3x4"]),Object(a.a)(i,35676,[y,16,"mat4"]),Object(a.a)(i,35689,[y,16,"mat4x2"]),Object(a.a)(i,35690,[y,16,"mat4x3"]),i);function _(e){switch(e){case f:return f;case h:case v:case d:return h;case g:case p:case m:return g;default:return Object(o.a)(!1),0}}function x(e){var t=b[e];if(!t)return null;var n=Object(r.a)(t,2);return{type:n[0],components:n[1]}}function w(e,t){switch(e){case s:case u:case c:case l:e=y}for(var n in b){var i=Object(r.a)(b[n],3),a=i[0],o=i[1],f=i[2];if(a===e&&o===t)return{glType:n,name:f}}return null}},function(e,t,n){"use strict";n.d(t,"e",function(){return y}),n.d(t,"d",function(){return b}),n.d(t,"b",function(){return _}),n.d(t,"a",function(){return w}),n.d(t,"c",function(){return O});var i,r=n(0),a=n(60),o=n(95),s=n(56),u=n(26),c=(i={},Object(r.a)(i,5126,function(e,t,n){return e.uniform1fv(t,g(n,1))}),Object(r.a)(i,35664,function(e,t,n){return e.uniform2fv(t,g(n,2))}),Object(r.a)(i,35665,function(e,t,n){return e.uniform3fv(t,g(n,3))}),Object(r.a)(i,35666,function(e,t,n){return e.uniform4fv(t,g(n,4))}),Object(r.a)(i,5124,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35667,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35668,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35669,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35670,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35671,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35672,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35673,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,g(n,4))}),Object(r.a)(i,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,g(n,9))}),Object(r.a)(i,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,g(n,16))}),Object(r.a)(i,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,5125,function(e,t,n){return e.uniform1uiv(t,m(n,1))}),Object(r.a)(i,36294,function(e,t,n){return e.uniform2uiv(t,m(n,2))}),Object(r.a)(i,36295,function(e,t,n){return e.uniform3uiv(t,m(n,3))}),Object(r.a)(i,36296,function(e,t,n){return e.uniform4uiv(t,m(n,4))}),Object(r.a)(i,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,g(n,6))}),Object(r.a)(i,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,g(n,8))}),Object(r.a)(i,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,g(n,6))}),Object(r.a)(i,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,g(n,12))}),Object(r.a)(i,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,g(n,8))}),Object(r.a)(i,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,g(n,12))}),Object(r.a)(i,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36311,function(e,t,n){return e.uniform1i(t,n)}),i),l={},f={},h={},d=[0];function v(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(d[0]=e,e=d);var r=e.length;if(r%t&&u.a.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&uHTMLVideoElement.HAVE_METADATA&&(i.width!==o.videoWidth||i.height!==o.videoHeight?(i.resize({width:o.videoWidth,height:o.videoHeight,mipmaps:!0}),i.setSubImageData({data:o,paramters:P})):i.setSubImageData({data:o}),i.generateMipmap());i&&r&&r.setUniforms(Object.assign({},t,{bitmapTexture:i,desaturate:s,transparentColor:u.map(function(e){return e/255}),tintColor:c.slice(0,3).map(function(e){return e/255})})).draw()}},{key:"loadTexture",value:function(e){var t=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),e instanceof O.a?this.setState({bitmapTexture:e}):e instanceof HTMLVideoElement?this.setState({bitmapTexture:new O.a(t,{width:1,height:1,parameters:P,mipmaps:!1})}):e&&this.setState({bitmapTexture:new O.a(t,{data:e,parameters:P})})}},{key:"calculatePositions",value:function(e){var t=e.value,n=this.state.positions;t.set(n)}},{key:"calculatePositions64xyLow",value:function(e){var t=this.use64bitPositions();(e.constant=!t,t)?e.value.set(this.state.positions.map(b.c)):e.value=new Float32Array(4)}}]),t}(_.a);S.layerName="BitmapLayer",S.defaultProps={image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};var j,k=n(72),C=n(80),E=n(122),A=1024,T=4,M=function(){},L=(j={},y()(j,10241,9987),y()(j,10240,9729),j);function I(e){return e&&(e.id||e.url)}function R(e,t,n){for(var i=0;i0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&(R(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&R(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new O.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:L})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(C.f)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:L}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(E.b)(e.url).then(function(r){var a=I(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},L,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),D=[0,0,0,255],N={iconAtlas:{type:"object",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},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:D},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},z=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new F(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:D},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s||this.props._asyncPropOriginalValues.iconAtlas?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),r.extensionsChanged){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(k.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=Object(b.c)(p[0]),a[o++]=Object(b.c)(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(_.a);z.layerName="IconLayer",z.defaultProps=N;var B=n(222),U=n(192),V=[0,0,0,255],G=[0,0,1],W=new U.a,H={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:G},getColor:{type:"accessor",value:V},material:W,radiusPixels:{deprecatedFor:"pointSize"}};var X=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:G},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:V}})}},{key:"updateState",value:function(e){var n,i,r,a=e.props,o=e.oldProps,s=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:a,oldProps:o,changeFlags:s}),s.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),this.getAttributeManager().invalidateAll()}s.dataChanged&&(n=a.data,i=n.header,r=n.attributes,i&&r&&(n.length=i.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION,r.instancePositions64xyLow={constant:!0,value:new Float32Array(2)}),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0&&(r.instanceColors=r.COLOR_0)))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(k.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var _=s(y,h);u[c++]=Object(b.c)(_[0]),u[c++]=Object(b.c)(_[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(_.a);X.layerName="PointCloudLayer",X.defaultProps=H;var q=n(171),Z=n(170),Y=n(217),K=n(114),Q=n(218),J=n(223),$=n(193),ee=n(16),te=n.n(ee),ne=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position); \n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getParagraphSize,f=r.getRowSize,h=r.getOffsets,d=e.value,v=n*e.size,g=Object(k.a)(a,n,i).iterable,p=!0,m=!1,y=void 0;try{for(var b,_=g[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){var x=b.value,w=o[s(x)]||{},O=l(x),P=te()(O,2),S=P[0],j=P[1],C=f(x),E=te()(C,1)[0],A=h(x),T=te()(A,2),M=T[0],L=T[1],I=u(x),R=c(x),F=(1-I)*(S-E)/2;d[v++]=(I-1)*S/2+F+w.width/2+M||0,d[v++]=(R-1)*j/2+w.height/2+L||0}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(k.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(z);ne.layerName="MultiIconLayer",ne.defaultProps={getRowSize:{type:"accessor",value:function(e){return e.rowSize||[0,0]}},getOffsets:{type:"accessor",value:function(e){return e.offsets||[0,0]}},getParagraphSize:{type:"accessor",value:function(e){return e.size||[1,1]}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ie=n(231),re=n.n(ie),ae=n(15),oe=32;function se(e,t,n,i,r){var a=e.split("\n"),o=[0,0],s=0;a.forEach(function(e){var a=function(e,t,n){var i=0,r=0,a=Array.from(e);return{characters:a=a.map(function(e,a){var o={text:e,offsetLeft:i},s=t[e];return s?(i+=s.width,r||(r=s.height*n)):(ae.a.warn("Missing character: ".concat(e))(),i+=oe),o}),rowWidth:i,rowHeight:r}}(e,n,t),u=a.characters,c=a.rowWidth,l=a.rowHeight,f=[c,l];u.forEach(function(e){e.offsetTop=s,e.size=o,e.rowSize=f,r.push(i(e))}),s+=l,o[0]=Math.max(o[0],c)}),o[1]=s}var ue=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ce=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),le="Monaco, monospace",fe="normal",he=64,de=2,ve=.25,ge=3,pe=new ue(3),me=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function ye(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};me.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=pe.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=pe.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),pe.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");be(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(be(h,r,o,a),u){var b=new re.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,O=void 0;try{for(var P,S=t[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;ye(b.draw(j),_),h.putImageData(_,v[j].x-s,v[j].y-s)}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}}else{var k=!0,C=!1,E=void 0;try{for(var A,T=t[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h.fillText(M,v[M].x,v[M].y+.9*o)}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=pe.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),xe=n(139),we={fontSize:he,buffer:de,sdf:!1,radius:ge,cutoff:ve},Oe={start:1,middle:0,end:-1},Pe={top:1,center:0,bottom:-1},Se=["fontSize","buffer","sdf","radius","cutoff"],je={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ce,fontFamily:le,fontWeight:fe,lineHeight:1,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},ke=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new _e(this.context.gl)}}},{key:"updateState",value:function(e){var t=this,n=e.props,i=e.oldProps,r=e.changeFlags,a=this.fontChanged(i,n);a&&this.updateFontAtlas({oldProps:i,props:n});var o=r.dataChanged||a||n.lineHeight!==i.lineHeight||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText);if(o&&Array.isArray(r.dataChanged)){var s=this.state.data.slice(),u=r.dataChanged.map(function(e){return Object(xe.a)({data:s,getIndex:function(e){return e.__source.index},dataRange:e,replace:t.transformStringToLetters(e)})});this.setState({data:s,dataDiff:u})}else o&&this.setState({data:this.transformStringToLetters(),dataDiff:null})}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},we,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return Se.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,r=n.lineHeight,a=n.getText,o=this.state.iconMapping,s=t.startRow,u=t.endRow,c=Object(k.a)(i,s,u),l=c.iterable,f=c.objectInfo,h=[],d=!0,v=!1,g=void 0;try{for(var p,m=function(){var t=p.value;f.index++;var n=a(t,f);n&&se(n,r,o,function(n){return e.getSubLayerRow(n,t,f.index)},h)},y=l[Symbol.iterator]();!(d=(p=y.next()).done);d=!0)m()}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}return h}},{key:"getAnchorXFromTextAnchor",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Oe[e]||0}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Pe[e]||0}}},{key:"renderLayers",value:function(){var e=this.state,t=e.data,n=e.dataDiff,i=e.scale,r=e.iconAtlas,a=e.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.billboard,g=o.sdf,p=o.sizeScale,m=o.sizeUnits,y=o.sizeMinPixels,b=o.sizeMaxPixels,_=o.transitions,x=o.updateTriggers;return new(this.getSubLayerClass("characters",ne))({sdf:g,iconAtlas:r,iconMapping:a,_dataDiff:n&&function(){return n},getPosition:this.getSubLayerAccessor(s),getColor:this.getSubLayerAccessor(u),getSize:this.getSubLayerAccessor(c),getAngle:this.getSubLayerAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this.getSubLayerAccessor(d),getPickingIndex:function(e){return e.__source.index},billboard:v,sizeScale:p*i,sizeUnits:m,sizeMinPixels:y*i,sizeMaxPixels:b*i,transitions:_&&{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:x.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:x.getPixelOffset,getAnchorX:x.getTextAnchor,getAnchorY:x.getAlignmentBaseline}}),{data:t,getIcon:function(e){return e.text},getRowSize:function(e){return e.rowSize},getOffsets:function(e){return[e.offsetLeft,e.offsetTop]},getParagraphSize:function(e){return e.size}})}}]),t}($.a);ke.layerName="TextLayer",ke.defaultProps=je;var Ce=n(131);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return S}),n.d(t,"IconLayer",function(){return z}),n.d(t,"LineLayer",function(){return B.a}),n.d(t,"PointCloudLayer",function(){return X}),n.d(t,"ScatterplotLayer",function(){return q.a}),n.d(t,"ColumnLayer",function(){return Z.a}),n.d(t,"GridCellLayer",function(){return Y.a}),n.d(t,"PathLayer",function(){return K.a}),n.d(t,"PolygonLayer",function(){return Q.a}),n.d(t,"GeoJsonLayer",function(){return J.a}),n.d(t,"TextLayer",function(){return ke}),n.d(t,"SolidPolygonLayer",function(){return Ce.a}),n.d(t,"_MultiIconLayer",function(){return ne})},function(e,t,n){"use strict";var i=n(43),r=n(60),a=n(56),o=n(70),s=n(30),u=n(118),c=n(19);function l(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(c.a)(!1),0}}var f=n(159),h=n(26);function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,f=t.sourceAttachment,h=void 0===f?36064:f,d=t.target,v=void 0===d?null:d,g=t.sourceWidth,p=t.sourceHeight,m=t.sourceType,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=_.attachments;g=g||_.width,p=p||_.height,36064===h&&null===O&&(h=1028),Object(c.a)(P[h]),v=function(e,t,n,i,r){if(e)return e;t=t||5121;var a=Object(u.c)(t,{clamped:!1}),o=l(n);return new a(i*r*o)}(v,m=m||P[h].type,s,g,p),m=m||Object(u.b)(v);var S=w.bindFramebuffer(36160,O);return w.readPixels(i,a,g,p,s,m,v),w.bindFramebuffer(36160,S||null),x&&_.delete(),v}function v(e,t){var n=t.sourceX,r=void 0===n?0:n,a=t.sourceY,u=void 0===a?0:a,f=t.sourceFormat,h=void 0===f?6408:f,d=t.target,v=void 0===d?null:d,g=t.targetByteOffset,p=void 0===g?0:g,m=t.sourceWidth,y=t.sourceHeight,_=t.sourceType,x=b(e),w=x.framebuffer,O=x.deleteFramebuffer;Object(c.a)(w);var P=w.gl;if(m=m||w.width,y=y||w.height,Object(s.a)(P),_=_||(v?v.type:5121),!v){var S=l(h),j=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(c.a)(!1),0}}(_),k=p+m*y*S*j;v=new i.a(P,{byteLength:k,accessor:{type:_,size:S}})}return v.bind({target:35051}),Object(o.a)(P,{framebuffer:w},function(){P.readPixels(r,u,m,y,h,_,p)}),v.unbind({target:35051}),O&&w.delete(),v}function g(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=d(e,{sourceAttachment:i}),s=e.width,c=e.height;c>a;){var l=Object(u.d)({data:o,width:s,height:c});o=l.data,s=l.width,c=l.height}Object(u.a)({data:o,width:s,height:c});var f=document.createElement("canvas");f.width=s,f.height=c;var h=f.getContext("2d"),v=h.createImageData(s,c);return v.data.set(o),h.putImageData(v,0,0),f.toDataURL()}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=g(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,o=n.sourceY,s=void 0===o?0:o,u=n.targetX,l=n.targetY,f=n.targetZ,h=n.targetMipmaplevel,d=void 0===h?0:h,v=n.targetInternalFormat,g=void 0===v?6408:v,p=n.width,m=n.height,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=void 0!==u||void 0!==l||void 0!==f;u=u||0,l=l||0,f=f||0;var S=w.bindFramebuffer(36160,O);Object(c.a)(t);var j=null;if(t instanceof a.a&&(j=t,p=Number.isFinite(p)?p:j.width,m=Number.isFinite(m)?m:j.height,j.bind(0),t=j.target),P)switch(t){case 3553:case 34067:w.copyTexSubImage2D(t,d,u,l,r,s,p,m);break;case 35866:case 32879:w.copyTexSubImage3D(t,d,u,l,f,r,s,p,m)}else w.copyTexImage2D(t,d,g,r,s,p,m,0);return j&&j.unbind(),w.bindFramebuffer(36160,S||null),x&&_.delete(),j}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,u=n.sourceY0,l=void 0===u?0:u,f=n.sourceX1,d=n.sourceY1,v=n.targetX0,g=void 0===v?0:v,p=n.targetY0,m=void 0===p?0:p,y=n.targetX1,_=n.targetY1,x=n.color,w=void 0===x||x,O=n.depth,P=void 0!==O&&O,S=n.stencil,j=void 0!==S&&S,k=n.mask,C=void 0===k?0:k,E=n.filter,A=void 0===E?9728:E,T=b(e),M=T.framebuffer,L=T.deleteFramebuffer,I=b(t),R=I.framebuffer,F=I.deleteFramebuffer;Object(c.a)(M),Object(c.a)(R);var D=R.gl,N=R.handle,z=R.width,B=R.height,U=R.readBuffer;Object(s.a)(D),M.handle||36064!==r||(r=1028),w&&(C|=16384),P&&(C|=256),j&&(C|=1024),(L||F)&&1280&C&&(C=16384,h.a.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Object(c.a)(C),f=void 0===f?M.width:f,d=void 0===d?M.height:d,y=void 0===y?z:y,_=void 0===_?B:_;var V=D.bindFramebuffer(36009,N),G=D.bindFramebuffer(36008,M.handle);return D.readBuffer(r),D.blitFramebuffer(o,l,f,d,g,m,y,_,C,A),D.readBuffer(U),D.bindFramebuffer(36008,G||null),D.bindFramebuffer(36009,V||null),L&&M.delete(),F&&R.delete(),R}function b(e){return e instanceof r.a?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Object(f.b)(e),deleteFramebuffer:!0}}n.d(t,"e",function(){return d}),n.d(t,"f",function(){return v}),n.d(t,"b",function(){return g}),n.d(t,"c",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return y})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(179),v=n(22),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(81),u=n(180),c=n(18),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(82),u=n(15),c=n(18),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,e.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){if(!this.isDragging())return!1;var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState,r={};switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut(),r.isZooming=!0;break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn(),r.isZooming=!0;break;case 37:n?(t=i.rotateLeft(),r.isRotating=!0):(t=i.moveLeft(),r.isPanning=!0);break;case 39:n?(t=i.rotateRight(),r.isRotating=!0):(t=i.moveRight(),r.isPanning=!0);break;case 38:n?(t=i.rotateUp(),r.isRotating=!0):(t=i.moveUp(),r.isPanning=!0);break;case 40:n?(t=i.rotateDown(),r.isRotating=!0):(t=i.moveDown(),r.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),r),!0}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";var i=n(205),r=n(42),a=Object.keys(r.a).map(function(e){return"const float COORDINATE_SYSTEM_".concat(e," = ").concat(r.a[e],".;")}).join(""),o="".concat(a,"\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform float project_uAntimeridian;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n dy = clamp(dy, -1., 1.);\n }\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n"),s=n(136),u={};t.a={name:"project",dependencies:[i.a],vs:o,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?Object(s.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return v});var i=n(29);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-t[2],-t[6],-t[10]],up:[t[1],t[5],t[9]],right:[t[0],t[4],t[8]]}}var o=new i.a,s=new i.a,u=new i.a,c=new i.a,l=new i.a,f=new i.a,h=new i.a;function d(e){var t=e.aspect,n=e.near,r=e.far,a=e.fovyRadians,d=e.position,v=e.direction,g=e.up,p=e.right;s.copy(v);var m=1/s.len();s.normalize(),o.copy(d),u.copy(g).normalize(),c.copy(p).normalize();var y=2*Math.tan(a/2)*n,b=y*t;l.copy(s).scale(n*m).add(o),f.copy(s).scale(r*m).add(o);var _=s.clone().negate(),x=_.dot(l),w={near:{distance:x,normal:_},far:{distance:s.dot(f),normal:s.clone()}};return h.copy(c).scale(.5*b).add(l).subtract(o).normalize(),_=new i.a(u).cross(h),x=o.dot(_),w.right={normal:_,distance:x},h.copy(c).scale(.5*-b).add(l).subtract(o).normalize(),_=new i.a(h).cross(u),x=o.dot(_),w.left={normal:_,distance:x},h.copy(u).scale(.5*y).add(l).subtract(o).normalize(),_=new i.a(h).cross(c),x=o.dot(_),w.top={normal:_,distance:x},h.copy(u).scale(.5*-y).add(l).subtract(o).normalize(),_=new i.a(c).cross(h),x=o.dot(_),w.bottom={normal:_,distance:x},w}function v(e){return e-Math.fround(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(96),r=n(54);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t){var n,i,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),Object(c.a)(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(78))},function(e,t,n){"use strict";var i=n(36),r=n(90),a=n(49),o="Failed to create WebGL context in Node.js, headless gl not available",s="Failed to create WebGL context in Node.js, headless gl returned null";var u=n(125);var c=n(111),l=(n(19),n(110)),f=n(26),h=n(46);n.d(t,"e",function(){return g}),n.d(t,"a",function(){return p}),n.d(t,"c",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"d",function(){return b});function d(e){return Boolean(e&&2===e._version)}var v={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(v,{width:1,height:1},e)}function p(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},v,t),r=n.width,h=n.height;function g(e){if(t.throwOnError)throw new Error(e);return null}if(l.a){var p=t.canvas;e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(Object(u.a)({canvas:p,width:r,height:h,onError:g}),t)}else e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,u=e.onError;if(r&&!i)return u("headless-gl does not support WebGL2");if(!a.c)return u(o);var c=Object(a.c)(t,n,e);return c||u(s)}(Object(i.a)({},t,{width:r,height:h,onError:g}));return e?(function(e){var t=d(e)?"WebGL2":"WebGL1",n=Object(c.a)(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";f.a.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=m(e,t)),e):null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==a.a&&e instanceof a.a)return 2;return 1}(e);var n=t=Object.assign({},v,t),i=n.manageState,o=n.debug;return i&&Object(r.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(5),a=n(29),o=n(64),s=n(67),u=n(19),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id;this.id=n||Object(s.c)(this.constructor.name),this.display=!0,this.position=new a.a,this.rotation=new a.a,this.scale=new a.a(1,1,1),this.matrix=new o.a,this.userData={},this.props={},this._setScenegraphNodeProps(t)}return Object(r.a)(e,[{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:"setPosition",value:function(e){return Object(u.a)(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return Object(u.a)(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return Object(u.a)(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Object(u.a)(e),t=t||this.matrix;var n=new o.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{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)}}]),e}()},function(e,t,n){"use strict";var i=n(0),r=n(36),a=n(4),o=n(5),s=n(10),u=n(9),c=n(66),l=n(11),f=n(43),h=n(202),d=n(19),v={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function g(e,t){var n=(t||{}).attributeMap,i=void 0===n?v:n;return i&&i[e]||e}function p(e,t){var n;switch(e){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2}Object(d.a)(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var m=n(30),y=n(203),b=n(177),_=n(197),x=n(28),w=n(132),O=n(208),P=n(209),S=n(210),j=n(41),k=n.n(j),C=n(46),E={},A=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},T=new Map;k.a.listenFor("luma.gl",function(e){var t=E[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){C.d.__SEER_INITIALIZED__&&(T.has(e)||T.set(e,new Map),T.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();A(i,n,e.value),t.setUniforms(i)}});var M=n(67),L=n(26),I=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),Object(d.a)(Object(m.c)(t));var i=n.id,r=void 0===i?Object(M.c)("base-model"):i;this.id=r,this.gl=t,this.id=n.id||Object(M.c)("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(o.a)(e,[{key:"initialize",value:function(e){this.props={},this.program=this._createProgram(e),this.vertexArray=new y.a(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete E[t],k.a.deleteItem("luma.gl",t)}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.uniforms}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),function(e,t){if(C.d.__SEER_INITIALIZED__&&e){var n=T.get(e);n&&n.forEach(function(e,n){A(t,n,e)})}}(this.id,e),e=this._extractAnimatedUniforms(e),this.program.setUniforms(e),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,s=t.attributes,u=void 0===s?{}:s,c=t.transformFeedback,l=void 0===c?this.transformFeedback:c,f=t.parameters,h=void 0===f?{}:f,d=t.vertexArray,v=void 0===d?this.vertexArray:d,g=t.animationProps;E[(e=this).id]||(E[e.id]=e,k.a.listItem("luma.gl",e.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(g);var p=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&L.a.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,b=m.indexType,_=m.indexOffset,x=this.isInstanced,w=this.instanceCount,O=function(){},P=this.props,S=P.onBeforeRender,j=void 0===S?O:S,C=P.onAfterRender,A=void 0===C?O:C;j(),this._timerQueryStart();var T=this.program.draw(Object.assign({},t,{logPriority:p,uniforms:null,framebuffer:r,parameters:h,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:b,isInstanced:x,instanceCount:w,offset:y?_:0}));return this._timerQueryEnd(),A(),this._logDrawCallEnd(p,v,r),T}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&b.a.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&L.a.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,s=e.defines,u=void 0===s?{}:s,c=e.inject,l=void 0===c?{}:c,f=e.shaderCache,h=void 0===f?null:f,v=e.varyings,g=void 0===v?null:v,p=e.bufferMode,m=void 0===p?35981:p,y=e.program,b=void 0===y?null:y;this.getModuleUniforms=function(e){};var O=this.id;if(!b){n=n||x.a.vs,r=r||x.a.fs;var P=Object(w.a)(this.gl,{vs:n,fs:r,modules:o,inject:l,defines:u,log:L.a});n=P.vs,r=P.fs,b=h?h.getProgram(this.gl,{id:O,vs:n,fs:r}):new _.a(this.gl,{id:O,vs:n,fs:r,varyings:g,bufferMode:m}),this.getModuleUniforms=P.getUniforms||function(e){}}return Object(d.a)(b instanceof _.a,"Model needs a program"),b}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!Object(M.a)(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new b.a(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,L.a.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(L.a.priority>> DRAWING MODEL ".concat(this.id),{collapsed:L.a.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=Object(O.a)({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=Object(P.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,c=Object(P.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),l=c.table;c.count>0&&L.a.log("MISSING UNIFORMS",Object.keys(l))(),u>0&&L.a.log("UNUSED UNIFORMS",Object.keys(s))();var f=Object(S.a)(this.vertexArray.configuration);L.a.table(e,r)(),L.a.table(e,o)(),L.a.table(e+1,f)(),function(e,t){if(k.a.isReady()&&!k.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);k.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),L.a.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}();n.d(t,"a",function(){return R});var R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,t);var i=n.id,o=void 0===i?Object(M.c)("model"):i;return Object(s.a)(this,Object(u.a)(t).call(this,e,Object(r.a)({},n,{id:o})))}return Object(l.a)(t,e),Object(o.a)(t,[{key:"initialize",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Object(d.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){Object(c.a)(Object(u.a)(t.prototype),"delete",this).call(this),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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Object(d.a)(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Object(d.a)(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=function(e,t,n){var i={},a=t.indices;for(var o in t.attributes){var s=t.attributes[o],u=g(o,n);if("indices"===o)a=s;else if(s.constant)i[u]=s.value;else{var c=s.value,l=Object(r.a)({},s);delete l.value,i[u]=[new f.a(e,c),l],p(o,l)}}if(a){var h=a.value||a;Object(d.a)(h instanceof Uint16Array||h instanceof Uint32Array,'attribute array for "indices" must be of integer type');var v={size:1,isIndexed:void 0===a.isIndexed||a.isIndexed};i.indices=[new f.a(e,{data:h,target:34963}),v]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(M.a)(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,r=e.feedbackBuffers,a=e.unbindModels,o=void 0===a?[]:a,s=e.parameters;r&&this._setFeedbackBuffers(r),n&&(s=Object.assign({},s,Object(i.a)({},35977,n))),o.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:s}))}finally{o.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return L.a.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof f.a&&t.delete()}}},{key:"_setAnimationProps",value:function(e){if(this.animated){Object(d.a)(e,"Model.draw(): animated uniforms but no animationProps");var t=this._evaluateAnimateUniforms(e);this.program.setUniforms(t)}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(M.a)(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new h.a(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}}]),t}(I)},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,i))).initialize(i),Object.seal(Object(s.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=Object(v.d)(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,d)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(u.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Object(g.a)(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Object(v.d)(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*d[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(174),r="7.2.0-beta.3",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return h});var i,r,a,o=n(0),s=n(30),u=(i={},Object(o.a)(i,6407,{dataFormat:6407,types:[5121,33635]}),Object(o.a)(i,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(o.a)(i,6406,{dataFormat:6406,types:[5121]}),Object(o.a)(i,6409,{dataFormat:6409,types:[5121]}),Object(o.a)(i,6410,{dataFormat:6410,types:[5121]}),Object(o.a)(i,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(o.a)(i,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(o.a)(i,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(o.a)(i,34836,{dataFormat:6408,types:[5126],gl2:!0}),i),c=(r={},Object(o.a)(r,6403,1),Object(o.a)(r,36244,1),Object(o.a)(r,33319,2),Object(o.a)(r,33320,2),Object(o.a)(r,6407,3),Object(o.a)(r,36248,3),Object(o.a)(r,6408,4),Object(o.a)(r,36249,4),Object(o.a)(r,6402,1),Object(o.a)(r,34041,1),Object(o.a)(r,6406,1),Object(o.a)(r,6409,1),Object(o.a)(r,6410,2),r),l=(a={},Object(o.a)(a,5126,4),Object(o.a)(a,5125,4),Object(o.a)(a,5124,4),Object(o.a)(a,5123,2),Object(o.a)(a,5122,2),Object(o.a)(a,5131,2),Object(o.a)(a,5120,1),Object(o.a)(a,5121,1),a);function f(e,t){var n=u[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=Object(s.d)(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}function h(e,t){var n=u[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},,function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(10),a=n(9),o=n(11),s=n(93),u=n(58),c="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",l=[-1,-1,1,-1,-1,1,1,1],f=function(e){function t(e,n){var o;Object(i.a)(this,t);var s=l.map(function(e){return-1===e?0:e});return(o=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},n,{vs:c,geometry:new u.a({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(l)},aTexCoord:{size:2,value:new Float32Array(s)},aCoordinate:{size:2,value:new Float32Array(s)}}})})))).setVertexCount(4),o}return Object(o.a)(t,e),t}(s.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(178),v=n(70),g=n(112),p=n(148),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.a)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.a)(e,{scissorTest:!0,scissor:l},function(){return Object(g.a)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(p.a)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,mousePosition:e.context.mousePosition,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.a)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i,r=n(0),a=n(30),o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",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"};t.b=(i={},Object(r.a)(i,o.WEBGL2,[function(e){return Object(a.d)(e)}]),Object(r.a)(i,o.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(r.a)(i,o.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(r.a)(i,o.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(r.a)(i,o.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(r.a)(i,o.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(r.a)(i,o.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(r.a)(i,o.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(r.a)(i,o.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(r.a)(i,o.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(r.a)(i,o.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(r.a)(i,o.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(r.a)(i,o.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(r.a)(i,o.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),i)},function(e,t,n){"use strict";function i(e,t){return e===t||Object.keys(e).every(function(n){return Array.isArray(e[n])&&Array.isArray(t[n])?i(e[n],t[n]):e[n]===t[n]})}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(32),o=n(9),s=n(66),u=n(5),c=n(11),l=n(52),f=n(43),h=n(30),d=null;function v(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!d||d.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var u=s.id||s.program&&s.program.id;return(n=Object(r.a)(this,Object(o.a)(t).call(this,e,Object.assign({},s,{id:u})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(s),Object.seal(Object(a.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?Object(h.d)(e)||"Chrome"===function(e){if(!e&&!Object(m.a)())return"Node";if(Object(y.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":p.b.chrome?"Chrome":p.b.safari?"Safari":p.b.mozInnerScreenX?"Firefox":"Unknown"}():Object(h.d)(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Object(g.a)(!1)}}}]),Object(u.a)(t,[{key:"delete",value:function(){Object(s.a)(Object(o.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(g.a)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Object(g.a)(Object(h.d)(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new f.a(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=v(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof a.a)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof a.a)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new a.a(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"e",function(){return c}),n.d(t,"a",function(){return l}),n.d(t,"c",function(){return f}),n.d(t,"d",function(){return h}),n.d(t,"b",function(){return d});var u=new s;function c(e){u.setDefaultShaderModules(e)}function l(){return u.getDefaultShaderModules()}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;u.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(u.defaultShaderModules),v(e=u.resolveModules(e))}function d(e){return u.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,a=t.color,l=void 0===a?null:a,f=t.depth,h=void 0===f?null:f,d=t.stencil,g=void 0===d?null:d,p={};i&&(p.framebuffer=i);var m=0;l&&(m|=c,!0!==l&&(p.clearColor=l)),h&&(m|=s,!0!==h&&(p.clearDepth=h)),g&&(m|=u,!0!==h&&(p.clearStencil=h)),Object(o.a)(0!==m,v),Object(r.a)(e,p,function(){e.clear(m)})}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,s=void 0===n?null:n,u=t.buffer,c=void 0===u?l:u,g=t.drawBuffer,p=void 0===g?0:g,m=t.value,y=void 0===m?[0,0,0,0]:m;Object(a.a)(e),Object(r.a)(e,{framebuffer:s},function(){switch(c){case l:switch(y.constructor){case Int32Array:e.clearBufferiv(c,p,y);break;case Uint32Array:e.clearBufferuiv(c,p,y);break;case Float32Array:default:e.clearBufferfv(c,p,y)}break;case f:e.clearBufferfv(f,0,[y]);break;case h:e.clearBufferiv(h,0,[y]);break;case d:var t=Object(i.a)(y,2),n=t[0],r=t[1];e.clearBufferfi(d,0,n,r);break;default:Object(o.a)(!1,v)}})}},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=function(e){function t(e){var n;r()(this,t),n=u()(this,l()(t).call(this,e));var i=e._shadow,a=void 0!==i&&i;return n.shadow=a,n}return h()(t,e),o()(t,[{key:"getProjectedLight",value:function(){return this}}]),t}(n(146).b)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(130),p=n(93),m=n(58),y=n(21),b=n(85),_=y.experimental.Tesselator,x=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3,padding:3},endPositions:{size:3,padding:3},segmentTypes:{size:1,type:Uint8ClampedArray},startPositions64XyLow:{size:2,padding:2,fp64Only:!0},endPositions64XyLow:{size:2,padding:2,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){var t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t<3?0:t+1:t-1}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.startPositions64XyLow,o=n.endPositions64XyLow,s=n.segmentTypes,u=this.fp64,c=t.geometrySize;if(0!==c)for(var l,f,h=this.isClosed(e),d=t.vertexStart,v=0;v=e.length&&(t+=1-e.length/n),[e[t*n],e[t*n+1],3===n?e[t*n+2]:0]}return t>=e.length&&(t+=1-e.length),e[t]}},{key:"isClosed",value:function(e){var t=this.getPathLength(e),n=this.getPointOnPath(e,0),i=this.getPointOnPath(e,t-1);return n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]}}]),t}(_);n.d(t,"a",function(){return S});var w=[0,0,0,255],O={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:w},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},P={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceLeftStartPositions64xyLow;\nattribute vec4 instanceEndRightPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width, vec2 widthPixels\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(vCornerOffset * widthPixels * isValid, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n return currPoint + vec3(offset.xy / widthPixels * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n vec2 width = billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width, widthPixels\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.worldPosition = instanceStartPositions;\n geometry.worldPositionAlt = instanceEndPositions;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceLeftStartPositions64xyLow.xy, instanceLeftStartPositions64xyLow.zw, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceLeftStartPositions64xyLow.zw, instanceEndRightPositions64xyLow.xy, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceEndRightPositions64xyLow.xy, instanceEndRightPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({startPositions:{size:3,offset:12,transition:P,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{offset:0},instanceStartPositions:{offset:12}}},endPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0,shaderAttributes:{instanceEndPositions:{offset:0},instanceRightPositions:{offset:12}}},instanceLeftStartPositions64xyLow:{size:4,stride:8,update:this.calculateLeftStartPositions64xyLow,noAlloc:!0},instanceEndRightPositions64xyLow:{size:4,stride:8,update:this.calculateEndRightPositions64xyLow,noAlloc:!0},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:P,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:P,defaultValue:w},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new x({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions(),dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),r.dataChanged||a.invalidateAll()}if(r.extensionsChanged){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.a({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateSegmentTypes",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("segmentTypes")}},{key:"calculateLeftStartPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startPositions64XyLow"):new Float32Array(4)}},{key:"calculateEndRightPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("endPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,o=n.pointLights,s=n.directionalLights,u=i||o&&o.length>0||s&&s.length>0;return u?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,o=void 0===r?[]:r,s={};s["lighting_uAmbientLight.color"]=t?a(t):[0,0,0];return i.forEach(function(e,t){s["lighting_uPointLight[".concat(t,"].color")]=a(e),s["lighting_uPointLight[".concat(t,"].position")]=e.position,s["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),s.lighting_uPointLightCount=i.length,o.forEach(function(e,t){s["lighting_uDirectionalLight[".concat(t,"].color")]=a(e),s["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),s.lighting_uDirectionalLightCount=o.length,s}({ambientLight:i,pointLights:o,directionalLights:s}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var c={pointLights:[],directionalLights:[]},l=!0,f=!1,h=void 0;try{for(var d,v=(t.lights||[])[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;switch(g.type){case"ambient":c.ambientLight=g;break;case"directional":c.directionalLights.push(g);break;case"point":c.pointLights.push(g)}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return e({lightSources:c})}return{}},defines:{MAX_LIGHTS:3}},{});function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o});var i=n(57),r={};function a(e){e=Array.isArray(e)?e:[e];var t=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var u=o.value,c=Object(i.b)(u),l=!0,f=!1,h=void 0;try{for(var d,v=c.extensions[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;r[g]=c}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}}catch(e){n=!0,a=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}}function o(){return Object.values(r)}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"d",function(){return s});var i="Failed to deduce GL constant from typed array";function r(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(i)}}function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u=24&&2303741511===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint32(16,u),height:e.getUint32(20,u)}}}],["image/jpeg",{test:function(e){return e.byteLength>=2&&65496===e.getUint16(0,u)},getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,u))return null;var t=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),n=t.tableMarkers,i=t.sofMarkers,r=2;for(;r=10&&1195984440===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint16(6,c),height:e.getUint16(8,c)}}}],["image/bmp",{test:function(e){return e.byteLength>=2&&16973===e.getUint16(0,u)},getSize:function(e){return{width:e.getUint32(18,c),height:e.getUint32(22,c)}}}]]);var f="Invalid MIME type. Supported MIME types are: ".concat(Array.from(l.keys()).join(", "));function h(e){var t=g(e),n=!0,i=!1,r=void 0;try{for(var a,o=l.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=Object(s.a)(a.value,2),c=u[0];if((0,u[1].test)(t))return c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(0,v(t=t||h(e)).getSize)(g(e));if(!n)throw new Error("invalid image data for type: ".concat(t));return n}(e,t=t||h(e));return n.mimeType=t,n}function v(e){var t=l.get(e);if(!t)throw new Error(f);return t}function g(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}n.d(t,"a",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"e",function(){return _}),n.d(t,"c",function(){return x});var p=o.a._parseImageNode||"undefined"!=typeof ImageBitmap;function m(e,t){if(o.a._parseImageNode){var n=d(e).mimeType;return o.a._parseImageNode(e,n,t)}return _(e,t)}function y(e){return b.apply(this,arguments)}function b(){return(b=Object(a.a)(r.a.mark(function e(t){var n,i,a,o=arguments;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:{},"undefined"!=typeof Image){e.next=9;break}return e.next=4,fetch(t,n);case 4:return i=e.sent,e.next=7,i.arrayBuffer();case 7:return a=e.sent,e.abrupt("return",m(a,n));case 9:return e.next=11,x(t,n);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _(e,t){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var n=new Blob([new Uint8Array(e)]);return createImageBitmap(n,{imageOrientation:t.imageOrientation||"none",premultiplyAlpha:t.premultiplyAlpha||"default"})}function x(e,t){return w.apply(this,arguments)}function w(){return(w=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(24),r=n(119),a="void main() {gl_FragColor = vec4(0);}",o="#version 300 es\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}";function s(e,t){t=Array.isArray(t)?t:[t];var n=e.replace(/^\s+/,"").split(/\s+/),r=Object(i.a)(n,3),a=r[0],o=r[1],s=r[2];return t.includes(a)&&o&&s?{qualifier:a,type:o,name:s.split(";")[0]}:null}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var i=n(19),r="";function a(e){r=e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)("string"==typeof e),e=r+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function s(e,t){return Object(i.a)("string"==typeof e),e=r+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i,r=n(110).a&&"undefined"!=typeof document,a=r&&"complete"===document.readyState;function o(){return i||(i=r?new Promise(function(e,t){if(r&&"complete"===document.readyState)return a=!0,void e(document);window.onload=function(){a=!0,e(document)}}):Promise.resolve({})),i}function s(e){var t,n=e.canvas,i=e.width,r=e.height,o=e.onError,s=void 0===o?function(){}:o;return"string"==typeof n?(a||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:s}),t}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(56),l=n(30),f=n(124),h=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.b)(e),(s instanceof Promise||"string"==typeof s)&&(s={data:s}),"string"==typeof s.data&&(s=Object.assign({},s,{data:Object(f.b)(s.data)})),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},s,{target:3553})))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e,t){return c.a.isSupported(e,t)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return u});var i=n(104),r=n(30),a=n(19);function o(e,t){return s(e,t)}function s(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return c(e,t)})}function u(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=Object(r.d)(e),i.b)e.luma.caps[t]=c(e,t);return e.luma.caps}function c(e,t){var n=i.b[t];Object(a.a)(n,t);var o,s=Object(r.d)(e)&&n[1]||n[0];if("function"==typeof s)o=s(e);else if(Array.isArray(s)){o=!0;var u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;o=o&&Boolean(e.getExtension(d))}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}else"string"==typeof s?o=Boolean(e.getExtension(s)):"boolean"==typeof s?o=s:Object(a.a)(!1);return o}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(4),r=function e(){Object(i.a)(this,e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return O});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(184),v=n(22),g=n(83),p=n(137),m=n(81),y=n(82),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,O=void 0===w?b.minZoom:w,P=e.maxZoom,S=void 0===P?b.maxZoom:P,j=e.startPanPosition,k=e.startTarget,C=e.startRotationX,E=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:O,maxZoom:S})))._interactiveState={startPanPosition:j,startTarget:k,startRotationX:C,startRotationOrbit:E,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c=Object.keys(t),l=0;l=0&&n.modules.splice(i,1)}return"inject"in t&&(n.inject=Object.assign({},e.inject,t.inject)),n}var T=n(151),M=n(99),L=n(72),I={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return N(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return R(e,t)}},accessor:{validate:function(e,t){var n=z(e);return"function"===n||n===z(t.value)},equal:function(e,t,n){return"function"==typeof t||R(e,t)}},array:{validate:function(e,t){return t.optional&&!e||N(e)},equal:function(e,t,n){return n.compare?R(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function R(e,t){if(e===t)return!0;if(!N(e)||!N(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=Q,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):Object(L.b)(t)?this._resolveAsyncIterable(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){t=n._postProcessValue(e,t),n._setAsyncPropValue(e,t,r);var i=n.layer.props.onDataLoad;"data"===e&&i&&i(t,{propName:e,layer:n.layer})}).catch(function(e){return C.a.error(e)()})}},{key:"_resolveAsyncIterable",value:function(){var e=Z()(X.a.mark(function e(t,n){var i,r,a,o,s,u,c,l,f,h,d,v;return X.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"data"!==t&&this._setPropValue(t,n),(i=this.asyncProps[t]).pendingLoadCount++,r=i.pendingLoadCount,a=[],o=0,s=!0,u=!1,e.prev=8,l=K()(n);case 10:return e.next=12,l.next();case 12:return f=e.sent,s=f.done,e.next=16,f.value;case 16:if(h=e.sent,s){e.next=26;break}d=h,a=this._postProcessValue(t,d,a),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:o,endRow:a.length}]}),o=a.length,this._setAsyncPropValue(t,a,r);case 23:s=!0,e.next=10;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(8),u=!0,c=e.t0;case 32:if(e.prev=32,e.prev=33,s||null==l.return){e.next=37;break}return e.next=37,l.return();case 37:if(e.prev=37,!u){e.next=40;break}throw c;case 40:return e.finish(37);case 41:return e.finish(32);case 42:(v=this.layer.props.onDataLoad)&&v(a,{propName:t,layer:this.layer});case 44:case"end":return e.stop()}},e,this,[[8,28,32,42],[33,,37,41]])}));return function(t,n){return e.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(e,t,n){var i=(this.component?this.component.props:{}).dataTransform;return"data"!==e?t:i?i(t,n):n?n.concat(t):t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),$=0,ee=function(){function e(){o()(this,e),this.props=function(){for(var e=U(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i2&&void 0!==arguments[2]?arguments[2]:{}).url,i=null;return i=(i=i||function(e,t){var n=t.match(Pe),i=n&&n[0];return i&&function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object(xe.b)(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(e,i)}(t,void 0===n?"":n))||function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if("string"==typeof t){if(je(t,s))return s}else if(t instanceof ArrayBuffer&&ke(t,s))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(t,e)}function je(e,t){return t.testText&&t.testText(e)}function ke(e,t){switch(Array.isArray(t.test)?"array":Object(se.a)(t.test)){case"function":return t.test(e,t);case"string":case"array":return(Array.isArray(t.test)?t.test:[t.test]).some(function(t){return t===function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;if(e.byteLength<=t+n)return"";for(var i=new DataView(e),r="",a=0;a0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{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:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(T.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(ne.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(T.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){C.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){C.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitPositions",value:function(){return this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return C.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.props.extensions[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=A(e,o.getShaders.call(this,o))}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return e}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();if(t.dataChanged&&n){var i=t.dataChanged;if(Array.isArray(i)){var r=!0,a=!1,o=void 0;try{for(var s,u=i[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;n.invalidateAll(c)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}else n.invalidateAll()}}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(C.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(C.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;this._setModelAttributes(o,e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"_updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}}},{key:"updateTransition",value:function(){var e=this.getAttributeManager();e&&e.updateTransition(this.context.time)}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.numInstances,i=e.value,r=e.size;if(1!==i[0]){var a=qe.length/r;if(a2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=Object(O.c)(v),o[2*l+1]=Object(O.c)(g)),s[l]=1,l++}if(h)for(var m=0;m2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(147);n.d(t,"c",function(){return k}),n.d(t,"b",function(){return C}),n.d(t,"a",function(){return E});var w="\n\n".concat(x.a,"\n\n"),O=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),S={},j="precision highp float;\n\n";function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function C(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);S[e]=S[e]||{},S[e][o]=S[e][o]||{},Object(s.a)(!S[e][o][n],"Module injection already created"),S[e][o][n]={injection:i,order:a}}function E(e,t){var n=t.vs,i=t.fs,r=Object(o.d)(t.modules||[]);return{gl:e,vs:A(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:A(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:T(r),modules:M(r)}}function A(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=t.defines,c=void 0===u?{}:u,l=t.inject,f=void 0===l?{}:l,h=t.prologue,v=void 0===h||h,p=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var b=r===a.b,_=i.split("\n"),k=100,C="",E=i;0===_[0].indexOf("#version ")&&(k=300,C=_[0],E=_.slice(1).join("\n"));var A={};o.forEach(function(e){Object.assign(A,e.getDefines())}),Object.assign(A,c);var T=v?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(O[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(O[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(A),"\n").concat(b?"":j,"\n"):"".concat(C,"\n"),M=!1,L={},I={};for(var R in f){var F="string"==typeof f[R]?{injection:f[R],order:0}:f[R];R.match(/^(v|f)s:/)?"#"===R[3]?I[R]=[F]:L[R]=[F]:I[R]=[F]}var D=!0,N=!1,z=void 0;try{for(var B,U=o[Symbol.iterator]();!(D=(B=U.next()).done);D=!0){var V=B.value;switch(V.name){case"inject":M=!0;break;default:if(p&&V.checkDeprecations(E,p),T+=V.getModuleSource(r,k),S[V.name]){var G=S[V.name][r];for(var W in G)W.match(/^(v|f)s:#/)?(I[W]=I[W]||[],I[W].push(G[W])):(L[W]=L[W]||[],L[W].push(G[W]))}}}}catch(e){N=!0,z=e}finally{try{D||null==U.return||U.return()}finally{if(N)throw z}}return T+=w,T+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,L),T+=E,T=Object(x.c)(T,r,I,M)}function T(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function M(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.b)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(134),c=n(22),l=function(e,t){if(!e)throw new Error(t)},f=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t=0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(29),u=n(201),c=n(18),l={position:[0,0,0],lookAt:[0,0,0],up:[0,0,1],rotationX:0,rotationY:0,fov:50,near:1,far:100},f=function(){function e(t){r()(this,e);var n=t.width,i=t.height,a=t.position,o=void 0===a?l.position:a;Object(c.a)(Number.isFinite(n),"`width` must be supplied"),Object(c.a)(Number.isFinite(i),"`height` must be supplied"),this._viewportProps=this._applyConstraints(Object.assign({},t,{position:new s.a(o)}))}return o()(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getDirection",value:function(){return new u.a({bearing:this._viewportProps.bearing,pitch:this._viewportProps.pitch}).toVector3().normalize()}},{key:"getDirectionFromBearing",value:function(e){return new u.a({bearing:e,pitch:90}).toVector3().normalize()}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}()},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function i(e){for(var t=e.data,n=e.getIndex,i=e.dataRange,r=e.replace,a=i.startRow,o=void 0===a?0:a,s=i.endRow,u=void 0===s?1/0:s,c=t.length,l=c,f=c,h=0;hh&&d>=o&&(l=h),d>=u){f=h;break}}for(var v=l,g=f-l!==r.length,p=g&&t.slice(f),m=0;m=t.min)}},array:{validate:function(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function c(e){var t=l(e);return"object"===t?e?"type"in e?Object.assign({},e,u[e.type]):"value"in e?(t=l(e.value),Object.assign({type:t},e,u[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},u[t])}function l(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":Object(s.a)(e)}n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var f=function(){function e(t){var n=t.name,r=t.vs,a=t.fs,s=t.dependencies,u=void 0===s?[]:s,l=t.uniforms,f=t.getUniforms,h=t.deprecations,d=void 0===h?[]:h,v=t.defines,g=void 0===v?{}:v,p=t.vertexShader,m=t.fragmentShader;Object(i.a)(this,e),Object(o.a)("string"==typeof n),this.name=n,this.vs=r||p,this.fs=a||m,this.getModuleUniforms=f,this.dependencies=u,this.deprecations=this._parseDeprecationDefinitions(d),this.defines=g,l&&(this.uniforms=function(e){var t={};for(var n in e){var i=c(e[n]);t[n]=i}return t}(l))}return Object(r.a)(e,[{key:"getModuleSource",value:function(e,t){var n;switch(e){case"vs":n=a(this.vs||"",t,!0);break;case"fs":n=a(this.fs||"",t,!1);break;default:Object(o.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase(),"\n").concat(n,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,t){this.deprecations.forEach(function(n){n.regex.test(e)&&(n.deprecated?t.deprecated(n.old,n.new)():t.removed(n.old,n.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=this.uniforms;for(var i in n){var r=n[i];i in e&&!r.private?(r.validate&&Object(o.a)(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function h(e){if(!e.normalized&&(e.normalized=!0,e.uniforms&&!e.getUniforms)){var t=new f(e);e.getUniforms=t.getUniforms.bind(t)}return e}},function(e,t,n){"use strict";n.d(t,"b",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"a",function(){return g});var i=n(230),r=n.n(i);function a(e){if(e=e&&e.positions||e,!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new Error("invalid polygon")}function o(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(97),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return p}),n.d(t,"c",function(){return m});var i=n(5),r=n(10),a=n(9),o=n(11),s=n(4),u=n(29),c=n(67),l=[255,255,255],f=[0,0,1],h=[0,0,-1],d=[0,0,1],v=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e),this.id=t.id||Object(c.c)("light");var n=t.color,i=void 0===n?l:n;this.color=i;var r=t.intensity,a=void 0===r?1:r;this.intensity=a},g=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="ambient",e}return Object(o.a)(t,e),t}(v),p=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="directional";var i=n.direction,o=void 0===i?h:i;return e.direction=new u.a(o).normalize().toArray(),e}return Object(o.a)(t,e),t}(v),m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="point";var i=n.position,o=void 0===i?d:i;return e.position=o,e.attenuation=e._getAttenuation(n),e}return Object(o.a)(t,e),Object(i.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:f}}]),t}(v)},function(e,t,n){"use strict";var i,r=n(0),a=n(71),o=n(119);n.d(t,"a",function(){return u}),n.d(t,"c",function(){return h}),n.d(t,"b",function(){return d});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u="__LUMA_INJECT_DECLARATIONS__",c=/void main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,f=[];function h(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),f.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(65),r=n(24),a=n(25);function o(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var s={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(a.a)(t))},blendEquation:function(e,t){t=o(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(a.a)(t))},blendFunc:function(e,t){t=o(t)&&2===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,e.blendFuncSeparate.apply(e,Object(a.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(a.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(a.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(a.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(a.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(a.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(a.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=o(t)?t:[t,t],i=Object(r.a)(n,2),a=i[0],s=i[1];e.stencilMaskSeparate(1028,a),e.stencilMaskSeparate(1029,s)},stencilFunc:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilFuncSeparate(1028,s,u,c),e.stencilFuncSeparate(1029,l,f,h)},stencilOp:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilOpSeparate(1028,s,u,c),e.stencilOpSeparate(1029,l,f,h)},viewport:function(e,t){return e.viewport.apply(e,Object(a.a)(t))}};function u(e,t){for(var n in Object(i.f)(e,t),t){var r=s[n];r&&r(e,t[n],n)}}n.d(t,"a",function(){return u})},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(126),v=n(109),g=n(146),p=n(113),m=n(103),y=n(64),b=n(29),_=n(8),x=n.n(_),w=n(13),O=n.n(w),P=n(102),S=n(95),j=n(60),k=n(70),C=function(e){function t(e,n){var i,a,o;return r()(this,t),(o=u()(this,l()(t).call(this,e,n))).shadowMap=new d.a(e,{width:1,height:1,parameters:(i={},x()(i,10241,9729),x()(i,10240,9729),x()(i,10242,33071),x()(i,10243,33071),i)}),o.depthBuffer=new S.a(e,{format:33189,width:1,height:1}),o.fbo=new j.a(e,{id:"shadowmap",width:1,height:1,attachments:(a={},x()(a,36064,o.shadowMap),x()(a,36096,o.depthBuffer),a)}),o}return h()(t,e),o()(t,[{key:"render",value:function(e){var n=this,i=this.fbo;Object(k.a)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var r=e.viewports[0],a=r.width*n.props.pixelRatio,o=r.height*n.props.pixelRatio;a===i.width&&o===i.height||i.resize({width:a,height:o}),O()(l()(t.prototype),"render",n).call(n,Object.assign(e,{outputBuffer:i}))})}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,drawToShadowMap:!0,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{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)}}]),t}(P.a),E=n(163);n.d(t,"a",function(){return L});var A={color:[255,255,255],intensity:1},T=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],M=[0,0,0,200/255],L=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],n.shadowColor=M,n.shadowPasses=[],n.dummyShadowMaps=[],n.shadow=!1,e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n._applyDefaultLights(),n.directionalLights.some(function(e){return e.shadow})&&(n.shadow=!0,n._addShadowModule()),n}return h()(t,e),o()(t,[{key:"prepare",value:function(e,t){var n=t.layers,i=t.viewports,r=t.onViewportActive,a=t.views,o=t.pixelRatio;if(!this.shadow)return{};var s=this._createLightMatrix();0===this.shadowPasses.length&&this._createShadowPasses(e,o),0===this.dummyShadowMaps.length&&this._createDummyShadowMaps(e);for(var u=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.a)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new g.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(p.a)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(178).a),y=n(140);n.d(t,"a",function(){return b});var b=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(y.b)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=w(t),a=new m(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=w(t,r),s="".concat(n,"-").concat(a);return new m(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return _(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return x(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(16),r=n.n(i),a=n(31),o=n(136),s=n(37),u=n(40),c=n(27);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.n([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.m(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.overAlloc,i=void 0===n?2:n,a=t.poolSize,o=void 0===a?100:a;r()(this,e),this.overAlloc=i,this.poolSize=o,this._pool=[]}return o()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=void 0===i?1:i,a=n.type,o=n.padding,s=void 0===o?0:o,u=n.copy,c=void 0!==u&&u,l=a||e&&e.constructor||Float32Array,f=t*r+s;if(ArrayBuffer.isView(e)){if(f<=e.length)return e;if(f*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new l(e.buffer,0,f)}var h=this._allocate(l,f);return e&&c?h.set(e):h.fill(0,0,4),this._release(e),h}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,t){t=Math.max(Math.ceil(t*this.overAlloc),1);var n=this._pool,i=e.BYTES_PER_ELEMENT*t,r=n.findIndex(function(e){return e.byteLength>=i});return r>=0?new e(n.splice(r,1)[0],0,t):new e(t)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.poolSize&&t.shift()}}}]),e}();t.a=new s},function(e,t){function n(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise(function(r,a){var o=e.apply(t,i);function s(e){n(o,r,a,s,u,"next",e)}function u(e){n(o,r,a,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(32),c=n(24),l=n(55),f=n(27),h=n(20),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(200),p=n(47);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,O=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(f.l)(g);x=Math.max(.75,x);var S=Object(f.g)([d,l],P);S[2]=0;var j=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:O||1.01}),k=Object(f.f)({height:s,center:S,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:k,projectionMatrix:j}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=P,e.center=S,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,,function(e,t,n){"use strict";(function(e){var t=n(97),i=n(143);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return u({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},Object(a.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=s(t),r=o(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}}))},function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return l});var i=n(0),r=n(126),a=n(160),o=n(161),s=n(60),u=n(19);function c(e,t){Object(u.a)(e instanceof r.a||e instanceof a.a||e instanceof o.a);var n=e.constructor,i=e.gl,s=e.width,c=e.height,l=e.format,f=e.type,h=e.dataFormat,d=e.border,v=e.mipmaps;return new n(i,Object.assign({width:s,height:c,format:l,type:f,dataFormat:h,border:d,mipmaps:v},t))}function l(e,t){var n=e.gl,r=e.width,a=e.height,o=e.id;return new s.a(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(i.a)({},36064,e)}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(50),r=n.n(i),a=n(116),o=n(4),s=n(5),u=n(10),c=n(9),l=n(32),f=n(11),h=n(56),d=n(30),v=n(26),g=[34069,34070,34071,34072,34073,34074],p=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,t),Object(d.b)(e),(n=Object(u.a)(this,Object(c.a)(t).call(this,e,Object.assign({},i,{target:34067})))).initialize(i),Object.seal(Object(l.a)(n)),n}return Object(f.a)(t,e),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(a.a)(r.a.mark(function e(t){var n,i,a,o,s,u,c,l,f,h,d,p,m,y=this;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,a=t.pixels,o=t.data,s=t.border,u=void 0===s?0:s,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,p=a||o,e.next=5,Promise.all(g.map(function(e){var t=p[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:m=e.sent,this.bind(),g.forEach(function(e,t){m[t].length>1&&!1!==y.opts.mipmaps&&v.a.warn("".concat(y.id," has mipmap and multiple LODs."))(),m[t].forEach(function(t,r){n&&i?d.texImage2D(e,r,l,n,i,u,l,h,t):d.texImage2D(e,r,l,l,h,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(h.a);p.FACES=g},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(70),l=n(30),f=n(56),h=n(98),d=n(43),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.a)(e),s=Object.assign({depth:1},s,{target:32879,unpackFlipY:!1}),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(s.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,l=void 0===u?1:u,f=e.border,v=void 0===f?0:f,g=e.format,p=e.type,m=void 0===p?5121:p,y=e.offset,b=void 0===y?0:y,_=e.data,x=e.parameters,w=void 0===x?{}:x;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(c.a)(this.gl,w,function(){ArrayBuffer.isView(_)&&t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,_),_ instanceof d.a&&(t.gl.bindBuffer(35052,_.handle),t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,b))}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var O=h.a[this.dataFormat]||4,P=h.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*O*P,"Texture")}return this.loaded=!0,this}}]),t}(f.a)},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(77),r=n.n(i),a=n(16),o=n.n(a),s=n(132),u=n(42),c=n(64),l=n(29),f=n(94),h=n(27),d=Object(f.a)(function(e){var t=e.viewport,n=e.center;return new c.a(t.viewProjectionMatrix).invert().transformVector4(n)}),v=Object(f.a)(function(e){var t=e.viewport,n=e.shadowMatrices,i=[],a=t.pixelUnprojectionMatrix,s=[[0,0],[t.width,0],[0,t.height],[t.width,t.height],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(function(e){return function(e,t){var n=o()(e,3),i=n[0],r=n[1],a=n[2],s=Object(h.h)([i,r,a],t);if(Number.isFinite(a))return s;return[s[0],s[1],0]}(e,a)}),u=!0,f=!1,d=void 0;try{for(var v,g=function(){var e=v.value,n=e.clone().translate(new l.a(t.center).negate()),a=s.map(function(e){return n.transformVector3(e)}),o=(new c.a).ortho({left:Math.min.apply(Math,r()(a.map(function(e){return e[0]}))),right:Math.max.apply(Math,r()(a.map(function(e){return e[0]}))),bottom:Math.min.apply(Math,r()(a.map(function(e){return e[1]}))),top:Math.max.apply(Math,r()(a.map(function(e){return e[1]}))),near:Math.min.apply(Math,r()(a.map(function(e){return-e[2]}))),far:Math.max.apply(Math,r()(a.map(function(e){return-e[2]})))});i.push(o.multiplyRight(e))},p=n[Symbol.iterator]();!(u=(v=p.next()).done);u=!0)g()}catch(e){f=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(f)throw d}}return i});Object(s.b)("shadow",{hook:"vs:DECKGL_FILTER_GL_POSITION",injection:"\nposition = shadow_setVertexPosition(geometry.position);\n "}),Object(s.b)("shadow",{hook:"fs:DECKGL_FILTER_COLOR",injection:"\ncolor = shadow_filterShadowColor(color);\n "});var g=[0,0,0,1],p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];t.a={name:"shadow",dependencies:["project"],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap[max_lights];\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[i], shadow_uShadowMap[i]) * shadow_uColor.a / shadow_uLightCount;\n }\n }\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){var n={},i=e.shadowEnabled;return(void 0===i||i)&&e.shadowMatrices&&e.shadowMatrices.length>0?Object.assign(n,function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||g,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=d({viewport:e.viewport,center:t.project_uCenter}),r=[],a=v({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice(),o=0;o0?n["shadow_uShadowMap[".concat(f,"]")]=e.shadowMaps[f]:n["shadow_uShadowMap[".concat(f,"]")]=e.dummyShadowMaps[0];return n}(e,t)):Object.assign(n,{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}),n}return{}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(165),g=n(172),p=function(e){function t(e){return r()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:v.a})))}return h()(t,e),o()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.a})}}]),t}(d.a);p.displayName="MapView"},function(e,t,n){"use strict";n.d(t,"a",function(){return O});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(87),p=n.n(g),m=n(45),y=n(27),b=n(200),_=n(47),x=n(18),w="Illegal argument to WebMercatorViewport",O=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,O=void 0!==w&&w,P=n.width,S=n.height,j=n.altitude,k=void 0===j?1.5:j;P=P||1,S=S||1,k=Math.max(.75,k);var C=Object(y.e)({width:P,height:S,pitch:d,altitude:k,nearZMultiplier:b,farZMultiplier:x}),E=C.fov,A=C.aspect,T=C.focalDistance,M=C.near,L=C.far,I=Object(y.f)({height:S,pitch:d,bearing:g,altitude:k}),R=Object.assign({},n,{width:P,height:S,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:O,fovyRadians:E,aspect:A,orthographicFocalDistance:T,near:M,far:L});return(e=l()(this,h()(t).call(this,R))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=k,e.orthographic=O,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);O.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(77),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(18),l=n(190),f=n(41),h=n.n(f),d=n(130),v=n(99),g=n(15),p=n(75),m=n(267),y=n(45),b=n(69),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,mousePosition:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l.a({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(83),p=n(137),m=n(22),y=n(29);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(83),v=n(129),g=n(81),p=n(82),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(16),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(13),v=n.n(d),g=n(7),p=n.n(g),m=n(43),y=n(18),b=n(72),_=n(75),x=[],w=[[0,1/0]];var O=n(15),P=n(127),S=n(104),j=n(59),k=n(67),C=n(26),E=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(k.c)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(P.b)(t,S.a.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a),this._setAccessor(e);for(var o=this.elementOffset,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({offset:n.offset,stride:n.stride,normalized:n.normalized},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,T,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"delete",value:function(){v()(h()(t.prototype),"delete",this).call(this),A.a.release(this.userData.allocatedValue)}},{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;if(t.update){Object(y.a)(Number.isFinite(e));var n=Math.max(e,1),i=L(this.type||5126),r=t.allocatedValue,a=t.updateRanges!==w;return this.constant=!1,this.value=A.a.allocate(r,n,{size:this.size,type:i,padding:this.elementOffset,copy:a}),this.buffer&&this.buffer.byteLength=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return n+e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(E);function L(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}var I=n(224);function R(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.a){var l=new Float32Array(r),f=t.getData({}),h=n.size,d=n.constant,v=d?n.getValue():n.getBuffer().getData({}),g=d?function(e,t){return c(v,t)}:function(e,t){return c(v.subarray(e,e+h),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.offset,a=void 0===r?0:r,o=e.getData,s=e.sourceLayout,u=e.targetLayout;if(!Array.isArray(u))return R({source:t,target:n,getData:o}),n;for(var c=a,l=a,f=o&&function(e,t){return o(e+l,t)},h=Math.min(s.length,u.length),d=0;d0),this.needsRedraw=!0;var n=Object.assign({},U,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return H});function G(){}var W={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;O.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;W.savedMessages=[],W.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;W.savedMessages&&W.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-W.timeStart),a="".concat(r,"ms");O.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=W.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;O.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}O.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),W.savedMessages=null}},H=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new V(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(W.onLog=t||G),void 0!==n&&(W.onUpdateStart=n||G),void 0!==i&&(W.onUpdate=i||G),void 0!==r&&(W.onUpdateEnd=r||G)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in W.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h]||t.attributes&&t.attributes[h])||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&W.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&O.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new M(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),O.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&W.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);W.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(192),b=n(93),_=n(229),x=n.n(_),w=n(15),O=n(67),P=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(O.c)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;w.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:j},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:j},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=r.extensionsChanged;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new P({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);w.layerName="ScatterplotLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(22),p=n(83),m=n(137),y=n(154),b=n(55),_=85.05113,x=-85.05113;var w=n(18),O=n(81),P=n(82);n.d(t,"a",function(){return A});var S={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new O.a,transitionInterruption:P.a.BREAK},j={transitionDuration:0},k={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},C={pitch:0,bearing:0,altitude:1.5},E=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?C.bearing:c,d=n.pitch,v=void 0===d?C.pitch:d,g=n.altitude,p=void 0===g?C.altitude:g,m=n.maxZoom,y=void 0===m?k.maxZoom:m,b=n.minZoom,_=void 0===b?k.minZoom:b,x=n.maxPitch,O=void 0===x?k.maxPitch:x,P=n.minPitch,S=void 0===P?k.minPitch:P,j=n.startPanLngLat,E=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,M=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:O,minPitch:S})))._interactiveState={startPanLngLat:j,startZoomLngLat:E,startBearing:A,startPitch:T,startZoom:M},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,E,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return S}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,j,{isDragging:!0,isRotating:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(15),u=n(6),c=n.n(u),l=n(3),f=n.n(l),h=n(13),d=n.n(h),v=n(7),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(102).a),m=n(182),y=n(183),b=n(150),_=n(60);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h,pixelRatio:this.pixelRatio}),m=this.lastPostProcessEffect?this.screenBuffer:_.a.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.a(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.a(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.a.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(34),r=n(175);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(89))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(34);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(89))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(127),f=n(104),h=n(30),d=n(19),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(h.d)(e),i=Object(l.c)(e,f.a.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Object(d.a)(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(s.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(22),u=n(18),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(35),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(102),p=n(70),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.a)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";function i(e){return e&&"undefined"!=typeof window?window.devicePixelRatio:1}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(47),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,r=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,r=void 0===n?16:n,a=t.size,o=void 0===a?1:a,s="[",u=0;u0&&(s+=",".concat(u%o==0?" ":"")),s+=i(e[u],t);var c=e.length>r?"...":"]";return"".concat(s).concat(c)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return r?"0":"0.";if(r)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var a=e.toPrecision(2);return a.indexOf(".0")===a.length-2?a.slice(0,-1):a}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var i=n(115),r="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var a={name:"gouraud-lighting",dependencies:[i.a],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:u},o={name:"phong-lighting",dependencies:[i.a],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:u},s={};function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor.map(function(e){return e/255}),t}(t):{lighting_uEnabled:!1}}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(4),r=n(5),a=n(61),o=n(197),s=n(19),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Object(s.a)(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new a.c(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new a.a(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Object(s.a)(this._compareContexts(e,this.gl)),Object(s.a)("string"==typeof t.vs),Object(s.a)("string"==typeof t.fs),Object(s.a)("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new o.a(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(36),r=n(4),a=n(10),o=n(9),s=n(11),u=n(58),c=n(67),l=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]),f=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]),h=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]),d=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]),v={POSITION:{size:3,value:new Float32Array(f)},NORMAL:{size:3,value:new Float32Array(h)},TEXCOORD_0:{size:2,value:new Float32Array(d)}},g=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.id,s=void 0===n?Object(c.c)("cube-geometry"):n;return Object(a.a)(this,Object(o.a)(t).call(this,Object(i.a)({},e,{id:s,indices:{size:1,value:new Uint16Array(l)},attributes:Object(i.a)({},v,e.attributes)})))}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(11),u=n(128),c={ambient:.35,diffuse:.6,shininess:32,specularColor:[30,30,30]},l=function(e){function t(e){var n;return Object(i.a)(this,t),n=Object(r.a)(this,Object(a.a)(t).call(this,e)),e=Object.assign({},c,e),Object.assign(Object(o.a)(n),e),n}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(130),p=n(15),m=n(75),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){h()(l()(t.prototype),"setState",this).call(this,e),this.setLayerNeedsUpdate()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?Object.assign(t,{object:n.__source.object,index:n.__source.index}):t}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerRow",value:function(e,t,n){return e.__source={parent:this,object:t,index:n},e}},{key:"getSubLayerAccessor",value:function(e){if("function"==typeof e){var t={data:this.props.data,target:[]};return function(n,i){return n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,i)}}return e}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,f=t.coordinateOrigin,h=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,g=t.extensions,p=t._subLayerProps,m={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:v,extensions:g};if(e){var y=p&&p[e.id],b=y&&y.updateTriggers;Object.assign(m,e,y,{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers,b)})}var _=!0,x=!1,w=void 0;try{for(var O,P=g[Symbol.iterator]();!(_=(O=P.next()).done);_=!0){var S=O.value,j=S.getSubLayerProps.call(this,S);Object.assign(m,j,{updateTriggers:Object.assign(m.updateTriggers,j.updateTriggers)})}}catch(e){x=!0,w=e}finally{try{_||null==P.return||P.return()}finally{if(x)throw w}}return m}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?p.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,p.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(g.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(166),l=n(18),f=n(105),h=n(53),d=n(45),v=n(15),g=n(75),p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return u()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i={x:e[0],y:e[1]},r=n.length-1;r>=0;--r){var a=n[r];if(a.containsPixel(i)){var o=e.slice();return o[0]-=a.x,o[1]-=a.y,a.unproject(o,t)}}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(l.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(g.b)(e,{filter:Boolean}).map(function(e){return e instanceof d.a?new h.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(f.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):v.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),m=n(164),y=n(149),b=new y.a,_=function(){function e(){o()(this,e),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return u()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(f.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e,this._createInternalEffects()}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=!0,o=!1,s=void 0;try{for(var u,c=this._internalEffects[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){u.value.cleanup()}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some(function(e){return e instanceof y.a})||this._internalEffects.push(b)}}]),e}(),x=n(103),w=n(173),O=n(60),P=n(80),S=n(183),j=n(182),k={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function C(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,h=-1,d=0,g=0;gf)d+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,h=d)}d+=4}}if(h>=0){var x=t[h+3]-1,w=t.slice(h,h+4),O=n[x];if(O){var P=O.decodePickingColor(w);return{pickedColor:w,pickedLayer:O,pickedObjectIndex:P}}v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return k}function E(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=A({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function A(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var T=function(){function e(t){o()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new j.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return u()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(S.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new O.a(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-(r+1)*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=A({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(l.a)(r),Object(l.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(l.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,u=r.y,c=r.width,f=r.height,h=new Uint8Array(c*f*4);return Object(P.e)(o,{sourceX:s,sourceY:u,sourceWidth:c,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight,o=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-o,c=Math.min(a,n+i+1)-s;return u<=0||c<=0?null:{x:o,y:s,width:u,height:c}}},{key:"callLayerPickingCallbacks",value:function(e,t){var n=[],i=this.pickingEvent;return e.forEach(function(e){if(e.layer){var r=!1;switch(t){case"hover":r=e.layer.onHover(e,i);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}}),n}}]),e}(),M=n(196),L=n(204),I=n(91),R=n(90),F=n(148),D=n(107),N=n(267),z=n(24),B=n(4),U=n(5),V=1,G=2,W=4,H={mousedown:V,mousemove:G,mouseup:W};var X,q,Z=null;"undefined"!=typeof document&&(Z=n(256),X=Z.PointerEventInput,q=X.prototype.handler,X.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&G&&0===e.which&&(t=W),this.pressed&&(t&W&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var Y=Z;var K=Y?[[Y.Rotate,{enable:!1}],[Y.Pinch,{enable:!1}],[Y.Swipe,{enable:!1}],[Y.Pan,{threshold:0,enable:!1}],[Y.Press,{enable:!1}],[Y.Tap,{event:"doubletap",taps:2,enable:!1}],[Y.Tap,{event:"anytap",enable:!1}],[Y.Tap,{enable:!1}]]:null,Q={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},J={doubletap:["tap"]},$={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ee=["keydown","keyup"],te=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],ne=["wheel","mousewheel","DOMMouseScroll"],ie={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",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"},re={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ae=n(120),oe=-1!==ae.b.indexOf("firefox"),se=ne,ue=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=se.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!ae.a&&{passive:!1})})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;ae.c.WheelEvent&&(oe&&e.deltaMode===ae.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=ae.c.devicePixelRatio),e.deltaMode===ae.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ce=te,le=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=ce.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),fe=ee,he=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=fe.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),de=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(U.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ve=1,ge=2,pe=4,me={pointerdown:ve,pointermove:ge,pointerup:pe,mousedown:ve,mousemove:ge,mouseup:pe},ye=1,be=2,_e=3,xe=0,we=1,Oe=2,Pe=1,Se=2,je=4;var ke=function(){function e(t){Object(B.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(U.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(B.a)(this,e),this.options=Object.assign({},Ce,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(U.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||K}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(Q).forEach(function(e){var n=t.manager.get(e);n&&Q[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new ue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new le(e,this._onOtherEvent,{enable:!1}),this.keyInput=new he(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new de(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(z.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=J[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=re[e]||e,o=r.get(a);o||(o=new ke(this),r.set(a,o),o.recognizerName=ie[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=re[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=$[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),Ae=n(31);function Te(){}n.d(t,"a",function(){return Le});var Me={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:Te,onResize:Te,onViewStateChange:Te,onBeforeRender:Te,onAfterRender:Te,onLoad:Te,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Le=function(){function e(t){o()(this,e),t=Object.assign({},Me,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),function(){if(void 0===("undefined"==typeof window?"undefined":r()(window)))return!1;return-1!==((window.navigator||{}).userAgent||"").indexOf("Trident/")}()&&v.a.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new N.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return u()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&v.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&v.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(l.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new L.a({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(I.a)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new m.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.callback=this.props.onHover,t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(R.a)(e,{enable:!0,copyState:!0})),Object(F.a)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new Ee(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Ae.b)this.eventManager.on(t,this._onEvent);this.viewManager=new p({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(l.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new c.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new _,this.deckRenderer=new w.a(e),this.deckPicker=new T(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(F.a)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),v.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=Ae.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){var e=this.stats;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();var t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var e=this.metrics,t=this.stats;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();var n=D.a.get("Memory Usage");e.bufferMemory=n.get("Buffer Memory").count,e.textureMemory=n.get("Texture Memory").count,e.renderbufferMemory=n.get("Renderbuffer Memory").count,e.gpuMemory=n.get("GPU Memory").count}}]),e}();Le.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(x.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Le.defaultProps=Me,Le.VERSION=M.a.VERSION},function(e,t,n){"use strict";var i=n(109),r=n(132),a=n(205),o=n(189),s=n(206),u={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n} geometry;\n",fs:"\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n"},c=n(84),l={name:"project32",dependencies:[c.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"};function f(){Object(i.c)([a.a,c.a,l,o.a,o.b,s.a]),Object(i.e)([u,c.a]),Object(r.c)("vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)"),Object(r.c)("fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"),Object(r.b)("picking",{hook:"fs:DECKGL_FILTER_COLOR",order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n"})}n.d(t,"a",function(){return f})},function(e,t,n){"use strict";var i=n(117),r=n(122),a=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],o={name:"Images",extensions:a,parse:r.a&&r.d,loadAndParse:!r.a&&r.b},s=(r.e,r.c,n(108)),u=n(15);var c={name:"JSON",extensions:["json","geojson"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},l=n(195),f="7.2.0-beta.3";if(s.a.deck&&s.a.deck.VERSION!==f)throw new Error("deck.gl - multiple versions detected: ".concat(s.a.deck.VERSION," vs ").concat(f));s.a.deck||(u.a.log(0,"deck.gl ".concat(f," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),s.a.deck=s.a.deck||{VERSION:f,version:f,log:u.a},Object(i.b)([c,[o,{imageOrientation:"flipY"}]]),Object(l.a)());t.a=s.a.deck},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(32),s=n(9),u=n(66),c=n(11),l=n(52),f=n(56),h=n(60),d=n(74),v=n(61),g=n(59),p=n(30),m=n(73),y=function(){function e(t){Object(i.a)(this,e),this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}return Object(r.a)(e,[{key:"getAttributeInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var t=this.getAttributeInfo(e);return t?t.location:-1}},{key:"getAttributeAccessor",value:function(e){var t=this.getAttributeInfo(e);return t?t.accessor:null}},{key:"getVaryingInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var t=this.getVaryingInfo();return t?t.location:-1}},{key:"getVaryingAccessor",value:function(e){var t=this.getVaryingInfo();return t?t.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var t=e.gl,n=t.getProgramParameter(e.handle,35721),i=0;i=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(Object(p.d)(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(s.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",P),n._isCached=!1,n.initialize(r),Object.seal(Object(o.a)(n)),n._setId(r.id),n}return Object(c.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new v.c(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new v.a(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,Object(x.a)(this.vs instanceof v.c),Object(x.a)(this.fs instanceof v.a),this.uniforms={},i&&(Object(p.a)(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new y(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,f=void 0!==l&&l,h=e.indexType,d=void 0===h?5123:h,v=e.isInstanced,g=void 0!==v&&v,y=e.instanceCount,O=void 0===y?0:y,P=e.vertexArray,S=void 0===P?null:P,j=e.transformFeedback,k=e.framebuffer,C=e.parameters,E=void 0===C?{}:C,A=e.uniforms,T=e.samplers;if((A||T)&&(w.a.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(A||{})),void 0!==n){var M=k?k.id:"default",L="mode=".concat(Object(_.a)(this.gl,r)," verts=").concat(a," ")+"instances=".concat(O," indexType=").concat(Object(_.a)(this.gl,d)," ")+"isInstanced=".concat(g," isIndexed=").concat(f," ")+"Framebuffer=".concat(M);w.a.log(n,L)()}return Object(x.a)(S),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(S.bindForDraw(a,O,function(){if(void 0!==k&&(E=Object.assign({},E,{framebuffer:k})),j){var e=Object(m.c)(r);j.begin(e)}t._bindTextures(),Object(b.a)(t.gl,E,function(){f&&g?t.gl.drawElementsInstanced(r,a,d,s,O):f&&Object(p.d)(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):f?t.gl.drawElements(r,a,d,s):g?t.gl.drawArraysInstanced(r,s,a,O):t.gl.drawArrays(r,s,a)}),j&&j.end()}),!0)}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=!1,i={};for(var r in e)Object(d.a)(this.uniforms[r],e[r])||(n=!0,i[r]=e[r],this.uniforms[r]=Object(d.c)(e[r]));return n&&(t(),Object(d.b)(i,this.id,this._uniformSetters),this._setUniforms(i)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof h.a)i=i.texture;if(i instanceof f.a)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof h.a&&(n=n.texture),n instanceof f.a)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof h.a&&(n=n.texture),n instanceof f.a){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new v.c({handle:u});break;case 35632:n.fs=new v.a({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Object(O.c)(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),w.a.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),w.a.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||w.a.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1)for(var s=0;s0&&w[1]>0);var O=w[0]/x[0],P=w[1]/x[1],S=(u.right-u.left)/2/O,j=(u.bottom-u.top)/2/P,k=[(_[0]+b[0])/2+S,(_[1]+b[1])/2+j],C=y.unproject(k),E=y.zoom+Math.log2(Math.abs(Math.min(O,P)));return{longitude:C[0],latitude:C[1],zoom:E}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(24),r=n(4),a=n(5),o=n(22),s=n(29),u=n(40),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.g(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(43),f=n(30),h=n(67),d=n(26),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(f.a)(e),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(f.d)(e)}}]),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(h.a)(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,d.a.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof l.a==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(4),r=n(5),a=n(59),o=n(43),s=n(106),u=n(235),c=n(26),l=n(19),f=/^(.+)__LOCATION_([0-9]+)$/,h=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=s.a.isSupported(t)?new s.a(t):s.a.getDefaultArray(t),Object(u.a)(this,"VertexArray","v6.0",h),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new o.a(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof o.a){var a=n;if(r){var s=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,s)}else{var u=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,u)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c.a.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(34),r=n(50),a=n.n(r),o=n(116),s=n(4),u=n(5),c=n(91),l=n(107),f=n(125),h=n(177),d=n(135),v=n(30),g=n(65),p=n(60),m=n(26),y=n(19),b=0,_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e);var n=t.onCreateContext,i=void 0===n?function(e){return Object(c.a)(e)}:n,r=t.onAddHTML,a=void 0===r?null:r,o=t.onInitialize,u=void 0===o?function(){}:o,f=t.onRender,h=void 0===f?function(){}:f,d=t.onFinalize,v=void 0===d?function(){}:d,g=t.gl,p=void 0===g?null:g,y=t.glOptions,_=void 0===y?{}:y,x=t.debug,w=void 0!==x&&x,O=t.createFramebuffer,P=void 0!==O&&O,S=t.autoResizeViewport,j=void 0===S||S,k=t.autoResizeDrawingBuffer,C=void 0===k||k,E=t.stats,A=void 0===E?l.a.get("animation-loop-".concat(b++)):E,T=t.useDevicePixels,M=void 0===T||T;"useDevicePixelRatio"in t&&(m.a.deprecated("useDevicePixelRatio","useDevicePixels")(),M=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:a,onInitialize:u,onRender:h,onFinalize:v,gl:p,glOptions:_,debug:w,createFramebuffer:P},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=A,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:j,autoResizeDrawingBuffer:C,useDevicePixels:M}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(u.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Object(y.a)("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,Object(f.b)().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=h.a.isSupported(e.gl,["timers"])?new h.a(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),Object(d.a)(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(o.a)(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return m.a.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;Object(d.a)(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||Object(d.b)(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(i.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Object(c.c)(this.props.gl,e):this.onCreateContext(e),!Object(v.c)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(g.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Object(c.d)(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new p.a(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()&&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}}]),e}()},function(e,t,n){"use strict";t.a={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}},function(e,t,n){"use strict";var i={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};t.a={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}}},function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(0),r=n(43),a=n(68),o=n(73),s=n(187);function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=c(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),f=t.accessors[s.location];f&&(u="".concat(o,": ").concat(l(s.name,f))),r[u]=c(t,a[o],f,i)}}return r}function c(e,t,n,o){var u,c,l,f,h=e.gl,d="NOT PROVIDED",v="N/A",g="N/A",p="N/A";if(n&&(d=n.type,v=n.size,c=-1!==(d=String(d).replace("Array","")).indexOf("nt")),t instanceof r.a){var m,y,b=t,_=b.getDebugData(),x=_.data;if(l=_.modified?"*":"",f=x,g=(p=b.byteLength)/x.BYTES_PER_ELEMENT/v,n){var w=n.divisor>0;y="".concat(w?"I ":"P "," ").concat(g," (x").concat(v,"=").concat(p," bytes ").concat(Object(a.a)(h,d),")")}else c=!0,y="".concat(p," bytes");return m={},Object(i.a)(m,o,"".concat(l).concat(Object(s.a)(f,{size:v,isInteger:c}))),Object(i.a)(m,"Format ",y),m}return f=t,v=t.length,c=-1!==(d=String(t.constructor.name).replace("Array","")).indexOf("nt"),u={},Object(i.a)(u,o,"".concat(Object(s.a)(f,{size:v,isInteger:c})," (constant)")),Object(i.a)(u,"Format ","".concat(v,"x").concat(d," (constant)")),u}function l(e,t){var n=t.type,i=t.size,r=Object(o.b)(n,i);return r?"".concat(e," (").concat(r.name,")"):e}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(0),r=n(19),a=n(187);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,o=e.program,u=e.uniforms,c=e.undefinedOnly,l=void 0!==c&&c;Object(r.a)(o);var f=o._uniformSetters,h={},d=Object.keys(f).sort(),v=0,g=!0,p=!1,m=void 0;try{for(var y,b=d[Symbol.iterator]();!(g=(y=b.next()).done);g=!0){var _=y.value;_.match(".*_.*")||_.match(".*Matrix")||s({table:h,header:n,uniforms:u,uniformName:_,undefinedOnly:l})&&v++}}catch(e){p=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(p)throw m}}var x=!0,w=!1,O=void 0;try{for(var P,S=d[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;j.match(".*Matrix")&&s({table:h,header:n,uniforms:u,uniformName:j,undefinedOnly:l})&&v++}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}var k=!0,C=!1,E=void 0;try{for(var A,T=d[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h[M]||s({table:h,header:n,uniforms:u,uniformName:M,undefinedOnly:l})&&v++}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}var L=0,I={};if(!l)for(var R in u){var F=u[R];h[R]||(L++,I[R]=Object(i.a)({Type:"NOT USED: ".concat(F)},n,Object(a.a)(F)))}return{table:h,count:v,unusedTable:I,unusedCount:L}}function s(e){var t,n=e.table,r=e.header,o=e.uniforms,s=e.uniformName,u=e.undefinedOnly,c=o[s],l=function(e){return null!=e}(c);return(!u||!l)&&(n[s]=(t={},Object(i.a)(t,r,l?Object(a.a)(c):"N/A"),Object(i.a)(t,"Uniform Type",l?c:"NOT PROVIDED"),t),!0)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(0),r=n(73);function a(e){var t={},n="Accessors for ".concat(e.id),r=!0,a=!1,s=void 0;try{for(var u,c=e.attributeInfos[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var l=u.value;if(l){var f=o(l);t["in ".concat(f)]=Object(i.a)({},n,JSON.stringify(l.accessor))}}}catch(e){a=!0,s=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw s}}var h=!0,d=!1,v=void 0;try{for(var g,p=e.varyingInfos[Symbol.iterator]();!(h=(g=p.next()).done);h=!0){var m=g.value;if(m){var y=o(m);t["out ".concat(y)]=Object(i.a)({},n,JSON.stringify(m.accessor))}}}catch(e){d=!0,v=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw v}}return t}function o(e){var t=e.accessor,n=t.type,i=t.size,a=Object(r.b)(n,i);return a?"".concat(a.name," ").concat(e.name):e.name}},function(e,t,n){"use strict";function i(e){var t=100,n=e.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(25),r=n(4),a=n(5),o=n(10),s=n(9),u=n(66),c=n(11),l=n(64),f=n(26),h=n(92),d=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var i=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===i?[]:i;return f.a.assert(a.every(function(e){return e instanceof h.a}),"every child must an instance of ScenegraphNode"),(e=Object(o.a)(this,Object(s.a)(t).call(this,n))).children=a,e}return Object(c.a)(t,e),Object(a.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new l.a:n,r=new l.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;f instanceof t?f.traverse(e,{worldMatrix:r}):e(f,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return f.a.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(h.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(66),u=n(11),c=n(93),l=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof c.a?(n.model=e,n._setModelNodeProps(r)):n.model=new c.a(e,r),n.managedResources=r.managedResources||[],n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return Object(s.a)(Object(o.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(n(92).a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(201),p=n(64),m=n(167);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(1),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(129),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,O=e.zoom,P=void 0===O?0:O;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:P}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(1),u=n.n(s),c=n(6),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(168),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(191),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.a}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(170).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(192),v=n(72),g=n(193),p=n(131),m=n(114),y=n(141),b=n(139),_=new d.a,x={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags),i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(i&&Array.isArray(n.dataChanged)){var r=this.state.paths.slice(),a=n.dataChanged.map(function(e){return Object(b.a)({data:r,getIndex:function(e){return e.__source.index},dataRange:e,replace:t._getPaths(e)})});this.setState({paths:r,pathsDiff:a})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.data,i=t.getPolygon,r=[],a="XY"===t.positionFormat?2:3,o=e.startRow,s=e.endRow,u=Object(v.a)(n,o,s),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var g,p=c[Symbol.iterator]();!(f=(g=p.next()).done);f=!0){var m=g.value;l.index++;var b=y.c(i(m,l),a),_=b.positions,x=b.holeIndices;if(x)for(var w=0;w<=x.length;w++){var O=_.subarray(x[w-1]||0,x[w]||_.length);r.push(this.getSubLayerRow({path:O},m,l.index))}else r.push(this.getSubLayerRow({path:_},m,l.index))}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}return r}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e._dataDiff,i=e.stroked,r=e.filled,a=e.extruded,o=e.wireframe,s=e.elevationScale,u=e.transitions,c=e.positionFormat,l=this.props,f=l.lineWidthUnits,h=l.lineWidthScale,d=l.lineWidthMinPixels,v=l.lineWidthMaxPixels,g=l.lineJointRounded,y=l.lineMiterLimit,b=l.lineDashJustified,_=this.props,x=_.getFillColor,w=_.getLineColor,O=_.getLineWidth,P=_.getLineDashArray,S=_.getElevation,j=_.getPolygon,k=_.updateTriggers,C=_.material,E=this.state,A=E.paths,T=E.pathsDiff,M=this.getSubLayerClass("fill",p.a),L=this.getSubLayerClass("stroke",m.a),I=this.shouldRenderSubLayer("fill",A)&&new M({_dataDiff:n,extruded:a,elevationScale:s,filled:r,wireframe:o,getElevation:S,getFillColor:x,getLineColor:w,material:C,transitions:u},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:k.getPolygon,getElevation:k.getElevation,getFillColor:k.getFillColor,getLineColor:k.getLineColor}}),{data:t,positionFormat:c,getPolygon:j});return[!a&&I,!a&&i&&this.shouldRenderSubLayer("stroke",A)&&new L({_dataDiff:T&&function(){return T},widthUnits:f,widthScale:h,widthMinPixels:d,widthMaxPixels:v,rounded:g,miterLimit:y,dashJustified:b,transitions:u&&{getWidth:u.getLineWidth,getColor:u.getLineColor,getPath:u.getPolygon},getColor:this.getSubLayerAccessor(w),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:k.getLineWidth,getColor:k.getLineColor,getDashArray:k.getLineDashArray}}),{data:A,positionFormat:c,getPath:function(e){return e.path}}),a&&I]}}]),t}(g.a);w.layerName="PolygonLayer",w.defaultProps=x},function(e,t,n){"use strict";var i="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",r={name:"project2",vs:i,fs:i},a=n(115);t.a={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[r,a.a]}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var r="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",a="".concat(r,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),o={ONE:1};t.a={name:"fp64",vs:a,fs:null,fp64ify:i,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var a=4*n+r;i(e[4*r+n],t,2*a)}return t},getUniforms:function(){return Object.assign({},o)}},"".concat(r)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(93),b=n(58);n.d(t,"a",function(){return w});var _=[0,0,0,255],x={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:_},getTargetColor:{type:"accessor",value:_},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n vec2 source = project_position(geometry.worldPosition, instancePositions64Low.xy).xy;\n vec2 target = project_position(geometry.worldPositionAlt, instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:_},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:_},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]);var O=u(x,d);c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);w.layerName="ArcLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(93),b=n(58);n.d(t,"a",function(){return x});var _={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.), target_commonspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),O=u(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]),c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);x.layerName="LineLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(193),v=n(171),g=n(114),p=n(192),m=n(131),y=n(139),b=n(15);function _(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},r=n.startRow,a=void 0===r?0:r,o=n.endRow,s=void 0===o?e.length:o,u=a;u0;)t=t[0];return t&&Number.isFinite(t[0])}(a,o))switch(a){case"Point":s.push(n({geometry:e},i,r));break;case"MultiPoint":o.forEach(function(e){s.push(n({geometry:{type:"Point",coordinates:e}},i,r))});break;case"LineString":u.push(n({geometry:e},i,r));break;case"MultiLineString":o.forEach(function(e){u.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"Polygon":c.push(n({geometry:e},i,r)),o.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"MultiPolygon":o.forEach(function(e){c.push(n({geometry:{type:"Polygon",coordinates:e}},i,r)),e.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))})})}else b.a.warn("".concat(a," coordinates are malformed"))()}var w={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return j});var O=new p.a,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:O};function S(e){return e.geometry.coordinates}var j=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){var t=e.props,n=e.changeFlags;if(n.dataChanged){var i=function(e){if(Array.isArray(e))return e;switch(b.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return b.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data),r=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var a=this.state.features,o={},s={};for(var u in a)o[u]=a[u].slice(),s[u]=[];var c=!0,l=!1,f=void 0;try{for(var h,d=n.dataChanged[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value,g=_(i,r,v);for(var p in a)s[p].push(Object(y.a)({data:o[p],getIndex:function(e){return e.__source.index},dataRange:v,replace:g[p]}))}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}this.setState({features:o,featuresDiff:s})}else this.setState({features:_(i,r),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var e=this.state,t=e.features,n=e.featuresDiff,i=t.pointFeatures,r=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures,s=this.props,u=s.stroked,c=s.filled,l=s.extruded,f=s.wireframe,h=s.material,d=s.transitions,p=this.props,y=p.lineWidthUnits,b=p.lineWidthScale,_=p.lineWidthMinPixels,x=p.lineWidthMaxPixels,w=p.lineJointRounded,O=p.lineMiterLimit,P=p.pointRadiusScale,j=p.pointRadiusMinPixels,k=p.pointRadiusMaxPixels,C=p.elevationScale,E=p.lineDashJustified,A=this.props,T=A.getLineColor,M=A.getFillColor,L=A.getRadius,I=A.getLineWidth,R=A.getLineDashArray,F=A.getElevation,D=A.updateTriggers,N=this.getSubLayerClass("polygons-fill",m.a),z=this.getSubLayerClass("polygons-stroke",g.a),B=this.getSubLayerClass("line-strings",g.a),U=this.getSubLayerClass("points",v.a),V=this.shouldRenderSubLayer("polygons-fill",a)&&new N({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:l,elevationScale:C,filled:c,wireframe:f,material:h,getElevation:this.getSubLayerAccessor(F),getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),transitions:d&&{getPolygon:d.geometry,getElevation:d.getElevation,getFillColor:d.getFillColor,getLineColor:d.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:D.getElevation,getFillColor:D.getFillColor,getLineColor:D.getLineColor}}),{data:a,getPolygon:S});return[!l&&V,!l&&u&&this.shouldRenderSubLayer("polygons-stroke",o)&&new z({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:o,getPath:S}),this.shouldRenderSubLayer("linestrings",r)&&new B({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:r,getPath:S}),this.shouldRenderSubLayer("points",i)&&new U({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:u,filled:c,radiusScale:P,radiusMinPixels:j,radiusMaxPixels:k,lineWidthUnits:y,lineWidthScale:b,lineWidthMinPixels:_,lineWidthMaxPixels:x,getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),getRadius:this.getSubLayerAccessor(L),getLineWidth:this.getSubLayerAccessor(I),transitions:d&&{getPosition:d.geometry,getFillColor:d.getFillColor,getLineColor:d.getLineColor,getRadius:d.getRadius,getLineWidth:d.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:D.getFillColor,getLineColor:D.getLineColor,getRadius:D.getRadius,getLineWidth:D.getLineWidth}}),{data:i,getPosition:S}),l&&V]}}]),t}(d.a);j.layerName="GeoJsonLayer",j.defaultProps=P},function(e,t,n){"use strict";var i,r=n(4),a=n(5),o=n(0),s=n(147),u=n(123),c=n(207),l=n(30),f=n(43),h=n(80),d=n(126),v=n(159),g=n(202),p=n(60),m=n(211),y=n(19),b=n(26),_=n(67),x=n(93),w="transform_uSampler_",O="transform_uSize_",P="transform_position";function S(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,c={},l=t,f={};if(a>0||i){var h=l.split("\n"),d=h.slice();if(h.forEach(function(e,t,r){if(a>0){var l=function(e,t){var n={},i=function(e){return Object(u.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(w).concat(e),n="".concat(O).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),c=s.samplerName,l=s.sizeName,f=s.uniformDeclerations,h=Object(u.e)(r),d=" ".concat(r," ").concat(a," = transform_getInput(").concat(c,", ").concat(l,").").concat(h,";\n");n[c]=a;var v={"vs:#decl":f,"vs:#main-start":d};return{updatedLine:o,inject:v,samplerTextureMap:n}}return null}(e,n);if(l){var h=l.updatedLine,v=l.inject;d[t]=h,f=Object(s.b)([f,v]),Object.assign(c,l.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(u.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Object(y.a)(r);var v="".concat(O).concat(i),g={"vs:#decl":"uniform vec2 ".concat(v,";\n"),"vs:#main-start":" vec2 ".concat(P," = transform_getPos(").concat(v,");\n gl_Position = vec4(").concat(P,", 0, 1.);\n")};f=Object(s.b)([f,g])}l=d.join("\n")}return{vs:l,targetTextureType:o,inject:f,samplerTextureMap:c}}n.d(t,"a",function(){return k});var j=(i={},Object(o.a)(i,10241,9728),Object(o.a)(i,10240,9728),Object(o.a)(i,10242,33071),Object(o.a)(i,10243,33071),i),k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,e),Object(y.a)(Object(l.d)(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this.resources={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(a.a)(e,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(a.a)(e,[{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof f.a?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Object(y.a)(!n||n===this.targetTextureVarying);var o=Object(h.e)(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,c=Object(u.d)(this.targetTextureType),l=new s(o.length*c/4),f=0,d=0;d0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,s=this.framebuffers[this.currentIndex],Object(y.a)(s),r.viewport=[0,0,s.width,s.height],o&&s.clear({color:!0})),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){b.a.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Object(y.a)(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Object(y.a)(r[o]instanceof f.a||r[o].buffer instanceof f.a);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(j)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Object(y.a)(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(b.a.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(b.a.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,h=e._swapTexture;for(var v in Object(y.a)(a&&(s||n||c)&&o),t||{})Object(y.a)(t[v]instanceof f.a||t[v].buffer instanceof f.a);for(var g in u||{})Object(y.a)(u[g]instanceof d.a);return Object(y.a)(!c||l),Object(y.a)(!h||u[h]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n,0);Object(y.a)(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e,t){var n;if(e instanceof d.a)return e;var i=this.sourceTextures[0][e];if(!i)return null;this._targetRefTexName=e;var r=Object(v.a)(i,{parameters:(n={},Object(o.a)(n,10241,9728),Object(o.a)(n,10240,9728),Object(o.a)(n,10242,33071),Object(o.a)(n,10243,33071),n),pixelStore:Object(o.a)({},37440,!1)}),a="target-texture-".concat(t);return this.resources[a]&&this.resources[a].delete(),this.resources[a]=r,r}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=this._createNewBuffer(r,{byteLength:o,usage:s,accessor:u});this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new f.a(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=n,n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Object(y.a)(this.feedbackBuffers[t][i]instanceof f.a))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new x.a(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){Object(_.a)(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=this._createNewBuffer("elementIDBuffer",{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,l=Object(s.b)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:e._fs||Object(u.b)({version:Object(m.a)(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[c.a].concat(e.modules||[]):e.modules,uniforms:i,inject:l,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return S({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}()},function(e,t,n){"use strict";(function(e){var i=n(34);t.a="undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==Object(i.a)(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(89))},function(e,t,n){var i=n(255);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){e.exports=function(e){var t;if("function"==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(38),a=n.n(r),o=n(121);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(89))},function(e,t,n){var i=n(8);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===S(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(O(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),O(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),O(i),O(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:{},i=g.b[t];if(Object(m.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in y)return y[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),y[t]=s,s}var _=n(59),x=n(43),w=n(61),O=n(197),P=n(60),S=n(95),j=n(126),k=n(160),C=n(112),E=n(80),A=n(177),T=n(161),M=n(202),L=n(106),I=n(203),R=n(4),F=n(5),D=n(73),N=5126,z=5124,B=5125,U=function(){function e(t){var n;for(var i in Object(R.a)(this,e),this.layout={},this.size=0,t)this._addUniform(i,t[i]);this.size+=(4-this.size%4)%4;var r=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,N,r),Object(c.a)(n,z,new Int32Array(r.buffer)),Object(c.a)(n,B,new Uint32Array(r.buffer)),n)}return Object(F.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[N]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Object(m.a)(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Object(D.a)(t);Object(m.a)(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}(),V=n(124),G=n(26),W=n(67),H=n(46);n.d(t,"S",function(){return r.a}),n.d(t,"A",function(){return a.a}),n.d(t,"B",function(){return a.b}),n.d(t,"V",function(){return a.d}),n.d(t,"X",function(){return a.e}),n.d(t,"N",function(){return o.c}),n.d(t,"O",function(){return o.d}),n.d(t,"w",function(){return s.a}),n.d(t,"J",function(){return u.b}),n.d(t,"I",function(){return u.a}),n.d(t,"E",function(){return v}),n.d(t,"H",function(){return d}),n.d(t,"F",function(){return h}),n.d(t,"D",function(){return f.a}),n.d(t,"c",function(){return g.a}),n.d(t,"L",function(){return p.b}),n.d(t,"M",function(){return p.c}),n.d(t,"G",function(){return p.a}),n.d(t,"t",function(){return b}),n.d(t,"a",function(){return _.a}),n.d(t,"b",function(){return x.a}),n.d(t,"i",function(){return w.b}),n.d(t,"q",function(){return w.c}),n.d(t,"d",function(){return w.a}),n.d(t,"f",function(){return O.a}),n.d(t,"e",function(){return P.a}),n.d(t,"h",function(){return S.a}),n.d(t,"j",function(){return j.a}),n.d(t,"l",function(){return k.a}),n.d(t,"u",function(){return C.a}),n.d(t,"v",function(){return C.b}),n.d(t,"T",function(){return E.e}),n.d(t,"U",function(){return E.f}),n.d(t,"x",function(){return E.b}),n.d(t,"y",function(){return E.c}),n.d(t,"z",function(){return E.d}),n.d(t,"s",function(){return E.a}),n.d(t,"g",function(){return A.a}),n.d(t,"k",function(){return T.a}),n.d(t,"m",function(){return M.a}),n.d(t,"p",function(){return L.a}),n.d(t,"o",function(){return I.a}),n.d(t,"n",function(){return U}),n.d(t,"Y",function(){return V.c}),n.d(t,"P",function(){return V.a}),n.d(t,"Q",function(){return V.b}),n.d(t,"R",function(){return G.a}),n.d(t,"r",function(){return m.a}),n.d(t,"Z",function(){return W.c}),n.d(t,"W",function(){return H.c}),n.d(t,"ab",function(){return H.d}),n.d(t,"K",function(){return H.b}),n.d(t,"C",function(){return H.a})},function(e,t,n){"use strict";var i=n(236);t.a=new i.a({id:"deck"}).enable()},function(e,t,n){var i=n(252),r=n(253),a=n(254);e.exports=function(e,t){return i(e)||r(e,t)||a()}},function(e,t,n){"use strict";n.r(t);var i=n(14),r=n(51),a=n(58),o=n(128),s=n(146),u=n(204),c=n(24),l=new Uint8Array([0,0,0]);function f(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function h(e){var t=Object(c.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function d(){return l}var v=n(93),g=n(224),p=n(101),m=n(190),y=n(34),b=n(4),_=n(5),x=n(125),w=n(135),O=n(19),P=n(26);var S=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.onInitialize,r=void 0===i?function(){}:i,a=n.onFinalize,o=void 0===a?function(){}:a,s=n.useDevicePixels,u=void 0===s||s,c=n.autoResizeDrawingBuffer,l=void 0===c||c;this.props={onInitialize:r,onFinalize:o},this.setProps({autoResizeDrawingBuffer:l,useDevicePixels:u}),Object(O.a)(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(_.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.onmessage=function(n){var i,r,a,o=n.data;switch(o.command){case"start":i=t,r=o.opts.canvas,a=new Map,r.addEventListener=function(e,t){i.postMessage({command:"addEventListener",type:e}),a.has(e)||a.set(e,[]),a.get(e).push(t)},r.removeEventListener=function(e,t){i.postMessage({command:"removeEventListener",type:e});var n=a.get(e);n&&n.splice(n.indexOf(t),1)},r.dispatchEvent=function(e,t){var n=a.get(e);n&&n.forEach(function(e){return e(t)})},i.canvas=r,e.start(o.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=o.width,t.canvas.height=o.height;break;case"event":t.canvas.dispatchEvent(o.type,o.event)}}}}}]),Object(_.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,Object(x.b)().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=Object(w.b)(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(Object(w.a)(this._animationFrameId),this._animationFrameId=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(y.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._animationFrameId=Object(w.b)(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=Object(x.a)(e);t.transferControlToOffscreen||P.a.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),j=n(10),k=n(9),C=n(11),E=n(60),A=n(70),T=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.id,r=void 0===i?"pass":i;this.id=r,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(_.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=E.a.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),Object(A.a)(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),M=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(T),L=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(b.a)(this,e),this.gl=t,this.framebuffer1=new E.a(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new E.a(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(_.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),I=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),i=Array.isArray(i)?{passes:i}:i,(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"multi-pass"},i)))).renderState=new L(e,i),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(M),R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){var e=this.gl,t=this.props.clearBits,n=void 0===t?16640:t;e.clear(n)}}]),t}(T),F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(T),D="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",N=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},i)))).clipspace=new p.a(e,{id:"copy-pass",fs:D}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),z="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",B=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,t),n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"texture-pass"},i)));var r=i.texture,a=i.opacity,o=void 0===a?1:a;return n.clipspace=new p.a(e,{id:"texture-pass",fs:z,uniforms:{uDiffuseSampler:r,uOpacity:o}}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),U=n(140),V=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),G=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(b.a)(this,t);var a="".concat(n.name,"-pass");Object(U.b)(n);var o=function(e,t,n,i){if(t.filter||t.sampler){var r=q(t),a=new V(e,{id:n,model:W(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=q(t,r),s="".concat(n,"-").concat(o.length+1);return new V(e,Object.assign({id:s,model:W(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,a,r);return(i=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:a,passes:o},r)))).module=n,i}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.props.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1;var l=c.props,f=l.uniforms,h=l.model;f&&h.setUniforms(f),h.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(M);function W(e,t,n,i,r){var a=new p.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var H=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},X=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return H(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return X(i)}return null}var Z=n(36),Y=n(67),K={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Q=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("truncated-code-geometry"):n,r=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,O=x(b),P=_(b),S=v?-2:0,j=l+(p?2:0),k=u+1,C=new Uint16Array(u*(l+m)*6),E=K[h],A=new Float32Array(3*y),T=new Float32Array(3*y),M=new Float32Array(2*y),L=0,I=0,R=S;R<=j;R++){var F=R/l,D=o*F,N=void 0;R<0?(D=0,F=1,N=n):R>l?(D=o,F=1,N=r):N=n+R/l*(r-n),-2!==R&&R!==l+2||(N=0,F=0),D-=o/2;for(var z=0;zl?0:B*O,T[L+E[1]]=R<0?-1:R>l?1:P,T[L+E[2]]=R<0||R>l?0:U*O,M[I+0]=z/u,M[I+1]=F,I+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cone-geometry"):n,r=e.radius,a=void 0===r?1:r,o=e.cap,s=void 0===o||o;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,topRadius:0,topCap:Boolean(s),bottomCap:Boolean(s),bottomRadius:a})))}return Object(C.a)(t,e),t}(Q),$=n(191),ee=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cylinder-geometry"):n,r=e.radius,a=void 0===r?1:r;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,bottomRadius:a,topRadius:a})))}return Object(C.a)(t,e),t}(Q),te=n(29),ne=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],ie=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],re=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("ico-sphere-geometry"):n,r=function(e){var t=e.iterations,n=void 0===t?0:t,i=Math.PI,r=2*i,a=[].concat(ne),o=[].concat(ie);a.push(),o.push();for(var s=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,r=t>n?t:n,o="".concat(i,"|").concat(r);if(o in e)return e[o];var s=a[t],u=a[t+1],c=a[t+2],l=a[n],f=a[n+1],h=a[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,a.push(d,v,g),e[o]=a.length/3-1}}(),u=0;u=0;p-=3){var m=o[p+0],y=o[p+1],b=o[p+2],_=3*m,x=3*y,w=3*b,O=2*m,P=2*y,S=2*b,j=a[_+0],k=a[_+1],C=a[_+2],E=Math.acos(C/Math.sqrt(j*j+k*k+C*C)),A=Math.atan2(k,j)+i,T=E/i,M=1-A/r,L=a[x+0],I=a[x+1],R=a[x+2],F=Math.acos(R/Math.sqrt(L*L+I*I+R*R)),D=Math.atan2(I,L)+i,N=F/i,z=1-D/r,B=a[w+0],U=a[w+1],V=a[w+2],G=Math.acos(V/Math.sqrt(B*B+U*U+V*V)),W=Math.atan2(U,B)+i,H=G/i,X=1-W/r,q=[B-L,U-I,V-R],Z=[j-L,k-I,C-R],Y=new te.a(q).cross(Z).normalize(),K=void 0;(0===M||0===z||0===X)&&(0===M||M>.5)&&(0===z||z>.5)&&(0===X||X>.5)&&(a.push(a[_+0],a[_+1],a[_+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=T,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[x+0],a[x+1],a[x+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=N,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[w+0],a[w+1],a[w+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=H,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z),v[_+0]=v[x+0]=v[w+0]=Y.x,v[_+1]=v[x+1]=v[w+1]=Y.y,v[_+2]=v[x+2]=v[w+2]=Y.z,g[O+0]=M,g[O+1]=T,g[P+0]=z,g[P+1]=N,g[S+0]=X,g[S+1]=H}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(g)}}}}(e),a=r.indices,o=r.attributes;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,indices:a,attributes:Object(Z.a)({},o,e.attributes)})))}return Object(C.a)(t,e),t}(a.a);var ae=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("plane-geometry"):n,r=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")]||1,f=e["".concat(c[1],"len")]||1,h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,O=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=O,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*O-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*O-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*O-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}y+=2,b+=3}for(var P=h+1,S=new Uint16Array(h*d*6),j=0;j0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("sphere-geometry"):n,r=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,O=s*y,P=Math.sin(w),S=Math.cos(w),j=Math.sin(O),k=Math.cos(O),C=S*j,E=k,A=P*j,T=o(C,E,A,m,y);f[x+0]=T*C,f[x+1]=T*E,f[x+2]=T*A,h[x+0]=C,h[x+1]=E,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var M=n+1,L=0;L0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.a)(this,t),(e=Object(j.a)(this,Object(k.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(C.a)(t,e),t}(ce.a),de=n(28);n.d(t,"isWebGL",function(){return i.N}),n.d(t,"isWebGL2",function(){return i.O}),n.d(t,"lumaStats",function(){return i.S}),n.d(t,"createGLContext",function(){return i.A}),n.d(t,"destroyGLContext",function(){return i.B}),n.d(t,"resizeGLContext",function(){return i.V}),n.d(t,"setGLContextDefaults",function(){return i.X}),n.d(t,"getContextInfo",function(){return i.E}),n.d(t,"getGLContextInfo",function(){return i.H}),n.d(t,"getContextLimits",function(){return i.F}),n.d(t,"FEATURES",function(){return i.c}),n.d(t,"hasFeature",function(){return i.L}),n.d(t,"hasFeatures",function(){return i.M}),n.d(t,"getFeatures",function(){return i.G}),n.d(t,"canCompileGLGSExtension",function(){return i.t}),n.d(t,"cloneTextureFrom",function(){return i.w}),n.d(t,"getKeyValue",function(){return i.J}),n.d(t,"getKey",function(){return i.I}),n.d(t,"setContextDefaults",function(){return i.X}),n.d(t,"glGetDebugInfo",function(){return i.D}),n.d(t,"trackContextState",function(){return r.g}),n.d(t,"resetParameters",function(){return r.d}),n.d(t,"getParameter",function(){return r.b}),n.d(t,"getParameters",function(){return r.c}),n.d(t,"setParameter",function(){return r.e}),n.d(t,"setParameters",function(){return r.f}),n.d(t,"withParameters",function(){return r.h}),n.d(t,"getModifiedParameters",function(){return r.a}),n.d(t,"Buffer",function(){return i.b}),n.d(t,"Shader",function(){return i.i}),n.d(t,"VertexShader",function(){return i.q}),n.d(t,"FragmentShader",function(){return i.d}),n.d(t,"Program",function(){return i.f}),n.d(t,"Framebuffer",function(){return i.e}),n.d(t,"Renderbuffer",function(){return i.h}),n.d(t,"Texture2D",function(){return i.j}),n.d(t,"TextureCube",function(){return i.l}),n.d(t,"clear",function(){return i.u}),n.d(t,"clearBuffer",function(){return i.v}),n.d(t,"readPixelsToArray",function(){return i.T}),n.d(t,"readPixelsToBuffer",function(){return i.U}),n.d(t,"copyToDataUrl",function(){return i.x}),n.d(t,"copyToImage",function(){return i.y}),n.d(t,"copyToTexture",function(){return i.z}),n.d(t,"blit",function(){return i.s}),n.d(t,"Query",function(){return i.g}),n.d(t,"Texture3D",function(){return i.k}),n.d(t,"TransformFeedback",function(){return i.m}),n.d(t,"VertexArrayObject",function(){return i.p}),n.d(t,"VertexArray",function(){return i.o}),n.d(t,"UniformBufferLayout",function(){return i.n}),n.d(t,"setPathPrefix",function(){return i.Y}),n.d(t,"loadFile",function(){return i.P}),n.d(t,"loadImage",function(){return i.Q}),n.d(t,"_Accessor",function(){return i.a}),n.d(t,"_clearBuffer",function(){return i.v}),n.d(t,"Geometry",function(){return a.a}),n.d(t,"Material",function(){return o.a}),n.d(t,"AmbientLight",function(){return s.a}),n.d(t,"DirectionalLight",function(){return s.b}),n.d(t,"PointLight",function(){return s.c}),n.d(t,"AnimationLoop",function(){return u.a}),n.d(t,"encodePickingColor",function(){return f}),n.d(t,"decodePickingColor",function(){return h}),n.d(t,"getNullPickingColor",function(){return d}),n.d(t,"Model",function(){return v.a}),n.d(t,"Transform",function(){return g.a}),n.d(t,"ClipSpace",function(){return p.a}),n.d(t,"_ShaderCache",function(){return m.a}),n.d(t,"_AnimationLoopProxy",function(){return S}),n.d(t,"_MultiPassRenderer",function(){return I}),n.d(t,"_RenderState",function(){return L}),n.d(t,"_Pass",function(){return T}),n.d(t,"_CompositePass",function(){return M}),n.d(t,"_ClearPass",function(){return R}),n.d(t,"_RenderPass",function(){return F}),n.d(t,"_CopyPass",function(){return N}),n.d(t,"_TexturePass",function(){return B}),n.d(t,"_ShaderModulePass",function(){return G}),n.d(t,"ConeGeometry",function(){return J}),n.d(t,"CubeGeometry",function(){return $.a}),n.d(t,"CylinderGeometry",function(){return ee}),n.d(t,"IcoSphereGeometry",function(){return re}),n.d(t,"PlaneGeometry",function(){return ae}),n.d(t,"SphereGeometry",function(){return oe}),n.d(t,"TruncatedConeGeometry",function(){return Q}),n.d(t,"PhongMaterial",function(){return se.a}),n.d(t,"PBRMaterial",function(){return ue}),n.d(t,"ScenegraphNode",function(){return ce.a}),n.d(t,"GroupNode",function(){return le.a}),n.d(t,"ModelNode",function(){return fe.a}),n.d(t,"CameraNode",function(){return he}),n.d(t,"registerShaderModules",function(){return de.v}),n.d(t,"setDefaultShaderModules",function(){return de.w}),n.d(t,"getDefaultShaderModules",function(){return de.l}),n.d(t,"assembleShaders",function(){return de.c}),n.d(t,"createShaderHook",function(){return de.g}),n.d(t,"createModuleInjection",function(){return de.f}),n.d(t,"combineInjects",function(){return de.d}),n.d(t,"normalizeShaderModule",function(){return de.q}),n.d(t,"fp32",function(){return de.j}),n.d(t,"fp64",function(){return de.k}),n.d(t,"project",function(){return de.u}),n.d(t,"lights",function(){return de.p}),n.d(t,"dirlight",function(){return de.i}),n.d(t,"picking",function(){return de.t}),n.d(t,"diffuse",function(){return de.h}),n.d(t,"gouraudlighting",function(){return de.o}),n.d(t,"phonglighting",function(){return de.s}),n.d(t,"pbr",function(){return de.r}),n.d(t,"_transform",function(){return de.b}),n.d(t,"MODULAR_SHADERS",function(){return de.a}),n.d(t,"getQualifierDetails",function(){return de.n}),n.d(t,"getPassthroughFS",function(){return de.m}),n.d(t,"typeToChannelSuffix",function(){return de.y}),n.d(t,"typeToChannelCount",function(){return de.x}),n.d(t,"convertToVec4",function(){return de.e}),n.d(t,"log",function(){return i.R}),n.d(t,"assert",function(){return i.r}),n.d(t,"uid",function(){return i.Z}),n.d(t,"self",function(){return i.W}),n.d(t,"window",function(){return i.ab}),n.d(t,"global",function(){return i.K}),n.d(t,"document",function(){return i.C})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return g}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return b});var i=n(12);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],g=t[13],p=t[14],m=t[15],y=n*s-i*o,b=n*u-r*o,_=n*c-a*o,x=i*u-r*s,w=i*c-a*s,O=r*c-a*u,P=l*g-f*v,S=l*p-h*v,j=l*m-d*v,k=f*p-h*g,C=f*m-d*g,E=h*m-d*p,A=y*E-b*C+_*k+x*j-w*S+O*P;return A?(A=1/A,e[0]=(s*E-u*C+c*k)*A,e[1]=(r*C-i*E-a*k)*A,e[2]=(g*O-p*w+m*x)*A,e[3]=(h*w-f*O-d*x)*A,e[4]=(u*j-o*E-c*S)*A,e[5]=(n*E-r*j+a*S)*A,e[6]=(p*_-v*O-m*b)*A,e[7]=(l*O-h*_+d*b)*A,e[8]=(o*C-s*j+c*P)*A,e[9]=(i*j-n*C-a*P)*A,e[10]=(v*w-g*_+m*y)*A,e[11]=(f*_-l*w-d*y)*A,e[12]=(s*S-o*k-u*P)*A,e[13]=(n*k-i*S+r*P)*A,e[14]=(g*b-v*x-p*y)*A,e[15]=(l*x-f*b+h*y)*A,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],v=e[13],g=e[14],p=e[15];return(t*o-n*a)*(f*p-h*g)-(t*s-i*a)*(l*p-h*v)+(t*u-r*a)*(l*g-f*v)+(n*s-i*o)*(c*p-h*d)-(n*u-r*o)*(c*g-f*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],g=t[12],p=t[13],m=t[14],y=t[15],b=n[0],_=n[1],x=n[2],w=n[3];return e[0]=b*i+_*s+x*f+w*g,e[1]=b*r+_*u+x*h+w*p,e[2]=b*a+_*c+x*d+w*m,e[3]=b*o+_*l+x*v+w*y,b=n[4],_=n[5],x=n[6],w=n[7],e[4]=b*i+_*s+x*f+w*g,e[5]=b*r+_*u+x*h+w*p,e[6]=b*a+_*c+x*d+w*m,e[7]=b*o+_*l+x*v+w*y,b=n[8],_=n[9],x=n[10],w=n[11],e[8]=b*i+_*s+x*f+w*g,e[9]=b*r+_*u+x*h+w*p,e[10]=b*a+_*c+x*d+w*m,e[11]=b*o+_*l+x*v+w*y,b=n[12],_=n[13],x=n[14],w=n[15],e[12]=b*i+_*s+x*f+w*g,e[13]=b*r+_*u+x*h+w*p,e[14]=b*a+_*c+x*d+w*m,e[15]=b*o+_*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,f,h,d,v,g=n[0],p=n[1],m=n[2];return t===e?(e[12]=t[0]*g+t[4]*p+t[8]*m+t[12],e[13]=t[1]*g+t[5]*p+t[9]*m+t[13],e[14]=t[2]*g+t[6]*p+t[10]*m+t[14],e[15]=t[3]*g+t[7]*p+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=v,e[12]=i*g+s*p+f*m+t[12],e[13]=r*g+u*p+h*m+t[13],e[14]=a*g+c*p+d*m+t[14],e[15]=o*g+l*p+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,f,h,d,v,g,p,m,y,b,_,x,w,O,P,S,j,k,C,E=r[0],A=r[1],T=r[2],M=Math.sqrt(E*E+A*A+T*T);return M0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=Ce.a,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return u()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64,a=e.dataChanged;if(this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,Array.isArray(a)){var o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;this._rebuildGeometry(f)}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(je.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.opts=t}return u()(e,[{key:"equals",value:function(e){return this===e||this.constructor===e.constructor&&Object(Le.a)(this.opts,e.opts)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var t=e.constructor.defaultProps,n=void 0===t?{}:t,i={updateTriggers:{}};for(var r in n)if(r in this.props){var a=n[r],o=this.props[r];i[r]=o,a&&"accessor"===a.type&&(i.updateTriggers[r]=this.props.updateTriggers[r],"function"==typeof o&&(i[r]=this.getSubLayerAccessor(o,!0)))}return i}},{key:"initializeState",value:function(e,t){}},{key:"updateState",value:function(e,t){}},{key:"finalizeState",value:function(e){}}]),e}();n.d(t,"experimental",function(){return Re}),n.d(t,"COORDINATE_SYSTEM",function(){return i.a}),n.d(t,"LightingEffect",function(){return r.a}),n.d(t,"PointLight",function(){return m}),n.d(t,"DirectionalLight",function(){return y.a}),n.d(t,"_CameraLight",function(){return _}),n.d(t,"_SunLight",function(){return F}),n.d(t,"PostProcessEffect",function(){return D.a}),n.d(t,"_LayersPass",function(){return N.a}),n.d(t,"Deck",function(){return z.a}),n.d(t,"LayerManager",function(){return B.a}),n.d(t,"AttributeManager",function(){return U.a}),n.d(t,"Layer",function(){return V.a}),n.d(t,"CompositeLayer",function(){return G.a}),n.d(t,"DeckRenderer",function(){return W.a}),n.d(t,"Viewport",function(){return H.a}),n.d(t,"WebMercatorViewport",function(){return X.a}),n.d(t,"project",function(){return q.a}),n.d(t,"project64",function(){return Z.a}),n.d(t,"View",function(){return Y.a}),n.d(t,"MapView",function(){return K.a}),n.d(t,"FirstPersonView",function(){return Q.a}),n.d(t,"ThirdPersonView",function(){return te}),n.d(t,"OrbitView",function(){return ne.a}),n.d(t,"PerspectiveView",function(){return ae}),n.d(t,"OrthographicView",function(){return oe.a}),n.d(t,"Controller",function(){return se.a}),n.d(t,"MapController",function(){return ue.a}),n.d(t,"_FirstPersonController",function(){return ce.a}),n.d(t,"_OrbitController",function(){return le.b}),n.d(t,"_OrthographicController",function(){return fe.a}),n.d(t,"Effect",function(){return he.a}),n.d(t,"TRANSITION_EVENTS",function(){return de.a}),n.d(t,"LinearInterpolator",function(){return ve.a}),n.d(t,"FlyToInterpolator",function(){return Oe}),n.d(t,"log",function(){return Pe.a}),n.d(t,"createIterable",function(){return je.a}),n.d(t,"fp64LowPart",function(){return ke.c}),n.d(t,"AmbientLight",function(){return Me.AmbientLight}),n.d(t,"LayerExtension",function(){return Ie});var Re={Tesselator:Ee,flattenVertices:Se.c,fillArray:Se.a,count:Ae.a,memoize:Te.a}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"e",function(){return d});var i={};function r(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function a(e){return Math.round(e/i.EPSILON)*i.EPSILON}function o(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function O(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.h([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function S(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function j(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){"use strict";var i=n(109),r=n(132),a=n(147),o=n(140),s=n(123),u=n(205),c=n(220),l=n(64),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h={modelMatrix:f,viewMatrix:f,projectionMatrix:f,cameraPositionWorld:[0,0,0]};var d="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",v={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new l.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(d,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(d)},g=n(115),p={lightDirection:new Float32Array([1,1,2])};var m={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[v]},y=n(206),b={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var _={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},x=n(189),w=n(219),O=n(207);n.d(t,"a",function(){return P}),n.d(t,"v",function(){return i.c}),n.d(t,"w",function(){return i.e}),n.d(t,"l",function(){return i.a}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.b}),n.d(t,"q",function(){return o.b}),n.d(t,"n",function(){return s.c}),n.d(t,"m",function(){return s.b}),n.d(t,"y",function(){return s.e}),n.d(t,"x",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u.a}),n.d(t,"k",function(){return c.a}),n.d(t,"u",function(){return v}),n.d(t,"p",function(){return g.a}),n.d(t,"i",function(){return m}),n.d(t,"t",function(){return y.a}),n.d(t,"h",function(){return _}),n.d(t,"o",function(){return x.a}),n.d(t,"s",function(){return x.b}),n.d(t,"r",function(){return w.a}),n.d(t,"b",function(){return O.a});var P={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",uniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(22),l=n(40),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.c(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.j(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.k(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.l(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,n,i){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e[3]=s+i*(n[3]-s),e}function g(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}function p(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function m(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=i.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-u)<=i.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=i.b*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var y,b;y=new i.a(4),i.a!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),b=y},function(e,t,n){e.exports=n(259)()},,function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"g",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"n",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return v}),n.d(t,"a",function(){return g}),n.d(t,"m",function(){return m}),n.d(t,"f",function(){return y});var i=n(12);function r(){var e=new i.a(3);return i.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function l(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function f(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function v(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function g(e,t){var n=o(e[0],e[1],e[2]),i=o(t[0],t[1],t[2]);u(n,n),u(i,i);var r=c(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var p,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},y=a;p=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={LNG_LAT:1,LNGLAT_AUTO_OFFSET:4,METER_OFFSETS:2,LNGLAT_OFFSETS:3,IDENTITY:0}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(32),u=n(11),c=n(52),l=n(59),f=n(30),h=n(118),d=n(234),v=n(19),g=n(26),p={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"},m={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:p},y={removedProps:p},b=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(s.a)(n)),n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=Object(d.a)("Buffer",e,m),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=Object(d.a)("Buffer",e,y))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new l.a(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Object(v.a)(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(Object(f.a)(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return Object(f.a)(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;Object(f.a)(this.gl);var c,l,d=Object(h.c)(this.accessor.type||5126,{clamped:!1}),g=this._getAvailableElementCount(r),p=o;n?c=(l=n.length)-p:l=p+(c=Math.min(g,u||g));var m=Math.min(g,c);return u=u||m,Object(v.a)(u<=m),n=n||new d(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Object(v.a)(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=Object(h.b)(e);return Object(v.a)(i),this.setAccessor(new l.a(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/Object(h.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new l.a(this.accessor,{type:Object(h.b)(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return g.a.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return g.a.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new l.a(this.accessor,e),this}},{key:"type",get:function(){return g.a.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return g.a.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(c.a)},,function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(15),l=n(85),f=n(22),h=n(64),d=n(29),v=n(20),g=n(27),p=n(18),m=Math.PI/180,y=Object(l.a)(),b=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Object(o.b)(t);var r=n.id,a=n.userData,s=void 0===a?{}:a;this.gl=t,this.id=r||Object(u.c)(this.constructor.name),this.userData=s,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=Object(o.d)(this.gl),u={},c=n||Object.keys(r),l=!0,f=!1,h=void 0;try{for(var d,v=c[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value,p=r[g];if(p&&(!("webgl2"in p)||a)&&(!("extension"in p)||this.gl.getExtension(p.extension))){var m=i?Object(s.a)(this.gl,g):g;u[m]=this.getParameter(g,e),i&&"GLenum"===p.type&&(u[m]=Object(s.a)(this.gl,u[m]))}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return u}},{key:"setParameter",value:function(e,t){e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Object(s.b)(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return Object(l.a)(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(f)}},{key:"_deleteHandle",value:function(){throw new Error(f)}},{key:"_bindHandle",value:function(){throw new Error(f)}},{key:"_getOptsFromHandle",value:function(){throw new Error(f)}},{key:"_getParameter",value:function(e,t){throw new Error(f)}},{key:"_setParameter",value:function(e,t){throw new Error(f)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=a.a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;a.a.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=a.a.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=a.a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}()},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(45),l=/([0-9]+\.?[0-9]*)(%|px)/;function f(e){switch(r()(e)){case"number":return{position:e,relative:!1};case"string":var t=e.match(l);if(t&&t.length>=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(105),v=n(18);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,O=t.modelMatrix,P=void 0===O?null:O,S=t.viewportInstance,j=void 0===S?null:S,k=t.type,C=void 0===k?c.a:k;Object(v.a)(!j||j instanceof c.a),this.viewportInstance=j,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(34),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(78),n(89))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(37);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.n([],t,e);return i.k(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(0),r=n(4),a=n(10),o=n(9),s=n(5),u=n(11),c=n(52),l=n(43),f=n(98),h=n(70),d=n(30),v=n(49),g=n(67),p=n(26),m=n(19),y=[9729,9728],b=function(e){function t(e,n){var i;Object(r.a)(this,t);var s=n.id,u=void 0===s?Object(g.c)("texture"):s,c=n.handle,l=n.target;return(i=Object(a.a)(this,Object(o.a)(t).call(this,e,{id:u,handle:c}))).target=l,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&Object(f.d)(e,n))&&(!i||Object(f.e)(e,n))),r}}]),Object(s.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var r=t.pixels,a=void 0===r?null:r,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,v=t.pixelStore,g=void 0===v?{}:v,m=t.textureUnit,y=void 0===m?void 0:m,b=t.unpackFlipY,_=void 0===b||b,x=t.mipmaps,w=void 0===x||x;n||(n=a);var O=t.width,P=t.height,S=t.dataFormat,j=t.type,k=t.depth,C=void 0===k?0:k,E=this._deduceParameters({format:s,type:j,dataFormat:S,compressed:!1,data:n,width:O,height:P});O=E.width,P=E.height,S=E.dataFormat,j=E.type,this.width=O,this.height=P,this.depth=C,this.format=s,this.type=j,this.dataFormat=S,this.border=c,this.textureUnit=y,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var A=Object(i.a)({},37440,_),T=Object.assign({},A,g);return w&&this._isNPOT()&&(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),w=!1,this._updateForNPOT(d)),this.mipmaps=w,this.setImageData({data:n,width:O,height:P,depth:C,format:s,type:j,dataFormat:S,border:c,mipmaps:w,parameters:T}),w&&this.generateMipmap(),this.setParameters(d),f&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.height,n=e.width,i=e.mipmaps,r=void 0!==i&&i;return n!==this.width||t!==this.height?this.initialize({width:n,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,v=e.offset,g=void 0===v?0:v,p=e.parameters,y=void 0===p?{}:p,b=e.data,_=void 0===b?null:b,x=e.type,w=void 0===x?this.type:x,O=e.width,P=void 0===O?this.width:O,S=e.height,j=void 0===S?this.height:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E;_||(_=r);var T=this._deduceParameters({format:u,type:w,dataFormat:C,compressed:A,data:_,width:P,height:j});w=T.type,C=T.dataFormat,A=T.compressed,P=T.width,j=T.height;var M=this.gl;M.bindTexture(this.target,this.handle);var L,I=this._getDataType({data:_,compressed:A});if(_=I.data,L=I.dataType,Object(h.a)(this.gl,y,function(){switch(L){case"null":M.texImage2D(n,o,u,P,j,l,C,w,_);break;case"typed-array":M.texImage2D(n,o,u,P,j,l,C,w,_,g);break;case"buffer":Object(d.a)(M),M.bindBuffer(35052,_.handle||_),M.texImage2D(n,o,u,P,j,l,C,w,g),M.bindBuffer(35052,null);break;case"browser-object":Object(d.d)(M)?M.texImage2D(n,o,u,P,j,l,C,w,_):M.texImage2D(n,o,u,C,w,_);break;case"compressed":M.compressedTexImage2D(n,o,u,P,j,l,_);break;default:Object(m.a)(!1,"Unknown image data type")}}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var R=f.a[this.dataFormat]||4,F=f.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,f=e.y,g=void 0===f?0:f,p=e.width,y=void 0===p?this.width:p,b=e.height,_=void 0===b?this.height:b,x=e.level,w=void 0===x?0:x,O=e.format,P=void 0===O?this.format:O,S=e.type,j=void 0===S?this.type:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E,T=e.offset,M=void 0===T?0:T,L=e.border,I=(void 0===L&&this.border,e.parameters),R=void 0===I?{}:I,F=this._deduceParameters({format:P,type:j,dataFormat:C,compressed:A,data:s,width:y,height:_});if(j=F.type,C=F.dataFormat,A=F.compressed,y=F.width,_=F.height,Object(m.a)(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var D=s;s=D.data,y=D.shape[0],_=D.shape[1]}s instanceof l.a&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,R,function(){A?t.gl.compressedTexSubImage2D(i,w,c,g,y,_,P,s):null===s?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s,M):s instanceof v.b?(Object(d.a)(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,w,c,g,y,_,C,j,M),t.gl.bindBuffer(35052,null)):Object(d.d)(t.gl)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s):t.gl.texSubImage2D(i,w,c,g,C,j,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p.a.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof l.a?{data:t.handle,dataType:"buffer"}:t instanceof v.b?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=f.b[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},Object(m.a)(i,"Could not deduced texture size"),Object(m.a)(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Object(m.a)(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Object(m.a)(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Object(d.d)(this.gl)&&(!(!this.width||!this.height)&&(!Object(g.b)(this.width)||!Object(g.b)(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===y.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(c.a)},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(76);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function o(e){for(var t=1;t0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}n.d(t,"a",function(){return s}),n.d(t,"b",function(){return u})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(36),r=n(4),a=n(5),o=n(67),s=n(19),u={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,e);var n=t.id,i=void 0===n?Object(o.c)("geometry"):n,a=t.drawMode,s=void 0===a?u.TRIANGLES:a,c=t.attributes,l=void 0===c?{}:c,f=t.indices,h=void 0===f?null:f,d=t.vertexCount,v=void 0===d?null:d;this.id=i,this.drawMode=0|s,this.attributes={},this.userData={},this._setAttributes(l,h),this.vertexCount=v||this._calculateVertexCount(this.attributes,this.indices)}return Object(a.a)(e,null,[{key:"DRAW_MODE",get:function(){return u}}]),Object(a.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?Object(i.a)({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Object(s.a)(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||i.size||(i.size=3),"indices"===n?(Object(s.a)(!this.indices),this.indices=i):this.attributes[n]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}return Object(s.a)(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}()},function(e,t,n){"use strict";var i=n(176);function r(e,t,n){return(r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Object(i.a)(a,n.prototype),a}).apply(null,arguments)}var a=n(4),o=n(5),s=n(118),u=n(19),c=n(234);n.d(t,"a",function(){return h});var l={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},f={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},h=function(){function e(){var t=this;Object(a.a)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=Object(c.a)("Accessor",e,f)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(0),r=n(24),a=n(4),o=n(10),s=n(9),u=n(32),c=n(5),l=n(11),f=n(52),h=n(126),d=n(95),v=n(112),g=n(80),p=n(127),m=n(30),y=n(68),b=n(19),_=n(26),x=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this,t),(n=Object(o.a)(this,Object(s.a)(t).call(this,e,i))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(i),Object.seal(Object(u.a)(n)),n}return Object(l.a)(t,e),Object(c.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(c.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(Object(b.a)(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Object(b.a)(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&_.a.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,a=void 0!==i&&i,o=n.resizeAttachments,s=void 0===o||o,u={};a&&Object.keys(this.attachments).forEach(function(e){u[e]=null}),Object.assign(u,e);var c=this.gl.bindFramebuffer(36160,this.handle);for(var l in u){Object(b.a)(void 0!==l,"Misspelled framebuffer binding point?");var f=Number(l),h=u[f],v=h;if(v)if(v instanceof d.a)this._attachRenderbuffer({attachment:f,renderbuffer:v});else if(Array.isArray(h)){var g=Object(r.a)(h,3),p=g[0],m=g[1],y=void 0===m?0:m,_=g[2],x=void 0===_?0:_;v=p,this._attachTexture({attachment:f,texture:p,layer:y,level:x})}else this._attachTexture({attachment:f,texture:v,layer:0,level:0});else this._unattach(f);s&&v&&v.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(w(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&Object(v.a)(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){Object(v.b)({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;Object(m.a)(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Object(y.a)(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?Object(y.a)(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>_.a.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Object(g.b)(this,{maxHeight:100});return _.a.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,r,a){var o,s=null;e&&((s=s||{})[36064]=new h.a(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:r,height:a,mipmaps:!1,parameters:(o={},Object(i.a)(o,10241,9729),Object(i.a)(o,10240,9729),Object(i.a)(o,10242,33071),Object(i.a)(o,10243,33071),o)}));return t&&n?(s=s||{})[33306]=new d.a(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:r,height:111}):t?(s=s||{})[36096]=new d.a(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:r,height:a}):n&&Object(b.a)(!1),s}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof d.a?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Object(b.a)(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;Object(m.d)(t)?t.readBuffer(e):Object(b.a)(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(Object(m.d)(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Object(b.a)(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=Object(p.a)(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(f.a);function w(e){return(x.STATUS||{})[e]||"Framebuffer error ".concat(e)}x.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(9),o=n(5),s=n(11),u=n(162),c=35632,l=35633;function f(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Object(u.a)(t)||"(unnamed)",f="".concat(function(e){switch(e){case c:return"fragment";case l:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),v=0;v1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=d(a,r-o);return s+n+e})}(t);return{shaderName:f,errors:h(a,b),warnings:h(o,b)}}function h(e,t){for(var n="",i=0;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(133).a),p=n(20),m=n(47),y=n(40),b=n(37);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.n(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.n(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.n(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.n(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.n(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(62),r=n(198),a=n(144);function o(e,t,n){var r=i.c[t],o=r?r(e,Number(t)):e.getParameter(Number(t)),s=i.d[t];return Object(a.a)("function"==typeof s),s(e,n,Number(t)),o}function s(e,t){var n={};for(var r in t){var a=Number(r),o=i.d[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],a))}var s=e.state&&e.state.cache;if(s){var u=Object.assign({},s,t);for(var c in n){(0,i.a[c])(e,u)}}}function u(e,t){var n=i.c[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function c(e,t){t=t||i.b;var n=Array.isArray(t)?t:Object.keys(t),r={},a=!0,o=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;r[f]=u(e,f)}}catch(e){o=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return r}function l(e){s(e,Object.assign({},i.b,{}))}function f(e){var t=c(e,Object.keys(i.b)),n={};for(var a in i.b)Object(r.a)(t[a],i.b[a])||(n[a]=t[a]);return n}},function(e,t,n){"use strict";var i=n(9);function r(e,t,n){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(i.a)(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i=n(19),r={};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";r[e]=r[e]||1;var t=r[e]++;return"".concat(e,"-").concat(t)}function o(e){return Object(i.a)("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function s(e){var t=!0;for(var n in e){t=!1;break}return t}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var i=n(19);function r(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var r=e[t=t.replace(/^.*\./,"")];return Object(i.a)(void 0!==r,"Accessing undefined constant GL.".concat(t)),r}function a(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(77),r=n.n(i),a=n(41),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(90),r=n(148),a=n(233),o=n(144);function s(e,t,n){if(Object(a.a)(t))return n(e);var s,u=t.nocatch,c=void 0===u||u;if(Object(o.a)(!t.frameBuffer),Object(i.c)(e),Object(r.a)(e,t),c)s=n(e),Object(i.b)(e);else try{s=n(e)}finally{Object(i.b)(e)}return s}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});var i="vs",r="fs"},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}function o(e){return e&&e[Symbol.asyncIterator]}},function(e,t,n){"use strict";n.d(t,"c",function(){return _}),n.d(t,"a",function(){return x}),n.d(t,"b",function(){return w});var i,r=n(24),a=n(0),o=n(19),s=5120,u=5121,c=5122,l=5123,f=0,h=1,d=2,v=3,g=4,p=5,m=6,y=5126,b=(i={},Object(a.a)(i,y,[y,1,"float"]),Object(a.a)(i,35664,[y,2,"vec2"]),Object(a.a)(i,35665,[y,3,"vec3"]),Object(a.a)(i,35666,[y,4,"vec4"]),Object(a.a)(i,5124,[5124,1,"int"]),Object(a.a)(i,35667,[5124,2,"ivec2"]),Object(a.a)(i,35668,[5124,3,"ivec3"]),Object(a.a)(i,35669,[5124,4,"ivec4"]),Object(a.a)(i,5125,[5125,1,"uint"]),Object(a.a)(i,36294,[5125,2,"uvec2"]),Object(a.a)(i,36295,[5125,3,"uvec3"]),Object(a.a)(i,36296,[5125,4,"uvec4"]),Object(a.a)(i,35670,[y,1,"bool"]),Object(a.a)(i,35671,[y,2,"bvec2"]),Object(a.a)(i,35672,[y,3,"bvec3"]),Object(a.a)(i,35673,[y,4,"bvec4"]),Object(a.a)(i,35674,[y,8,"mat2"]),Object(a.a)(i,35685,[y,8,"mat2x3"]),Object(a.a)(i,35686,[y,8,"mat2x4"]),Object(a.a)(i,35675,[y,12,"mat3"]),Object(a.a)(i,35687,[y,12,"mat3x2"]),Object(a.a)(i,35688,[y,12,"mat3x4"]),Object(a.a)(i,35676,[y,16,"mat4"]),Object(a.a)(i,35689,[y,16,"mat4x2"]),Object(a.a)(i,35690,[y,16,"mat4x3"]),i);function _(e){switch(e){case f:return f;case h:case v:case d:return h;case g:case p:case m:return g;default:return Object(o.a)(!1),0}}function x(e){var t=b[e];if(!t)return null;var n=Object(r.a)(t,2);return{type:n[0],components:n[1]}}function w(e,t){switch(e){case s:case u:case c:case l:e=y}for(var n in b){var i=Object(r.a)(b[n],3),a=i[0],o=i[1],f=i[2];if(a===e&&o===t)return{glType:n,name:f}}return null}},function(e,t,n){"use strict";n.d(t,"e",function(){return y}),n.d(t,"d",function(){return b}),n.d(t,"b",function(){return _}),n.d(t,"a",function(){return w}),n.d(t,"c",function(){return O});var i,r=n(0),a=n(60),o=n(95),s=n(56),u=n(26),c=(i={},Object(r.a)(i,5126,function(e,t,n){return e.uniform1fv(t,g(n,1))}),Object(r.a)(i,35664,function(e,t,n){return e.uniform2fv(t,g(n,2))}),Object(r.a)(i,35665,function(e,t,n){return e.uniform3fv(t,g(n,3))}),Object(r.a)(i,35666,function(e,t,n){return e.uniform4fv(t,g(n,4))}),Object(r.a)(i,5124,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35667,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35668,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35669,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35670,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35671,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35672,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35673,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,g(n,4))}),Object(r.a)(i,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,g(n,9))}),Object(r.a)(i,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,g(n,16))}),Object(r.a)(i,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,5125,function(e,t,n){return e.uniform1uiv(t,m(n,1))}),Object(r.a)(i,36294,function(e,t,n){return e.uniform2uiv(t,m(n,2))}),Object(r.a)(i,36295,function(e,t,n){return e.uniform3uiv(t,m(n,3))}),Object(r.a)(i,36296,function(e,t,n){return e.uniform4uiv(t,m(n,4))}),Object(r.a)(i,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,g(n,6))}),Object(r.a)(i,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,g(n,8))}),Object(r.a)(i,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,g(n,6))}),Object(r.a)(i,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,g(n,12))}),Object(r.a)(i,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,g(n,8))}),Object(r.a)(i,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,g(n,12))}),Object(r.a)(i,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36311,function(e,t,n){return e.uniform1i(t,n)}),i),l={},f={},h={},d=[0];function v(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(d[0]=e,e=d);var r=e.length;if(r%t&&u.a.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&uHTMLVideoElement.HAVE_METADATA&&(i.width!==o.videoWidth||i.height!==o.videoHeight?(i.resize({width:o.videoWidth,height:o.videoHeight,mipmaps:!0}),i.setSubImageData({data:o,paramters:P})):i.setSubImageData({data:o}),i.generateMipmap());i&&r&&r.setUniforms(Object.assign({},t,{bitmapTexture:i,desaturate:s,transparentColor:u.map(function(e){return e/255}),tintColor:c.slice(0,3).map(function(e){return e/255})})).draw()}},{key:"loadTexture",value:function(e){var t=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),e instanceof O.a?this.setState({bitmapTexture:e}):e instanceof HTMLVideoElement?this.setState({bitmapTexture:new O.a(t,{width:1,height:1,parameters:P,mipmaps:!1})}):e&&this.setState({bitmapTexture:new O.a(t,{data:e,parameters:P})})}},{key:"calculatePositions",value:function(e){var t=e.value,n=this.state.positions;t.set(n)}},{key:"calculatePositions64xyLow",value:function(e){var t=this.use64bitPositions();(e.constant=!t,t)?e.value.set(this.state.positions.map(b.c)):e.value=new Float32Array(4)}}]),t}(_.a);S.layerName="BitmapLayer",S.defaultProps={image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};var j,k=n(72),C=n(80),E=n(122),A=1024,T=4,M=function(){},L=(j={},y()(j,10241,9987),y()(j,10240,9729),j);function I(e){return e&&(e.id||e.url)}function R(e,t,n){for(var i=0;i0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&(R(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&R(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new O.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:L})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(C.f)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:L}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(E.b)(e.url).then(function(r){var a=I(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},L,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),D=[0,0,0,255],N={iconAtlas:{type:"object",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},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:D},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},z=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new F(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:D},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s||this.props._asyncPropOriginalValues.iconAtlas?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),r.extensionsChanged){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(k.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=Object(b.c)(p[0]),a[o++]=Object(b.c)(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(_.a);z.layerName="IconLayer",z.defaultProps=N;var B=n(222),U=n(192),V=[0,0,0,255],G=[0,0,1],W=new U.a,H={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:G},getColor:{type:"accessor",value:V},material:W,radiusPixels:{deprecatedFor:"pointSize"}};var X=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:G},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:V}})}},{key:"updateState",value:function(e){var n,i,r,a=e.props,o=e.oldProps,s=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:a,oldProps:o,changeFlags:s}),s.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),this.getAttributeManager().invalidateAll()}s.dataChanged&&(n=a.data,i=n.header,r=n.attributes,i&&r&&(n.length=i.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION,r.instancePositions64xyLow={constant:!0,value:new Float32Array(2)}),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0&&(r.instanceColors=r.COLOR_0)))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(k.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var _=s(y,h);u[c++]=Object(b.c)(_[0]),u[c++]=Object(b.c)(_[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(_.a);X.layerName="PointCloudLayer",X.defaultProps=H;var q=n(171),Z=n(170),Y=n(217),K=n(114),Q=n(218),J=n(223),$=n(193),ee=n(16),te=n.n(ee),ne=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position); \n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getParagraphSize,f=r.getRowSize,h=r.getOffsets,d=e.value,v=n*e.size,g=Object(k.a)(a,n,i).iterable,p=!0,m=!1,y=void 0;try{for(var b,_=g[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){var x=b.value,w=o[s(x)]||{},O=l(x),P=te()(O,2),S=P[0],j=P[1],C=f(x),E=te()(C,1)[0],A=h(x),T=te()(A,2),M=T[0],L=T[1],I=u(x),R=c(x),F=(1-I)*(S-E)/2;d[v++]=(I-1)*S/2+F+w.width/2+M||0,d[v++]=(R-1)*j/2+w.height/2+L||0}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(k.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(z);ne.layerName="MultiIconLayer",ne.defaultProps={getRowSize:{type:"accessor",value:function(e){return e.rowSize||[0,0]}},getOffsets:{type:"accessor",value:function(e){return e.offsets||[0,0]}},getParagraphSize:{type:"accessor",value:function(e){return e.size||[1,1]}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ie=n(231),re=n.n(ie),ae=n(15),oe=32;function se(e,t,n,i,r){var a=e.split("\n"),o=[0,0],s=0;a.forEach(function(e){var a=function(e,t,n){var i=0,r=0,a=Array.from(e);return{characters:a=a.map(function(e,a){var o={text:e,offsetLeft:i},s=t[e];return s?(i+=s.width,r||(r=s.height*n)):(ae.a.warn("Missing character: ".concat(e))(),i+=oe),o}),rowWidth:i,rowHeight:r}}(e,n,t),u=a.characters,c=a.rowWidth,l=a.rowHeight,f=[c,l];u.forEach(function(e){e.offsetTop=s,e.size=o,e.rowSize=f,r.push(i(e))}),s+=l,o[0]=Math.max(o[0],c)}),o[1]=s}var ue=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ce=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),le="Monaco, monospace",fe="normal",he=64,de=2,ve=.25,ge=3,pe=new ue(3),me=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function ye(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};me.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=pe.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=pe.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),pe.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");be(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(be(h,r,o,a),u){var b=new re.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,O=void 0;try{for(var P,S=t[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;ye(b.draw(j),_),h.putImageData(_,v[j].x-s,v[j].y-s)}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}}else{var k=!0,C=!1,E=void 0;try{for(var A,T=t[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h.fillText(M,v[M].x,v[M].y+.9*o)}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=pe.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),xe=n(139),we={fontSize:he,buffer:de,sdf:!1,radius:ge,cutoff:ve},Oe={start:1,middle:0,end:-1},Pe={top:1,center:0,bottom:-1},Se=["fontSize","buffer","sdf","radius","cutoff"],je={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ce,fontFamily:le,fontWeight:fe,lineHeight:1,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},ke=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new _e(this.context.gl)}}},{key:"updateState",value:function(e){var t=this,n=e.props,i=e.oldProps,r=e.changeFlags,a=this.fontChanged(i,n);a&&this.updateFontAtlas({oldProps:i,props:n});var o=r.dataChanged||a||n.lineHeight!==i.lineHeight||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText);if(o&&Array.isArray(r.dataChanged)){var s=this.state.data.slice(),u=r.dataChanged.map(function(e){return Object(xe.a)({data:s,getIndex:function(e){return e.__source.index},dataRange:e,replace:t.transformStringToLetters(e)})});this.setState({data:s,dataDiff:u})}else o&&this.setState({data:this.transformStringToLetters(),dataDiff:null})}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},we,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return Se.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,r=n.lineHeight,a=n.getText,o=this.state.iconMapping,s=t.startRow,u=t.endRow,c=Object(k.a)(i,s,u),l=c.iterable,f=c.objectInfo,h=[],d=!0,v=!1,g=void 0;try{for(var p,m=function(){var t=p.value;f.index++;var n=a(t,f);n&&se(n,r,o,function(n){return e.getSubLayerRow(n,t,f.index)},h)},y=l[Symbol.iterator]();!(d=(p=y.next()).done);d=!0)m()}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}return h}},{key:"getAnchorXFromTextAnchor",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Oe[e]||0}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Pe[e]||0}}},{key:"renderLayers",value:function(){var e=this.state,t=e.data,n=e.dataDiff,i=e.scale,r=e.iconAtlas,a=e.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.billboard,g=o.sdf,p=o.sizeScale,m=o.sizeUnits,y=o.sizeMinPixels,b=o.sizeMaxPixels,_=o.transitions,x=o.updateTriggers;return new(this.getSubLayerClass("characters",ne))({sdf:g,iconAtlas:r,iconMapping:a,_dataDiff:n&&function(){return n},getPosition:this.getSubLayerAccessor(s),getColor:this.getSubLayerAccessor(u),getSize:this.getSubLayerAccessor(c),getAngle:this.getSubLayerAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this.getSubLayerAccessor(d),getPickingIndex:function(e){return e.__source.index},billboard:v,sizeScale:p*i,sizeUnits:m,sizeMinPixels:y*i,sizeMaxPixels:b*i,transitions:_&&{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:x.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:x.getPixelOffset,getAnchorX:x.getTextAnchor,getAnchorY:x.getAlignmentBaseline}}),{data:t,getIcon:function(e){return e.text},getRowSize:function(e){return e.rowSize},getOffsets:function(e){return[e.offsetLeft,e.offsetTop]},getParagraphSize:function(e){return e.size}})}}]),t}($.a);ke.layerName="TextLayer",ke.defaultProps=je;var Ce=n(131);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return S}),n.d(t,"IconLayer",function(){return z}),n.d(t,"LineLayer",function(){return B.a}),n.d(t,"PointCloudLayer",function(){return X}),n.d(t,"ScatterplotLayer",function(){return q.a}),n.d(t,"ColumnLayer",function(){return Z.a}),n.d(t,"GridCellLayer",function(){return Y.a}),n.d(t,"PathLayer",function(){return K.a}),n.d(t,"PolygonLayer",function(){return Q.a}),n.d(t,"GeoJsonLayer",function(){return J.a}),n.d(t,"TextLayer",function(){return ke}),n.d(t,"SolidPolygonLayer",function(){return Ce.a}),n.d(t,"_MultiIconLayer",function(){return ne})},function(e,t,n){"use strict";var i=n(43),r=n(60),a=n(56),o=n(70),s=n(30),u=n(118),c=n(19);function l(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(c.a)(!1),0}}var f=n(159),h=n(26);function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,f=t.sourceAttachment,h=void 0===f?36064:f,d=t.target,v=void 0===d?null:d,g=t.sourceWidth,p=t.sourceHeight,m=t.sourceType,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=_.attachments;g=g||_.width,p=p||_.height,36064===h&&null===O&&(h=1028),Object(c.a)(P[h]),v=function(e,t,n,i,r){if(e)return e;t=t||5121;var a=Object(u.c)(t,{clamped:!1}),o=l(n);return new a(i*r*o)}(v,m=m||P[h].type,s,g,p),m=m||Object(u.b)(v);var S=w.bindFramebuffer(36160,O);return w.readPixels(i,a,g,p,s,m,v),w.bindFramebuffer(36160,S||null),x&&_.delete(),v}function v(e,t){var n=t.sourceX,r=void 0===n?0:n,a=t.sourceY,u=void 0===a?0:a,f=t.sourceFormat,h=void 0===f?6408:f,d=t.target,v=void 0===d?null:d,g=t.targetByteOffset,p=void 0===g?0:g,m=t.sourceWidth,y=t.sourceHeight,_=t.sourceType,x=b(e),w=x.framebuffer,O=x.deleteFramebuffer;Object(c.a)(w);var P=w.gl;if(m=m||w.width,y=y||w.height,Object(s.a)(P),_=_||(v?v.type:5121),!v){var S=l(h),j=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(c.a)(!1),0}}(_),k=p+m*y*S*j;v=new i.a(P,{byteLength:k,accessor:{type:_,size:S}})}return v.bind({target:35051}),Object(o.a)(P,{framebuffer:w},function(){P.readPixels(r,u,m,y,h,_,p)}),v.unbind({target:35051}),O&&w.delete(),v}function g(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=d(e,{sourceAttachment:i}),s=e.width,c=e.height;c>a;){var l=Object(u.d)({data:o,width:s,height:c});o=l.data,s=l.width,c=l.height}Object(u.a)({data:o,width:s,height:c});var f=document.createElement("canvas");f.width=s,f.height=c;var h=f.getContext("2d"),v=h.createImageData(s,c);return v.data.set(o),h.putImageData(v,0,0),f.toDataURL()}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=g(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,o=n.sourceY,s=void 0===o?0:o,u=n.targetX,l=n.targetY,f=n.targetZ,h=n.targetMipmaplevel,d=void 0===h?0:h,v=n.targetInternalFormat,g=void 0===v?6408:v,p=n.width,m=n.height,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=void 0!==u||void 0!==l||void 0!==f;u=u||0,l=l||0,f=f||0;var S=w.bindFramebuffer(36160,O);Object(c.a)(t);var j=null;if(t instanceof a.a&&(j=t,p=Number.isFinite(p)?p:j.width,m=Number.isFinite(m)?m:j.height,j.bind(0),t=j.target),P)switch(t){case 3553:case 34067:w.copyTexSubImage2D(t,d,u,l,r,s,p,m);break;case 35866:case 32879:w.copyTexSubImage3D(t,d,u,l,f,r,s,p,m)}else w.copyTexImage2D(t,d,g,r,s,p,m,0);return j&&j.unbind(),w.bindFramebuffer(36160,S||null),x&&_.delete(),j}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,u=n.sourceY0,l=void 0===u?0:u,f=n.sourceX1,d=n.sourceY1,v=n.targetX0,g=void 0===v?0:v,p=n.targetY0,m=void 0===p?0:p,y=n.targetX1,_=n.targetY1,x=n.color,w=void 0===x||x,O=n.depth,P=void 0!==O&&O,S=n.stencil,j=void 0!==S&&S,k=n.mask,C=void 0===k?0:k,E=n.filter,A=void 0===E?9728:E,T=b(e),M=T.framebuffer,L=T.deleteFramebuffer,I=b(t),R=I.framebuffer,F=I.deleteFramebuffer;Object(c.a)(M),Object(c.a)(R);var D=R.gl,N=R.handle,z=R.width,B=R.height,U=R.readBuffer;Object(s.a)(D),M.handle||36064!==r||(r=1028),w&&(C|=16384),P&&(C|=256),j&&(C|=1024),(L||F)&&1280&C&&(C=16384,h.a.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Object(c.a)(C),f=void 0===f?M.width:f,d=void 0===d?M.height:d,y=void 0===y?z:y,_=void 0===_?B:_;var V=D.bindFramebuffer(36009,N),G=D.bindFramebuffer(36008,M.handle);return D.readBuffer(r),D.blitFramebuffer(o,l,f,d,g,m,y,_,C,A),D.readBuffer(U),D.bindFramebuffer(36008,G||null),D.bindFramebuffer(36009,V||null),L&&M.delete(),F&&R.delete(),R}function b(e){return e instanceof r.a?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Object(f.b)(e),deleteFramebuffer:!0}}n.d(t,"e",function(){return d}),n.d(t,"f",function(){return v}),n.d(t,"b",function(){return g}),n.d(t,"c",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return y})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(179),v=n(22),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(81),u=n(180),c=n(18),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(82),u=n(15),c=n(18),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,e.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){if(!this.isDragging())return!1;var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState,r={};switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut(),r.isZooming=!0;break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn(),r.isZooming=!0;break;case 37:n?(t=i.rotateLeft(),r.isRotating=!0):(t=i.moveLeft(),r.isPanning=!0);break;case 39:n?(t=i.rotateRight(),r.isRotating=!0):(t=i.moveRight(),r.isPanning=!0);break;case 38:n?(t=i.rotateUp(),r.isRotating=!0):(t=i.moveUp(),r.isPanning=!0);break;case 40:n?(t=i.rotateDown(),r.isRotating=!0):(t=i.moveDown(),r.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),r),!0}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";var i=n(205),r=n(42),a=Object.keys(r.a).map(function(e){return"const float COORDINATE_SYSTEM_".concat(e," = ").concat(r.a[e],".;")}).join(""),o="".concat(a,"\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform float project_uAntimeridian;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n dy = clamp(dy, -1., 1.);\n }\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n"),s=n(136),u={};t.a={name:"project",dependencies:[i.a],vs:o,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?Object(s.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return v});var i=n(29);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-t[2],-t[6],-t[10]],up:[t[1],t[5],t[9]],right:[t[0],t[4],t[8]]}}var o=new i.a,s=new i.a,u=new i.a,c=new i.a,l=new i.a,f=new i.a,h=new i.a;function d(e){var t=e.aspect,n=e.near,r=e.far,a=e.fovyRadians,d=e.position,v=e.direction,g=e.up,p=e.right;s.copy(v);var m=1/s.len();s.normalize(),o.copy(d),u.copy(g).normalize(),c.copy(p).normalize();var y=2*Math.tan(a/2)*n,b=y*t;l.copy(s).scale(n*m).add(o),f.copy(s).scale(r*m).add(o);var _=s.clone().negate(),x=_.dot(l),w={near:{distance:x,normal:_},far:{distance:s.dot(f),normal:s.clone()}};return h.copy(c).scale(.5*b).add(l).subtract(o).normalize(),_=new i.a(u).cross(h),x=o.dot(_),w.right={normal:_,distance:x},h.copy(c).scale(.5*-b).add(l).subtract(o).normalize(),_=new i.a(h).cross(u),x=o.dot(_),w.left={normal:_,distance:x},h.copy(u).scale(.5*y).add(l).subtract(o).normalize(),_=new i.a(h).cross(c),x=o.dot(_),w.top={normal:_,distance:x},h.copy(u).scale(.5*-y).add(l).subtract(o).normalize(),_=new i.a(c).cross(h),x=o.dot(_),w.bottom={normal:_,distance:x},w}function v(e){return e-Math.fround(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(96),r=n(54);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t){var n,i,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),Object(c.a)(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(78))},function(e,t,n){"use strict";var i=n(36),r=n(90),a=n(49),o="Failed to create WebGL context in Node.js, headless gl not available",s="Failed to create WebGL context in Node.js, headless gl returned null";var u=n(125);var c=n(111),l=(n(19),n(110)),f=n(26),h=n(46);n.d(t,"e",function(){return g}),n.d(t,"a",function(){return p}),n.d(t,"c",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"d",function(){return b});function d(e){return Boolean(e&&2===e._version)}var v={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(v,{width:1,height:1},e)}function p(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},v,t),r=n.width,h=n.height;function g(e){if(t.throwOnError)throw new Error(e);return null}if(l.a){var p=t.canvas;e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(Object(u.a)({canvas:p,width:r,height:h,onError:g}),t)}else e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,u=e.onError;if(r&&!i)return u("headless-gl does not support WebGL2");if(!a.c)return u(o);var c=Object(a.c)(t,n,e);return c||u(s)}(Object(i.a)({},t,{width:r,height:h,onError:g}));return e?(function(e){var t=d(e)?"WebGL2":"WebGL1",n=Object(c.a)(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";f.a.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=m(e,t)),e):null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==a.a&&e instanceof a.a)return 2;return 1}(e);var n=t=Object.assign({},v,t),i=n.manageState,o=n.debug;return i&&Object(r.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(5),a=n(29),o=n(64),s=n(67),u=n(19),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id;this.id=n||Object(s.c)(this.constructor.name),this.display=!0,this.position=new a.a,this.rotation=new a.a,this.scale=new a.a(1,1,1),this.matrix=new o.a,this.userData={},this.props={},this._setScenegraphNodeProps(t)}return Object(r.a)(e,[{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:"setPosition",value:function(e){return Object(u.a)(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return Object(u.a)(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return Object(u.a)(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Object(u.a)(e),t=t||this.matrix;var n=new o.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{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)}}]),e}()},function(e,t,n){"use strict";var i=n(0),r=n(36),a=n(4),o=n(5),s=n(10),u=n(9),c=n(66),l=n(11),f=n(43),h=n(202),d=n(19),v={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function g(e,t){var n=(t||{}).attributeMap,i=void 0===n?v:n;return i&&i[e]||e}function p(e,t){var n;switch(e){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2}Object(d.a)(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var m=n(30),y=n(203),b=n(112),_=n(177),x=n(197),w=n(28),O=n(132),P=n(208),S=n(209),j=n(210),k=n(41),C=n.n(k),E=n(46),A={},T=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},M=new Map;C.a.listenFor("luma.gl",function(e){var t=A[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){E.d.__SEER_INITIALIZED__&&(M.has(e)||M.set(e,new Map),M.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();T(i,n,e.value),t.setUniforms(i)}});var L=n(67),I=n(26),R=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),Object(d.a)(Object(m.c)(t));var i=n.id,r=void 0===i?Object(L.c)("base-model"):i;this.id=r,this.gl=t,this.id=n.id||Object(L.c)("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(o.a)(e,[{key:"initialize",value:function(e){this.props={},this.program=this._createProgram(e),this.vertexArray=new y.a(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete A[t],C.a.deleteItem("luma.gl",t)}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.uniforms}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),function(e,t){if(E.d.__SEER_INITIALIZED__&&e){var n=M.get(e);n&&n.forEach(function(e,n){T(t,n,e)})}}(this.id,e),e=this._extractAnimatedUniforms(e),this.program.setUniforms(e),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return Object(b.a)(this.program.gl,e),this}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,s=t.attributes,u=void 0===s?{}:s,c=t.transformFeedback,l=void 0===c?this.transformFeedback:c,f=t.parameters,h=void 0===f?{}:f,d=t.vertexArray,v=void 0===d?this.vertexArray:d,g=t.animationProps;A[(e=this).id]||(A[e.id]=e,C.a.listItem("luma.gl",e.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(g);var p=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&I.a.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,b=m.indexType,_=m.indexOffset,x=this.isInstanced,w=this.instanceCount,O=function(){},P=this.props,S=P.onBeforeRender,j=void 0===S?O:S,k=P.onAfterRender,E=void 0===k?O:k;j(),this._timerQueryStart();var T=this.program.draw(Object.assign({},t,{logPriority:p,uniforms:null,framebuffer:r,parameters:h,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:b,isInstanced:x,instanceCount:w,offset:y?_:0}));return this._timerQueryEnd(),E(),this._logDrawCallEnd(p,v,r),T}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&_.a.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&I.a.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,s=e.defines,u=void 0===s?{}:s,c=e.inject,l=void 0===c?{}:c,f=e.shaderCache,h=void 0===f?null:f,v=e.varyings,g=void 0===v?null:v,p=e.bufferMode,m=void 0===p?35981:p,y=e.program,b=void 0===y?null:y;this.getModuleUniforms=function(e){};var _=this.id;if(!b){n=n||w.a.vs,r=r||w.a.fs;var P=Object(O.a)(this.gl,{vs:n,fs:r,modules:o,inject:l,defines:u,log:I.a});n=P.vs,r=P.fs,b=h?h.getProgram(this.gl,{id:_,vs:n,fs:r}):new x.a(this.gl,{id:_,vs:n,fs:r,varyings:g,bufferMode:m}),this.getModuleUniforms=P.getUniforms||function(e){}}return Object(d.a)(b instanceof x.a,"Model needs a program"),b}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!Object(L.a)(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new _.a(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,I.a.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(I.a.priority>> DRAWING MODEL ".concat(this.id),{collapsed:I.a.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=Object(P.a)({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=Object(S.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,c=Object(S.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),l=c.table;c.count>0&&I.a.log("MISSING UNIFORMS",Object.keys(l))(),u>0&&I.a.log("UNUSED UNIFORMS",Object.keys(s))();var f=Object(j.a)(this.vertexArray.configuration);I.a.table(e,r)(),I.a.table(e,o)(),I.a.table(e+1,f)(),function(e,t){if(C.a.isReady()&&!C.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);C.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),I.a.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}();n.d(t,"a",function(){return F});var F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,t);var i=n.id,o=void 0===i?Object(L.c)("model"):i;return Object(s.a)(this,Object(u.a)(t).call(this,e,Object(r.a)({},n,{id:o})))}return Object(l.a)(t,e),Object(o.a)(t,[{key:"initialize",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Object(d.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){Object(c.a)(Object(u.a)(t.prototype),"delete",this).call(this),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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Object(d.a)(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Object(d.a)(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=function(e,t,n){var i={},a=t.indices;for(var o in t.attributes){var s=t.attributes[o],u=g(o,n);if("indices"===o)a=s;else if(s.constant)i[u]=s.value;else{var c=s.value,l=Object(r.a)({},s);delete l.value,i[u]=[new f.a(e,c),l],p(o,l)}}if(a){var h=a.value||a;Object(d.a)(h instanceof Uint16Array||h instanceof Uint32Array,'attribute array for "indices" must be of integer type');var v={size:1,isIndexed:void 0===a.isIndexed||a.isIndexed};i.indices=[new f.a(e,{data:h,target:34963}),v]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(L.a)(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,r=e.feedbackBuffers,a=e.unbindModels,o=void 0===a?[]:a,s=e.parameters;r&&this._setFeedbackBuffers(r),n&&(s=Object.assign({},s,Object(i.a)({},35977,n))),o.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:s}))}finally{o.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return I.a.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof f.a&&t.delete()}}},{key:"_setAnimationProps",value:function(e){if(this.animated){Object(d.a)(e,"Model.draw(): animated uniforms but no animationProps");var t=this._evaluateAnimateUniforms(e);this.program.setUniforms(t)}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(L.a)(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new h.a(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}}]),t}(R)},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,i))).initialize(i),Object.seal(Object(s.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=Object(v.d)(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,d)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(u.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Object(g.a)(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Object(v.d)(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*d[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(174),r="7.2.1",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return h});var i,r,a,o=n(0),s=n(30),u=(i={},Object(o.a)(i,6407,{dataFormat:6407,types:[5121,33635]}),Object(o.a)(i,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(o.a)(i,6406,{dataFormat:6406,types:[5121]}),Object(o.a)(i,6409,{dataFormat:6409,types:[5121]}),Object(o.a)(i,6410,{dataFormat:6410,types:[5121]}),Object(o.a)(i,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(o.a)(i,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(o.a)(i,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(o.a)(i,34836,{dataFormat:6408,types:[5126],gl2:!0}),i),c=(r={},Object(o.a)(r,6403,1),Object(o.a)(r,36244,1),Object(o.a)(r,33319,2),Object(o.a)(r,33320,2),Object(o.a)(r,6407,3),Object(o.a)(r,36248,3),Object(o.a)(r,6408,4),Object(o.a)(r,36249,4),Object(o.a)(r,6402,1),Object(o.a)(r,34041,1),Object(o.a)(r,6406,1),Object(o.a)(r,6409,1),Object(o.a)(r,6410,2),r),l=(a={},Object(o.a)(a,5126,4),Object(o.a)(a,5125,4),Object(o.a)(a,5124,4),Object(o.a)(a,5123,2),Object(o.a)(a,5122,2),Object(o.a)(a,5131,2),Object(o.a)(a,5120,1),Object(o.a)(a,5121,1),a);function f(e,t){var n=u[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=Object(s.d)(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}function h(e,t){var n=u[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},,function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(10),a=n(9),o=n(11),s=n(93),u=n(58),c="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",l=[-1,-1,1,-1,-1,1,1,1],f=function(e){function t(e,n){var o;Object(i.a)(this,t);var s=l.map(function(e){return-1===e?0:e});return(o=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},n,{vs:c,geometry:new u.a({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(l)},aTexCoord:{size:2,value:new Float32Array(s)},aCoordinate:{size:2,value:new Float32Array(s)}}})})))).setVertexCount(4),o}return Object(o.a)(t,e),t}(s.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(178),v=n(70),g=n(112),p=n(148),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.a)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.a)(e,{scissorTest:!0,scissor:l},function(){return Object(g.a)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(p.a)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,mousePosition:e.context.mousePosition,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.a)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i,r=n(0),a=n(30),o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",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"};t.b=(i={},Object(r.a)(i,o.WEBGL2,[function(e){return Object(a.d)(e)}]),Object(r.a)(i,o.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(r.a)(i,o.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(r.a)(i,o.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(r.a)(i,o.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(r.a)(i,o.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(r.a)(i,o.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(r.a)(i,o.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(r.a)(i,o.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(r.a)(i,o.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(r.a)(i,o.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(r.a)(i,o.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(r.a)(i,o.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(r.a)(i,o.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),i)},function(e,t,n){"use strict";function i(e,t){return e===t||Object.keys(e).every(function(n){return Array.isArray(e[n])&&Array.isArray(t[n])?i(e[n],t[n]):e[n]===t[n]})}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(32),o=n(9),s=n(66),u=n(5),c=n(11),l=n(52),f=n(43),h=n(30),d=null;function v(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!d||d.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var u=s.id||s.program&&s.program.id;return(n=Object(r.a)(this,Object(o.a)(t).call(this,e,Object.assign({},s,{id:u})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(s),Object.seal(Object(a.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?Object(h.d)(e)||"Chrome"===function(e){if(!e&&!Object(m.a)())return"Node";if(Object(y.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":p.b.chrome?"Chrome":p.b.safari?"Safari":p.b.mozInnerScreenX?"Firefox":"Unknown"}():Object(h.d)(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Object(g.a)(!1)}}}]),Object(u.a)(t,[{key:"delete",value:function(){Object(s.a)(Object(o.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(g.a)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Object(g.a)(Object(h.d)(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new f.a(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=v(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof a.a)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof a.a)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new a.a(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"e",function(){return c}),n.d(t,"a",function(){return l}),n.d(t,"c",function(){return f}),n.d(t,"d",function(){return h}),n.d(t,"b",function(){return d});var u=new s;function c(e){u.setDefaultShaderModules(e)}function l(){return u.getDefaultShaderModules()}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;u.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(u.defaultShaderModules),v(e=u.resolveModules(e))}function d(e){return u.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,a=t.color,l=void 0===a?null:a,f=t.depth,h=void 0===f?null:f,d=t.stencil,g=void 0===d?null:d,p={};i&&(p.framebuffer=i);var m=0;l&&(m|=c,!0!==l&&(p.clearColor=l)),h&&(m|=s,!0!==h&&(p.clearDepth=h)),g&&(m|=u,!0!==h&&(p.clearStencil=h)),Object(o.a)(0!==m,v),Object(r.a)(e,p,function(){e.clear(m)})}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,s=void 0===n?null:n,u=t.buffer,c=void 0===u?l:u,g=t.drawBuffer,p=void 0===g?0:g,m=t.value,y=void 0===m?[0,0,0,0]:m;Object(a.a)(e),Object(r.a)(e,{framebuffer:s},function(){switch(c){case l:switch(y.constructor){case Int32Array:e.clearBufferiv(c,p,y);break;case Uint32Array:e.clearBufferuiv(c,p,y);break;case Float32Array:default:e.clearBufferfv(c,p,y)}break;case f:e.clearBufferfv(f,0,[y]);break;case h:e.clearBufferiv(h,0,[y]);break;case d:var t=Object(i.a)(y,2),n=t[0],r=t[1];e.clearBufferfi(d,0,n,r);break;default:Object(o.a)(!1,v)}})}},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=function(e){function t(e){var n;r()(this,t),n=u()(this,l()(t).call(this,e));var i=e._shadow,a=void 0!==i&&i;return n.shadow=a,n}return h()(t,e),o()(t,[{key:"getProjectedLight",value:function(){return this}}]),t}(n(146).b)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(130),p=n(93),m=n(58),y=n(21),b=n(85),_=y.experimental.Tesselator,x=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3,padding:3},endPositions:{size:3,padding:3},segmentTypes:{size:1,type:Uint8ClampedArray},startPositions64XyLow:{size:2,padding:2,fp64Only:!0},endPositions64XyLow:{size:2,padding:2,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){var t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t<3?0:t+1:t-1}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.startPositions64XyLow,o=n.endPositions64XyLow,s=n.segmentTypes,u=this.fp64,c=t.geometrySize;if(0!==c)for(var l,f,h=this.isClosed(e),d=t.vertexStart,v=0;v=e.length&&(t+=1-e.length/n),[e[t*n],e[t*n+1],3===n?e[t*n+2]:0]}return t>=e.length&&(t+=1-e.length),e[t]}},{key:"isClosed",value:function(e){var t=this.getPathLength(e),n=this.getPointOnPath(e,0),i=this.getPointOnPath(e,t-1);return n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]}}]),t}(_);n.d(t,"a",function(){return S});var w=[0,0,0,255],O={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:w},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},P={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceLeftStartPositions64xyLow;\nattribute vec4 instanceEndRightPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width, vec2 widthPixels\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(vCornerOffset * widthPixels * isValid, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n return currPoint + vec3(offset.xy / widthPixels * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n vec2 width = billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width, widthPixels\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.worldPosition = instanceStartPositions;\n geometry.worldPositionAlt = instanceEndPositions;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceLeftStartPositions64xyLow.xy, instanceLeftStartPositions64xyLow.zw, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceLeftStartPositions64xyLow.zw, instanceEndRightPositions64xyLow.xy, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceEndRightPositions64xyLow.xy, instanceEndRightPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({startPositions:{size:3,offset:12,transition:P,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{offset:0},instanceStartPositions:{offset:12}}},endPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0,shaderAttributes:{instanceEndPositions:{offset:0},instanceRightPositions:{offset:12}}},instanceLeftStartPositions64xyLow:{size:4,stride:8,update:this.calculateLeftStartPositions64xyLow,noAlloc:!0},instanceEndRightPositions64xyLow:{size:4,stride:8,update:this.calculateEndRightPositions64xyLow,noAlloc:!0},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:P,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:P,defaultValue:w},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new x({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions(),dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),r.dataChanged||a.invalidateAll()}if(r.extensionsChanged){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.a({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateSegmentTypes",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("segmentTypes")}},{key:"calculateLeftStartPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startPositions64XyLow"):new Float32Array(4)}},{key:"calculateEndRightPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("endPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,o=n.pointLights,s=n.directionalLights,u=i||o&&o.length>0||s&&s.length>0;return u?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,o=void 0===r?[]:r,s={};s["lighting_uAmbientLight.color"]=t?a(t):[0,0,0];return i.forEach(function(e,t){s["lighting_uPointLight[".concat(t,"].color")]=a(e),s["lighting_uPointLight[".concat(t,"].position")]=e.position,s["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),s.lighting_uPointLightCount=i.length,o.forEach(function(e,t){s["lighting_uDirectionalLight[".concat(t,"].color")]=a(e),s["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),s.lighting_uDirectionalLightCount=o.length,s}({ambientLight:i,pointLights:o,directionalLights:s}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var c={pointLights:[],directionalLights:[]},l=!0,f=!1,h=void 0;try{for(var d,v=(t.lights||[])[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;switch(g.type){case"ambient":c.ambientLight=g;break;case"directional":c.directionalLights.push(g);break;case"point":c.pointLights.push(g)}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return e({lightSources:c})}return{}},defines:{MAX_LIGHTS:3}},{});function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o});var i=n(57),r={};function a(e){e=Array.isArray(e)?e:[e];var t=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var u=o.value,c=Object(i.b)(u),l=!0,f=!1,h=void 0;try{for(var d,v=c.extensions[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;r[g]=c}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}}catch(e){n=!0,a=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}}function o(){return Object.values(r)}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"d",function(){return s});var i="Failed to deduce GL constant from typed array";function r(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(i)}}function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u=24&&2303741511===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint32(16,u),height:e.getUint32(20,u)}}}],["image/jpeg",{test:function(e){return e.byteLength>=2&&65496===e.getUint16(0,u)},getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,u))return null;var t=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),n=t.tableMarkers,i=t.sofMarkers,r=2;for(;r=10&&1195984440===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint16(6,c),height:e.getUint16(8,c)}}}],["image/bmp",{test:function(e){return e.byteLength>=2&&16973===e.getUint16(0,u)},getSize:function(e){return{width:e.getUint32(18,c),height:e.getUint32(22,c)}}}]]);var f="Invalid MIME type. Supported MIME types are: ".concat(Array.from(l.keys()).join(", "));function h(e){var t=g(e),n=!0,i=!1,r=void 0;try{for(var a,o=l.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=Object(s.a)(a.value,2),c=u[0];if((0,u[1].test)(t))return c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(0,v(t=t||h(e)).getSize)(g(e));if(!n)throw new Error("invalid image data for type: ".concat(t));return n}(e,t=t||h(e));return n.mimeType=t,n}function v(e){var t=l.get(e);if(!t)throw new Error(f);return t}function g(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}n.d(t,"a",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"e",function(){return _}),n.d(t,"c",function(){return x});var p=o.a._parseImageNode||"undefined"!=typeof ImageBitmap;function m(e,t){if(o.a._parseImageNode){var n=d(e).mimeType;return o.a._parseImageNode(e,n,t)}return _(e,t)}function y(e){return b.apply(this,arguments)}function b(){return(b=Object(a.a)(r.a.mark(function e(t){var n,i,a,o=arguments;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:{},"undefined"!=typeof Image){e.next=9;break}return e.next=4,fetch(t,n);case 4:return i=e.sent,e.next=7,i.arrayBuffer();case 7:return a=e.sent,e.abrupt("return",m(a,n));case 9:return e.next=11,x(t,n);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _(e,t){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var n=new Blob([new Uint8Array(e)]);return createImageBitmap(n,{imageOrientation:t.imageOrientation||"none",premultiplyAlpha:t.premultiplyAlpha||"default"})}function x(e,t){return w.apply(this,arguments)}function w(){return(w=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(24),r=n(119),a="void main() {gl_FragColor = vec4(0);}",o="#version 300 es\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}";function s(e,t){t=Array.isArray(t)?t:[t];var n=e.replace(/^\s+/,"").split(/\s+/),r=Object(i.a)(n,3),a=r[0],o=r[1],s=r[2];return t.includes(a)&&o&&s?{qualifier:a,type:o,name:s.split(";")[0]}:null}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var i=n(19),r="";function a(e){r=e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)("string"==typeof e),e=r+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function s(e,t){return Object(i.a)("string"==typeof e),e=r+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i,r=n(110).a&&"undefined"!=typeof document,a=r&&"complete"===document.readyState;function o(){return i||(i=r?new Promise(function(e,t){if(r&&"complete"===document.readyState)return a=!0,void e(document);window.onload=function(){a=!0,e(document)}}):Promise.resolve({})),i}function s(e){var t,n=e.canvas,i=e.width,r=e.height,o=e.onError,s=void 0===o?function(){}:o;return"string"==typeof n?(a||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:s}),t}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(56),l=n(30),f=n(124),h=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.b)(e),(s instanceof Promise||"string"==typeof s)&&(s={data:s}),"string"==typeof s.data&&(s=Object.assign({},s,{data:Object(f.b)(s.data)})),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},s,{target:3553})))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e,t){return c.a.isSupported(e,t)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return u});var i=n(104),r=n(30),a=n(19);function o(e,t){return s(e,t)}function s(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return c(e,t)})}function u(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=Object(r.d)(e),i.b)e.luma.caps[t]=c(e,t);return e.luma.caps}function c(e,t){var n=i.b[t];Object(a.a)(n,t);var o,s=Object(r.d)(e)&&n[1]||n[0];if("function"==typeof s)o=s(e);else if(Array.isArray(s)){o=!0;var u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;o=o&&Boolean(e.getExtension(d))}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}else"string"==typeof s?o=Boolean(e.getExtension(s)):"boolean"==typeof s?o=s:Object(a.a)(!1);return o}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(4),r=function e(){Object(i.a)(this,e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return O});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(184),v=n(22),g=n(83),p=n(137),m=n(81),y=n(82),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,O=void 0===w?b.minZoom:w,P=e.maxZoom,S=void 0===P?b.maxZoom:P,j=e.startPanPosition,k=e.startTarget,C=e.startRotationX,E=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:O,maxZoom:S})))._interactiveState={startPanPosition:j,startTarget:k,startRotationX:C,startRotationOrbit:E,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c=Object.keys(t),l=0;l=0&&n.modules.splice(i,1)}return"inject"in t&&(n.inject=Object.assign({},e.inject,t.inject)),n}var T=n(151),M=n(99),L=n(72),I={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return N(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return R(e,t)}},accessor:{validate:function(e,t){var n=z(e);return"function"===n||n===z(t.value)},equal:function(e,t,n){return"function"==typeof t||R(e,t)}},array:{validate:function(e,t){return t.optional&&!e||N(e)},equal:function(e,t,n){return n.compare?R(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function R(e,t){if(e===t)return!0;if(!N(e)||!N(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=Q,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):Object(L.b)(t)?this._resolveAsyncIterable(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){t=n._postProcessValue(e,t),n._setAsyncPropValue(e,t,r);var i=n.layer.props.onDataLoad;"data"===e&&i&&i(t,{propName:e,layer:n.layer})}).catch(function(e){return C.a.error(e)()})}},{key:"_resolveAsyncIterable",value:function(){var e=Z()(X.a.mark(function e(t,n){var i,r,a,o,s,u,c,l,f,h,d,v;return X.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"data"!==t&&this._setPropValue(t,n),(i=this.asyncProps[t]).pendingLoadCount++,r=i.pendingLoadCount,a=[],o=0,s=!0,u=!1,e.prev=8,l=K()(n);case 10:return e.next=12,l.next();case 12:return f=e.sent,s=f.done,e.next=16,f.value;case 16:if(h=e.sent,s){e.next=26;break}d=h,a=this._postProcessValue(t,d,a),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:o,endRow:a.length}]}),o=a.length,this._setAsyncPropValue(t,a,r);case 23:s=!0,e.next=10;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(8),u=!0,c=e.t0;case 32:if(e.prev=32,e.prev=33,s||null==l.return){e.next=37;break}return e.next=37,l.return();case 37:if(e.prev=37,!u){e.next=40;break}throw c;case 40:return e.finish(37);case 41:return e.finish(32);case 42:(v=this.layer.props.onDataLoad)&&v(a,{propName:t,layer:this.layer});case 44:case"end":return e.stop()}},e,this,[[8,28,32,42],[33,,37,41]])}));return function(t,n){return e.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(e,t,n){var i=(this.component?this.component.props:{}).dataTransform;return"data"!==e?t:i?i(t,n):n?n.concat(t):t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),$=0,ee=function(){function e(){o()(this,e),this.props=function(){for(var e=U(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i2&&void 0!==arguments[2]?arguments[2]:{}).url,i=null;return i=(i=i||function(e,t){var n=t.match(Pe),i=n&&n[0];return i&&function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object(xe.b)(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(e,i)}(t,void 0===n?"":n))||function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if("string"==typeof t){if(je(t,s))return s}else if(t instanceof ArrayBuffer&&ke(t,s))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(t,e)}function je(e,t){return t.testText&&t.testText(e)}function ke(e,t){switch(Array.isArray(t.test)?"array":Object(se.a)(t.test)){case"function":return t.test(e,t);case"string":case"array":return(Array.isArray(t.test)?t.test:[t.test]).some(function(t){return t===function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;if(e.byteLength<=t+n)return"";for(var i=new DataView(e),r="",a=0;a0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{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:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(T.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(ne.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(T.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){C.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){C.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitPositions",value:function(){return this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return C.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.props.extensions[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=A(e,o.getShaders.call(this,o))}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return e}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();if(t.dataChanged&&n){var i=t.dataChanged;if(Array.isArray(i)){var r=!0,a=!1,o=void 0;try{for(var s,u=i[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;n.invalidateAll(c)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}else n.invalidateAll()}}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(C.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(C.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;this._setModelAttributes(o,e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"_updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}}},{key:"updateTransition",value:function(){var e=this.getAttributeManager();e&&e.updateTransition(this.context.time)}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.numInstances,i=e.value,r=e.size;if(1!==i[0]){var a=qe.length/r;if(a2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=Object(O.c)(v),o[2*l+1]=Object(O.c)(g)),s[l]=1,l++}if(h)for(var m=0;m2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(147);n.d(t,"c",function(){return k}),n.d(t,"b",function(){return C}),n.d(t,"a",function(){return E});var w="\n\n".concat(x.a,"\n\n"),O=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),S={},j="precision highp float;\n\n";function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function C(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);S[e]=S[e]||{},S[e][o]=S[e][o]||{},Object(s.a)(!S[e][o][n],"Module injection already created"),S[e][o][n]={injection:i,order:a}}function E(e,t){var n=t.vs,i=t.fs,r=Object(o.d)(t.modules||[]);return{gl:e,vs:A(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:A(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:T(r),modules:M(r)}}function A(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=t.defines,c=void 0===u?{}:u,l=t.inject,f=void 0===l?{}:l,h=t.prologue,v=void 0===h||h,p=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var b=r===a.b,_=i.split("\n"),k=100,C="",E=i;0===_[0].indexOf("#version ")&&(k=300,C=_[0],E=_.slice(1).join("\n"));var A={};o.forEach(function(e){Object.assign(A,e.getDefines())}),Object.assign(A,c);var T=v?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(O[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(O[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(A),"\n").concat(b?"":j,"\n"):"".concat(C,"\n"),M=!1,L={},I={};for(var R in f){var F="string"==typeof f[R]?{injection:f[R],order:0}:f[R];R.match(/^(v|f)s:/)?"#"===R[3]?I[R]=[F]:L[R]=[F]:I[R]=[F]}var D=!0,N=!1,z=void 0;try{for(var B,U=o[Symbol.iterator]();!(D=(B=U.next()).done);D=!0){var V=B.value;switch(V.name){case"inject":M=!0;break;default:if(p&&V.checkDeprecations(E,p),T+=V.getModuleSource(r,k),S[V.name]){var G=S[V.name][r];for(var W in G)W.match(/^(v|f)s:#/)?(I[W]=I[W]||[],I[W].push(G[W])):(L[W]=L[W]||[],L[W].push(G[W]))}}}}catch(e){N=!0,z=e}finally{try{D||null==U.return||U.return()}finally{if(N)throw z}}return T+=w,T+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,L),T+=E,T=Object(x.c)(T,r,I,M)}function T(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function M(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.b)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(134),c=n(22),l=function(e,t){if(!e)throw new Error(t)},f=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t=0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(29),u=n(201),c=n(18),l={position:[0,0,0],lookAt:[0,0,0],up:[0,0,1],rotationX:0,rotationY:0,fov:50,near:1,far:100},f=function(){function e(t){r()(this,e);var n=t.width,i=t.height,a=t.position,o=void 0===a?l.position:a;Object(c.a)(Number.isFinite(n),"`width` must be supplied"),Object(c.a)(Number.isFinite(i),"`height` must be supplied"),this._viewportProps=this._applyConstraints(Object.assign({},t,{position:new s.a(o)}))}return o()(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getDirection",value:function(){return new u.a({bearing:this._viewportProps.bearing,pitch:this._viewportProps.pitch}).toVector3().normalize()}},{key:"getDirectionFromBearing",value:function(e){return new u.a({bearing:e,pitch:90}).toVector3().normalize()}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}()},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function i(e){for(var t=e.data,n=e.getIndex,i=e.dataRange,r=e.replace,a=i.startRow,o=void 0===a?0:a,s=i.endRow,u=void 0===s?1/0:s,c=t.length,l=c,f=c,h=0;hh&&d>=o&&(l=h),d>=u){f=h;break}}for(var v=l,g=f-l!==r.length,p=g&&t.slice(f),m=0;m=t.min)}},array:{validate:function(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function c(e){var t=l(e);return"object"===t?e?"type"in e?Object.assign({},e,u[e.type]):"value"in e?(t=l(e.value),Object.assign({type:t},e,u[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},u[t])}function l(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":Object(s.a)(e)}n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var f=function(){function e(t){var n=t.name,r=t.vs,a=t.fs,s=t.dependencies,u=void 0===s?[]:s,l=t.uniforms,f=t.getUniforms,h=t.deprecations,d=void 0===h?[]:h,v=t.defines,g=void 0===v?{}:v,p=t.vertexShader,m=t.fragmentShader;Object(i.a)(this,e),Object(o.a)("string"==typeof n),this.name=n,this.vs=r||p,this.fs=a||m,this.getModuleUniforms=f,this.dependencies=u,this.deprecations=this._parseDeprecationDefinitions(d),this.defines=g,l&&(this.uniforms=function(e){var t={};for(var n in e){var i=c(e[n]);t[n]=i}return t}(l))}return Object(r.a)(e,[{key:"getModuleSource",value:function(e,t){var n;switch(e){case"vs":n=a(this.vs||"",t,!0);break;case"fs":n=a(this.fs||"",t,!1);break;default:Object(o.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase(),"\n").concat(n,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,t){this.deprecations.forEach(function(n){n.regex.test(e)&&(n.deprecated?t.deprecated(n.old,n.new)():t.removed(n.old,n.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=this.uniforms;for(var i in n){var r=n[i];i in e&&!r.private?(r.validate&&Object(o.a)(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function h(e){if(!e.normalized&&(e.normalized=!0,e.uniforms&&!e.getUniforms)){var t=new f(e);e.getUniforms=t.getUniforms.bind(t)}return e}},function(e,t,n){"use strict";n.d(t,"b",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"a",function(){return g});var i=n(230),r=n.n(i);function a(e){if(e=e&&e.positions||e,!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new Error("invalid polygon")}function o(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(97),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return p}),n.d(t,"c",function(){return m});var i=n(5),r=n(10),a=n(9),o=n(11),s=n(4),u=n(29),c=n(67),l=[255,255,255],f=[0,0,1],h=[0,0,-1],d=[0,0,1],v=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e),this.id=t.id||Object(c.c)("light");var n=t.color,i=void 0===n?l:n;this.color=i;var r=t.intensity,a=void 0===r?1:r;this.intensity=a},g=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="ambient",e}return Object(o.a)(t,e),t}(v),p=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="directional";var i=n.direction,o=void 0===i?h:i;return e.direction=new u.a(o).normalize().toArray(),e}return Object(o.a)(t,e),t}(v),m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="point";var i=n.position,o=void 0===i?d:i;return e.position=o,e.attenuation=e._getAttenuation(n),e}return Object(o.a)(t,e),Object(i.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:f}}]),t}(v)},function(e,t,n){"use strict";var i,r=n(0),a=n(71),o=n(119);n.d(t,"a",function(){return u}),n.d(t,"c",function(){return h}),n.d(t,"b",function(){return d});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u="__LUMA_INJECT_DECLARATIONS__",c=/void main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,f=[];function h(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),f.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(65),r=n(24),a=n(25);function o(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var s={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(a.a)(t))},blendEquation:function(e,t){t=o(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(a.a)(t))},blendFunc:function(e,t){t=o(t)&&2===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,e.blendFuncSeparate.apply(e,Object(a.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(a.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(a.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(a.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(a.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(a.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(a.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=o(t)?t:[t,t],i=Object(r.a)(n,2),a=i[0],s=i[1];e.stencilMaskSeparate(1028,a),e.stencilMaskSeparate(1029,s)},stencilFunc:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilFuncSeparate(1028,s,u,c),e.stencilFuncSeparate(1029,l,f,h)},stencilOp:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilOpSeparate(1028,s,u,c),e.stencilOpSeparate(1029,l,f,h)},viewport:function(e,t){return e.viewport.apply(e,Object(a.a)(t))}};function u(e,t){for(var n in Object(i.f)(e,t),t){var r=s[n];r&&r(e,t[n],n)}}n.d(t,"a",function(){return u})},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(126),v=n(109),g=n(146),p=n(113),m=n(103),y=n(64),b=n(29),_=n(8),x=n.n(_),w=n(13),O=n.n(w),P=n(102),S=n(95),j=n(60),k=n(70),C=function(e){function t(e,n){var i,a,o;return r()(this,t),(o=u()(this,l()(t).call(this,e,n))).shadowMap=new d.a(e,{width:1,height:1,parameters:(i={},x()(i,10241,9729),x()(i,10240,9729),x()(i,10242,33071),x()(i,10243,33071),i)}),o.depthBuffer=new S.a(e,{format:33189,width:1,height:1}),o.fbo=new j.a(e,{id:"shadowmap",width:1,height:1,attachments:(a={},x()(a,36064,o.shadowMap),x()(a,36096,o.depthBuffer),a)}),o}return h()(t,e),o()(t,[{key:"render",value:function(e){var n=this,i=this.fbo;Object(k.a)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var r=e.viewports[0],a=r.width*n.props.pixelRatio,o=r.height*n.props.pixelRatio;a===i.width&&o===i.height||i.resize({width:a,height:o}),O()(l()(t.prototype),"render",n).call(n,Object.assign(e,{outputBuffer:i}))})}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,drawToShadowMap:!0,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{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)}}]),t}(P.a),E=n(163);n.d(t,"a",function(){return L});var A={color:[255,255,255],intensity:1},T=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],M=[0,0,0,200/255],L=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],n.shadowColor=M,n.shadowPasses=[],n.dummyShadowMaps=[],n.shadow=!1,e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n._applyDefaultLights(),n.directionalLights.some(function(e){return e.shadow})&&(n.shadow=!0,n._addShadowModule()),n}return h()(t,e),o()(t,[{key:"prepare",value:function(e,t){var n=t.layers,i=t.viewports,r=t.onViewportActive,a=t.views,o=t.pixelRatio;if(!this.shadow)return{};var s=this._createLightMatrix();0===this.shadowPasses.length&&this._createShadowPasses(e,o),0===this.dummyShadowMaps.length&&this._createDummyShadowMaps(e);for(var u=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.a)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new g.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(p.a)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(178).a),y=n(140);n.d(t,"a",function(){return b});var b=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(y.b)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=w(t),a=new m(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=w(t,r),s="".concat(n,"-").concat(a);return new m(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return _(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return x(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(16),r=n.n(i),a=n(31),o=n(136),s=n(37),u=n(40),c=n(27);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.n([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.m(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.overAlloc,i=void 0===n?2:n,a=t.poolSize,o=void 0===a?100:a;r()(this,e),this.overAlloc=i,this.poolSize=o,this._pool=[]}return o()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=void 0===i?1:i,a=n.type,o=n.padding,s=void 0===o?0:o,u=n.copy,c=void 0!==u&&u,l=a||e&&e.constructor||Float32Array,f=t*r+s;if(ArrayBuffer.isView(e)){if(f<=e.length)return e;if(f*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new l(e.buffer,0,f)}var h=this._allocate(l,f);return e&&c?h.set(e):h.fill(0,0,4),this._release(e),h}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,t){t=Math.max(Math.ceil(t*this.overAlloc),1);var n=this._pool,i=e.BYTES_PER_ELEMENT*t,r=n.findIndex(function(e){return e.byteLength>=i});return r>=0?new e(n.splice(r,1)[0],0,t):new e(t)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.poolSize&&t.shift()}}}]),e}();t.a=new s},function(e,t){function n(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise(function(r,a){var o=e.apply(t,i);function s(e){n(o,r,a,s,u,"next",e)}function u(e){n(o,r,a,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(32),c=n(24),l=n(55),f=n(27),h=n(20),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(200),p=n(47);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,O=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(f.l)(g);x=Math.max(.75,x);var S=Object(f.g)([d,l],P);S[2]=0;var j=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:O||1.01}),k=Object(f.f)({height:s,center:S,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:k,projectionMatrix:j}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=P,e.center=S,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,,function(e,t,n){"use strict";(function(e){var t=n(97),i=n(143);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return u({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},Object(a.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=s(t),r=o(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}}))},function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return l});var i=n(0),r=n(126),a=n(160),o=n(161),s=n(60),u=n(19);function c(e,t){Object(u.a)(e instanceof r.a||e instanceof a.a||e instanceof o.a);var n=e.constructor,i=e.gl,s=e.width,c=e.height,l=e.format,f=e.type,h=e.dataFormat,d=e.border,v=e.mipmaps;return new n(i,Object.assign({width:s,height:c,format:l,type:f,dataFormat:h,border:d,mipmaps:v},t))}function l(e,t){var n=e.gl,r=e.width,a=e.height,o=e.id;return new s.a(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(i.a)({},36064,e)}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(50),r=n.n(i),a=n(116),o=n(4),s=n(5),u=n(10),c=n(9),l=n(32),f=n(11),h=n(56),d=n(30),v=n(26),g=[34069,34070,34071,34072,34073,34074],p=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,t),Object(d.b)(e),(n=Object(u.a)(this,Object(c.a)(t).call(this,e,Object.assign({},i,{target:34067})))).initialize(i),Object.seal(Object(l.a)(n)),n}return Object(f.a)(t,e),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(a.a)(r.a.mark(function e(t){var n,i,a,o,s,u,c,l,f,h,d,p,m,y=this;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,a=t.pixels,o=t.data,s=t.border,u=void 0===s?0:s,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,p=a||o,e.next=5,Promise.all(g.map(function(e){var t=p[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:m=e.sent,this.bind(),g.forEach(function(e,t){m[t].length>1&&!1!==y.opts.mipmaps&&v.a.warn("".concat(y.id," has mipmap and multiple LODs."))(),m[t].forEach(function(t,r){n&&i?d.texImage2D(e,r,l,n,i,u,l,h,t):d.texImage2D(e,r,l,l,h,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(h.a);p.FACES=g},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(70),l=n(30),f=n(56),h=n(98),d=n(43),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.a)(e),s=Object.assign({depth:1},s,{target:32879,unpackFlipY:!1}),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(s.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,l=void 0===u?1:u,f=e.border,v=void 0===f?0:f,g=e.format,p=e.type,m=void 0===p?5121:p,y=e.offset,b=void 0===y?0:y,_=e.data,x=e.parameters,w=void 0===x?{}:x;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(c.a)(this.gl,w,function(){ArrayBuffer.isView(_)&&t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,_),_ instanceof d.a&&(t.gl.bindBuffer(35052,_.handle),t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,b))}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var O=h.a[this.dataFormat]||4,P=h.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*O*P,"Texture")}return this.loaded=!0,this}}]),t}(f.a)},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(77),r=n.n(i),a=n(16),o=n.n(a),s=n(132),u=n(42),c=n(64),l=n(29),f=n(94),h=n(27),d=Object(f.a)(function(e){var t=e.viewport,n=e.center;return new c.a(t.viewProjectionMatrix).invert().transformVector4(n)}),v=Object(f.a)(function(e){var t=e.viewport,n=e.shadowMatrices,i=[],a=t.pixelUnprojectionMatrix,s=[[0,0],[t.width,0],[0,t.height],[t.width,t.height],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(function(e){return function(e,t){var n=o()(e,3),i=n[0],r=n[1],a=n[2],s=Object(h.h)([i,r,a],t);if(Number.isFinite(a))return s;return[s[0],s[1],0]}(e,a)}),u=!0,f=!1,d=void 0;try{for(var v,g=function(){var e=v.value,n=e.clone().translate(new l.a(t.center).negate()),a=s.map(function(e){return n.transformVector3(e)}),o=(new c.a).ortho({left:Math.min.apply(Math,r()(a.map(function(e){return e[0]}))),right:Math.max.apply(Math,r()(a.map(function(e){return e[0]}))),bottom:Math.min.apply(Math,r()(a.map(function(e){return e[1]}))),top:Math.max.apply(Math,r()(a.map(function(e){return e[1]}))),near:Math.min.apply(Math,r()(a.map(function(e){return-e[2]}))),far:Math.max.apply(Math,r()(a.map(function(e){return-e[2]})))});i.push(o.multiplyRight(e))},p=n[Symbol.iterator]();!(u=(v=p.next()).done);u=!0)g()}catch(e){f=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(f)throw d}}return i});Object(s.b)("shadow",{hook:"vs:DECKGL_FILTER_GL_POSITION",injection:"\nposition = shadow_setVertexPosition(geometry.position);\n "}),Object(s.b)("shadow",{hook:"fs:DECKGL_FILTER_COLOR",injection:"\ncolor = shadow_filterShadowColor(color);\n "});var g=[0,0,0,1],p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];t.a={name:"shadow",dependencies:["project"],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap[max_lights];\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[i], shadow_uShadowMap[i]) * shadow_uColor.a / shadow_uLightCount;\n }\n }\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){var n={},i=e.shadowEnabled;return(void 0===i||i)&&e.shadowMatrices&&e.shadowMatrices.length>0?Object.assign(n,function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||g,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=d({viewport:e.viewport,center:t.project_uCenter}),r=[],a=v({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice(),o=0;o0?n["shadow_uShadowMap[".concat(f,"]")]=e.shadowMaps[f]:n["shadow_uShadowMap[".concat(f,"]")]=e.dummyShadowMaps[0];return n}(e,t)):Object.assign(n,{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}),n}return{}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(165),g=n(172),p=function(e){function t(e){return r()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:v.a})))}return h()(t,e),o()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.a})}}]),t}(d.a);p.displayName="MapView"},function(e,t,n){"use strict";n.d(t,"a",function(){return O});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(87),p=n.n(g),m=n(45),y=n(27),b=n(200),_=n(47),x=n(18),w="Illegal argument to WebMercatorViewport",O=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,O=void 0!==w&&w,P=n.width,S=n.height,j=n.altitude,k=void 0===j?1.5:j;P=P||1,S=S||1,k=Math.max(.75,k);var C=Object(y.e)({width:P,height:S,pitch:d,altitude:k,nearZMultiplier:b,farZMultiplier:x}),E=C.fov,A=C.aspect,T=C.focalDistance,M=C.near,L=C.far,I=Object(y.f)({height:S,pitch:d,bearing:g,altitude:k}),R=Object.assign({},n,{width:P,height:S,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:O,fovyRadians:E,aspect:A,orthographicFocalDistance:T,near:M,far:L});return(e=l()(this,h()(t).call(this,R))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=k,e.orthographic=O,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);O.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(77),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(18),l=n(190),f=n(41),h=n.n(f),d=n(130),v=n(99),g=n(15),p=n(75),m=n(267),y=n(45),b=n(69),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,mousePosition:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l.a({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(83),p=n(137),m=n(22),y=n(29);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(83),v=n(129),g=n(81),p=n(82),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(16),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(13),v=n.n(d),g=n(7),p=n.n(g),m=n(43),y=n(18),b=n(72),_=n(75),x=[],w=[[0,1/0]];var O=n(15),P=n(127),S=n(104),j=n(59),k=n(67),C=n(26),E=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(k.c)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(P.b)(t,S.a.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a),this._setAccessor(e);for(var o=this.elementOffset,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({offset:n.offset,stride:n.stride,normalized:n.normalized},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,T,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"delete",value:function(){v()(h()(t.prototype),"delete",this).call(this),A.a.release(this.userData.allocatedValue)}},{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;if(t.update){Object(y.a)(Number.isFinite(e));var n=Math.max(e,1),i=L(this.type||5126),r=t.allocatedValue,a=t.updateRanges!==w;return this.constant=!1,this.value=A.a.allocate(r,n,{size:this.size,type:i,padding:this.elementOffset,copy:a}),this.buffer&&this.buffer.byteLength=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return n+e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(E);function L(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}var I=n(224);function R(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.a){var l=new Float32Array(r),f=t.getData({}),h=n.size,d=n.constant,v=d?n.getValue():n.getBuffer().getData({}),g=d?function(e,t){return c(v,t)}:function(e,t){return c(v.subarray(e,e+h),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.offset,a=void 0===r?0:r,o=e.getData,s=e.sourceLayout,u=e.targetLayout;if(!Array.isArray(u))return R({source:t,target:n,getData:o}),n;for(var c=a,l=a,f=o&&function(e,t){return o(e+l,t)},h=Math.min(s.length,u.length),d=0;d0),this.needsRedraw=!0;var n=Object.assign({},U,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return H});function G(){}var W={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;O.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;W.savedMessages=[],W.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;W.savedMessages&&W.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-W.timeStart),a="".concat(r,"ms");O.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=W.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;O.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}O.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),W.savedMessages=null}},H=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new V(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(W.onLog=t||G),void 0!==n&&(W.onUpdateStart=n||G),void 0!==i&&(W.onUpdate=i||G),void 0!==r&&(W.onUpdateEnd=r||G)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in W.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h]||t.attributes&&t.attributes[h])||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&W.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&O.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new M(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),O.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&W.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);W.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(192),b=n(93),_=n(229),x=n.n(_),w=n(15),O=n(67),P=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(O.c)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;w.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:j},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:j},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=r.extensionsChanged;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new P({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);w.layerName="ScatterplotLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(22),p=n(83),m=n(137),y=n(154),b=n(55),_=85.05113,x=-85.05113;var w=n(18),O=n(81),P=n(82);n.d(t,"a",function(){return A});var S={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new O.a,transitionInterruption:P.a.BREAK},j={transitionDuration:0},k={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},C={pitch:0,bearing:0,altitude:1.5},E=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?C.bearing:c,d=n.pitch,v=void 0===d?C.pitch:d,g=n.altitude,p=void 0===g?C.altitude:g,m=n.maxZoom,y=void 0===m?k.maxZoom:m,b=n.minZoom,_=void 0===b?k.minZoom:b,x=n.maxPitch,O=void 0===x?k.maxPitch:x,P=n.minPitch,S=void 0===P?k.minPitch:P,j=n.startPanLngLat,E=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,M=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:O,minPitch:S})))._interactiveState={startPanLngLat:j,startZoomLngLat:E,startBearing:A,startPitch:T,startZoom:M},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,E,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return S}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,j,{isDragging:!0,isRotating:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(15),u=n(6),c=n.n(u),l=n(3),f=n.n(l),h=n(13),d=n.n(h),v=n(7),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(102).a),m=n(182),y=n(183),b=n(150),_=n(60);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h,pixelRatio:this.pixelRatio}),m=this.lastPostProcessEffect?this.screenBuffer:_.a.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.a(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.a(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.a.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(34),r=n(175);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(89))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(34);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(89))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(127),f=n(104),h=n(30),d=n(19),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(h.d)(e),i=Object(l.c)(e,f.a.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Object(d.a)(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(s.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(22),u=n(18),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(35),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(102),p=n(70),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.a)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";function i(e){return e&&"undefined"!=typeof window?window.devicePixelRatio:1}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(47),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,r=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,r=void 0===n?16:n,a=t.size,o=void 0===a?1:a,s="[",u=0;u0&&(s+=",".concat(u%o==0?" ":"")),s+=i(e[u],t);var c=e.length>r?"...":"]";return"".concat(s).concat(c)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return r?"0":"0.";if(r)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var a=e.toPrecision(2);return a.indexOf(".0")===a.length-2?a.slice(0,-1):a}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var i=n(115),r="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var a={name:"gouraud-lighting",dependencies:[i.a],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:u},o={name:"phong-lighting",dependencies:[i.a],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:u},s={};function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor.map(function(e){return e/255}),t}(t):{lighting_uEnabled:!1}}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(4),r=n(5),a=n(61),o=n(197),s=n(19),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Object(s.a)(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new a.c(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new a.a(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Object(s.a)(this._compareContexts(e,this.gl)),Object(s.a)("string"==typeof t.vs),Object(s.a)("string"==typeof t.fs),Object(s.a)("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new o.a(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(36),r=n(4),a=n(10),o=n(9),s=n(11),u=n(58),c=n(67),l=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]),f=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]),h=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]),d=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]),v={POSITION:{size:3,value:new Float32Array(f)},NORMAL:{size:3,value:new Float32Array(h)},TEXCOORD_0:{size:2,value:new Float32Array(d)}},g=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.id,s=void 0===n?Object(c.c)("cube-geometry"):n;return Object(a.a)(this,Object(o.a)(t).call(this,Object(i.a)({},e,{id:s,indices:{size:1,value:new Uint16Array(l)},attributes:Object(i.a)({},v,e.attributes)})))}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(11),u=n(128),c={ambient:.35,diffuse:.6,shininess:32,specularColor:[30,30,30]},l=function(e){function t(e){var n;return Object(i.a)(this,t),n=Object(r.a)(this,Object(a.a)(t).call(this,e)),e=Object.assign({},c,e),Object.assign(Object(o.a)(n),e),n}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(130),p=n(15),m=n(75),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){h()(l()(t.prototype),"setState",this).call(this,e),this.setLayerNeedsUpdate()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?Object.assign(t,{object:n.__source.object,index:n.__source.index}):t}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerRow",value:function(e,t,n){return e.__source={parent:this,object:t,index:n},e}},{key:"getSubLayerAccessor",value:function(e){if("function"==typeof e){var t={data:this.props.data,target:[]};return function(n,i){return n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,i)}}return e}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,f=t.coordinateOrigin,h=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,g=t.extensions,p=t._subLayerProps,m={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:v,extensions:g};if(e){var y=p&&p[e.id],b=y&&y.updateTriggers;Object.assign(m,e,y,{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers,b)})}var _=!0,x=!1,w=void 0;try{for(var O,P=g[Symbol.iterator]();!(_=(O=P.next()).done);_=!0){var S=O.value,j=S.getSubLayerProps.call(this,S);Object.assign(m,j,{updateTriggers:Object.assign(m.updateTriggers,j.updateTriggers)})}}catch(e){x=!0,w=e}finally{try{_||null==P.return||P.return()}finally{if(x)throw w}}return m}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?p.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,p.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(g.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(166),l=n(18),f=n(105),h=n(53),d=n(45),v=n(15),g=n(75),p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return u()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i={x:e[0],y:e[1]},r=n.length-1;r>=0;--r){var a=n[r];if(a.containsPixel(i)){var o=e.slice();return o[0]-=a.x,o[1]-=a.y,a.unproject(o,t)}}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(l.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(g.b)(e,{filter:Boolean}).map(function(e){return e instanceof d.a?new h.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(f.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):v.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),m=n(164),y=n(149),b=new y.a,_=function(){function e(){o()(this,e),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return u()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(f.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e,this._createInternalEffects()}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=!0,o=!1,s=void 0;try{for(var u,c=this._internalEffects[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){u.value.cleanup()}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some(function(e){return e instanceof y.a})||this._internalEffects.push(b)}}]),e}(),x=n(103),w=n(173),O=n(60),P=n(80),S=n(183),j=n(182),k={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function C(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,h=-1,d=0,g=0;gf)d+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,h=d)}d+=4}}if(h>=0){var x=t[h+3]-1,w=t.slice(h,h+4),O=n[x];if(O){var P=O.decodePickingColor(w);return{pickedColor:w,pickedLayer:O,pickedObjectIndex:P}}v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return k}function E(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=A({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function A(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var T=function(){function e(t){o()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new j.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return u()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(S.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new O.a(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-(r+1)*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=A({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(l.a)(r),Object(l.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(l.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,u=r.y,c=r.width,f=r.height,h=new Uint8Array(c*f*4);return Object(P.e)(o,{sourceX:s,sourceY:u,sourceWidth:c,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight,o=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-o,c=Math.min(a,n+i+1)-s;return u<=0||c<=0?null:{x:o,y:s,width:u,height:c}}},{key:"callLayerPickingCallbacks",value:function(e,t){var n=[],i=this.pickingEvent;return e.forEach(function(e){if(e.layer){var r=!1;switch(t){case"hover":r=e.layer.onHover(e,i);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}}),n}}]),e}(),M=n(196),L=n(204),I=n(91),R=n(90),F=n(148),D=n(107),N=n(267),z=n(24),B=n(4),U=n(5),V=1,G=2,W=4,H={mousedown:V,mousemove:G,mouseup:W};var X,q,Z=null;"undefined"!=typeof document&&(Z=n(256),X=Z.PointerEventInput,q=X.prototype.handler,X.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&G&&0===e.which&&(t=W),this.pressed&&(t&W&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var Y=Z;var K=Y?[[Y.Rotate,{enable:!1}],[Y.Pinch,{enable:!1}],[Y.Swipe,{enable:!1}],[Y.Pan,{threshold:0,enable:!1}],[Y.Press,{enable:!1}],[Y.Tap,{event:"doubletap",taps:2,enable:!1}],[Y.Tap,{event:"anytap",enable:!1}],[Y.Tap,{enable:!1}]]:null,Q={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},J={doubletap:["tap"]},$={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ee=["keydown","keyup"],te=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],ne=["wheel","mousewheel","DOMMouseScroll"],ie={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",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"},re={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ae=n(120),oe=-1!==ae.b.indexOf("firefox"),se=ne,ue=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=se.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!ae.a&&{passive:!1})})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;ae.c.WheelEvent&&(oe&&e.deltaMode===ae.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=ae.c.devicePixelRatio),e.deltaMode===ae.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ce=te,le=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=ce.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),fe=ee,he=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=fe.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),de=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(U.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ve=1,ge=2,pe=4,me={pointerdown:ve,pointermove:ge,pointerup:pe,mousedown:ve,mousemove:ge,mouseup:pe},ye=1,be=2,_e=3,xe=0,we=1,Oe=2,Pe=1,Se=2,je=4;var ke=function(){function e(t){Object(B.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(U.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(B.a)(this,e),this.options=Object.assign({},Ce,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(U.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||K}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(Q).forEach(function(e){var n=t.manager.get(e);n&&Q[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new ue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new le(e,this._onOtherEvent,{enable:!1}),this.keyInput=new he(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new de(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(z.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=J[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=re[e]||e,o=r.get(a);o||(o=new ke(this),r.set(a,o),o.recognizerName=ie[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=re[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=$[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),Ae=n(31);function Te(){}n.d(t,"a",function(){return Le});var Me={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:Te,onResize:Te,onViewStateChange:Te,onBeforeRender:Te,onAfterRender:Te,onLoad:Te,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Le=function(){function e(t){o()(this,e),t=Object.assign({},Me,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),function(){if(void 0===("undefined"==typeof window?"undefined":r()(window)))return!1;return-1!==((window.navigator||{}).userAgent||"").indexOf("Trident/")}()&&v.a.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new N.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return u()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&v.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&v.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(l.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new L.a({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(I.a)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new m.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.callback=this.props.onHover,t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(R.a)(e,{enable:!0,copyState:!0})),Object(F.a)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new Ee(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Ae.b)this.eventManager.on(t,this._onEvent);this.viewManager=new p({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(l.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new c.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new _,this.deckRenderer=new w.a(e),this.deckPicker=new T(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(F.a)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),v.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=Ae.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){var e=this.stats;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();var t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var e=this.metrics,t=this.stats;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();var n=D.a.get("Memory Usage");e.bufferMemory=n.get("Buffer Memory").count,e.textureMemory=n.get("Texture Memory").count,e.renderbufferMemory=n.get("Renderbuffer Memory").count,e.gpuMemory=n.get("GPU Memory").count}}]),e}();Le.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(x.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Le.defaultProps=Me,Le.VERSION=M.a.VERSION},function(e,t,n){"use strict";var i=n(109),r=n(132),a=n(205),o=n(189),s=n(206),u={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n} geometry;\n",fs:"\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n"},c=n(84),l={name:"project32",dependencies:[c.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"};function f(){Object(i.c)([a.a,c.a,l,o.a,o.b,s.a]),Object(i.e)([u,c.a]),Object(r.c)("vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)"),Object(r.c)("fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"),Object(r.b)("picking",{hook:"fs:DECKGL_FILTER_COLOR",order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n"})}n.d(t,"a",function(){return f})},function(e,t,n){"use strict";var i=n(117),r=n(122),a=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],o=(r.a&&r.d,!r.a&&r.b,r.e,{extensions:a,loadAndParse:r.c}),s=n(108),u=n(15);var c={name:"JSON",extensions:["json","geojson"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},l=n(195);if(s.a.deck&&"7.2.1"!==s.a.deck.VERSION)throw new Error("deck.gl - multiple versions detected: ".concat(s.a.deck.VERSION," vs ").concat("7.2.1"));s.a.deck||(u.a.log(0,"deck.gl ".concat("7.2.1"," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),s.a.deck=s.a.deck||{VERSION:"7.2.1",version:"7.2.1",log:u.a},Object(i.b)([c,o]),Object(l.a)());t.a=s.a.deck},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(32),s=n(9),u=n(66),c=n(11),l=n(52),f=n(56),h=n(60),d=n(74),v=n(61),g=n(59),p=n(30),m=n(73),y=function(){function e(t){Object(i.a)(this,e),this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}return Object(r.a)(e,[{key:"getAttributeInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var t=this.getAttributeInfo(e);return t?t.location:-1}},{key:"getAttributeAccessor",value:function(e){var t=this.getAttributeInfo(e);return t?t.accessor:null}},{key:"getVaryingInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var t=this.getVaryingInfo();return t?t.location:-1}},{key:"getVaryingAccessor",value:function(e){var t=this.getVaryingInfo();return t?t.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var t=e.gl,n=t.getProgramParameter(e.handle,35721),i=0;i=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(Object(p.d)(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(s.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",P),n._isCached=!1,n.initialize(r),Object.seal(Object(o.a)(n)),n._setId(r.id),n}return Object(c.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new v.c(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new v.a(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,Object(x.a)(this.vs instanceof v.c),Object(x.a)(this.fs instanceof v.a),this.uniforms={},i&&(Object(p.a)(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new y(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,f=void 0!==l&&l,h=e.indexType,d=void 0===h?5123:h,v=e.isInstanced,g=void 0!==v&&v,y=e.instanceCount,O=void 0===y?0:y,P=e.vertexArray,S=void 0===P?null:P,j=e.transformFeedback,k=e.framebuffer,C=e.parameters,E=void 0===C?{}:C,A=e.uniforms,T=e.samplers;if((A||T)&&(w.a.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(A||{})),void 0!==n){var M=k?k.id:"default",L="mode=".concat(Object(_.a)(this.gl,r)," verts=").concat(a," ")+"instances=".concat(O," indexType=").concat(Object(_.a)(this.gl,d)," ")+"isInstanced=".concat(g," isIndexed=").concat(f," ")+"Framebuffer=".concat(M);w.a.log(n,L)()}return Object(x.a)(S),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(S.bindForDraw(a,O,function(){if(void 0!==k&&(E=Object.assign({},E,{framebuffer:k})),j){var e=Object(m.c)(r);j.begin(e)}t._bindTextures(),Object(b.a)(t.gl,E,function(){f&&g?t.gl.drawElementsInstanced(r,a,d,s,O):f&&Object(p.d)(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):f?t.gl.drawElements(r,a,d,s):g?t.gl.drawArraysInstanced(r,s,a,O):t.gl.drawArrays(r,s,a)}),j&&j.end()}),!0)}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=!1,i={};for(var r in e)Object(d.a)(this.uniforms[r],e[r])||(n=!0,i[r]=e[r],this.uniforms[r]=Object(d.c)(e[r]));return n&&(t(),Object(d.b)(i,this.id,this._uniformSetters),this._setUniforms(i)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof h.a)i=i.texture;if(i instanceof f.a)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof h.a&&(n=n.texture),n instanceof f.a)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof h.a&&(n=n.texture),n instanceof f.a){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new v.c({handle:u});break;case 35632:n.fs=new v.a({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Object(O.c)(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),w.a.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),w.a.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||w.a.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1)for(var s=0;s0&&w[1]>0);var O=w[0]/x[0],P=w[1]/x[1],S=(u.right-u.left)/2/O,j=(u.bottom-u.top)/2/P,k=[(_[0]+b[0])/2+S,(_[1]+b[1])/2+j],C=y.unproject(k),E=y.zoom+Math.log2(Math.abs(Math.min(O,P)));return{longitude:C[0],latitude:C[1],zoom:E}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(24),r=n(4),a=n(5),o=n(22),s=n(29),u=n(40),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.g(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(43),f=n(30),h=n(67),d=n(26),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(f.a)(e),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(f.d)(e)}}]),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(h.a)(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,d.a.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof l.a==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(4),r=n(5),a=n(59),o=n(43),s=n(106),u=n(235),c=n(26),l=n(19),f=/^(.+)__LOCATION_([0-9]+)$/,h=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=s.a.isSupported(t)?new s.a(t):s.a.getDefaultArray(t),Object(u.a)(this,"VertexArray","v6.0",h),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new o.a(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof o.a){var a=n;if(r){var s=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,s)}else{var u=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,u)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c.a.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(34),r=n(50),a=n.n(r),o=n(116),s=n(4),u=n(5),c=n(91),l=n(107),f=n(125),h=n(177),d=n(135),v=n(30),g=n(65),p=n(60),m=n(26),y=n(19),b=0,_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e);var n=t.onCreateContext,i=void 0===n?function(e){return Object(c.a)(e)}:n,r=t.onAddHTML,a=void 0===r?null:r,o=t.onInitialize,u=void 0===o?function(){}:o,f=t.onRender,h=void 0===f?function(){}:f,d=t.onFinalize,v=void 0===d?function(){}:d,g=t.gl,p=void 0===g?null:g,y=t.glOptions,_=void 0===y?{}:y,x=t.debug,w=void 0!==x&&x,O=t.createFramebuffer,P=void 0!==O&&O,S=t.autoResizeViewport,j=void 0===S||S,k=t.autoResizeDrawingBuffer,C=void 0===k||k,E=t.stats,A=void 0===E?l.a.get("animation-loop-".concat(b++)):E,T=t.useDevicePixels,M=void 0===T||T;"useDevicePixelRatio"in t&&(m.a.deprecated("useDevicePixelRatio","useDevicePixels")(),M=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:a,onInitialize:u,onRender:h,onFinalize:v,gl:p,glOptions:_,debug:w,createFramebuffer:P},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=A,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:j,autoResizeDrawingBuffer:C,useDevicePixels:M}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(u.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Object(y.a)("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,Object(f.b)().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=h.a.isSupported(e.gl,["timers"])?new h.a(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),Object(d.a)(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(o.a)(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return m.a.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;Object(d.a)(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||Object(d.b)(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(i.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Object(c.c)(this.props.gl,e):this.onCreateContext(e),!Object(v.c)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(g.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Object(c.d)(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new p.a(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()&&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}}]),e}()},function(e,t,n){"use strict";t.a={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}},function(e,t,n){"use strict";var i={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};t.a={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}}},function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(0),r=n(43),a=n(68),o=n(73),s=n(187);function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=c(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),f=t.accessors[s.location];f&&(u="".concat(o,": ").concat(l(s.name,f))),r[u]=c(t,a[o],f,i)}}return r}function c(e,t,n,o){var u,c,l,f,h=e.gl,d="NOT PROVIDED",v="N/A",g="N/A",p="N/A";if(n&&(d=n.type,v=n.size,c=-1!==(d=String(d).replace("Array","")).indexOf("nt")),t instanceof r.a){var m,y,b=t,_=b.getDebugData(),x=_.data;if(l=_.modified?"*":"",f=x,g=(p=b.byteLength)/x.BYTES_PER_ELEMENT/v,n){var w=n.divisor>0;y="".concat(w?"I ":"P "," ").concat(g," (x").concat(v,"=").concat(p," bytes ").concat(Object(a.a)(h,d),")")}else c=!0,y="".concat(p," bytes");return m={},Object(i.a)(m,o,"".concat(l).concat(Object(s.a)(f,{size:v,isInteger:c}))),Object(i.a)(m,"Format ",y),m}return f=t,v=t.length,c=-1!==(d=String(t.constructor.name).replace("Array","")).indexOf("nt"),u={},Object(i.a)(u,o,"".concat(Object(s.a)(f,{size:v,isInteger:c})," (constant)")),Object(i.a)(u,"Format ","".concat(v,"x").concat(d," (constant)")),u}function l(e,t){var n=t.type,i=t.size,r=Object(o.b)(n,i);return r?"".concat(e," (").concat(r.name,")"):e}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(0),r=n(19),a=n(187);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,o=e.program,u=e.uniforms,c=e.undefinedOnly,l=void 0!==c&&c;Object(r.a)(o);var f=o._uniformSetters,h={},d=Object.keys(f).sort(),v=0,g=!0,p=!1,m=void 0;try{for(var y,b=d[Symbol.iterator]();!(g=(y=b.next()).done);g=!0){var _=y.value;_.match(".*_.*")||_.match(".*Matrix")||s({table:h,header:n,uniforms:u,uniformName:_,undefinedOnly:l})&&v++}}catch(e){p=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(p)throw m}}var x=!0,w=!1,O=void 0;try{for(var P,S=d[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;j.match(".*Matrix")&&s({table:h,header:n,uniforms:u,uniformName:j,undefinedOnly:l})&&v++}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}var k=!0,C=!1,E=void 0;try{for(var A,T=d[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h[M]||s({table:h,header:n,uniforms:u,uniformName:M,undefinedOnly:l})&&v++}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}var L=0,I={};if(!l)for(var R in u){var F=u[R];h[R]||(L++,I[R]=Object(i.a)({Type:"NOT USED: ".concat(F)},n,Object(a.a)(F)))}return{table:h,count:v,unusedTable:I,unusedCount:L}}function s(e){var t,n=e.table,r=e.header,o=e.uniforms,s=e.uniformName,u=e.undefinedOnly,c=o[s],l=function(e){return null!=e}(c);return(!u||!l)&&(n[s]=(t={},Object(i.a)(t,r,l?Object(a.a)(c):"N/A"),Object(i.a)(t,"Uniform Type",l?c:"NOT PROVIDED"),t),!0)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(0),r=n(73);function a(e){var t={},n="Accessors for ".concat(e.id),r=!0,a=!1,s=void 0;try{for(var u,c=e.attributeInfos[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var l=u.value;if(l){var f=o(l);t["in ".concat(f)]=Object(i.a)({},n,JSON.stringify(l.accessor))}}}catch(e){a=!0,s=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw s}}var h=!0,d=!1,v=void 0;try{for(var g,p=e.varyingInfos[Symbol.iterator]();!(h=(g=p.next()).done);h=!0){var m=g.value;if(m){var y=o(m);t["out ".concat(y)]=Object(i.a)({},n,JSON.stringify(m.accessor))}}}catch(e){d=!0,v=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw v}}return t}function o(e){var t=e.accessor,n=t.type,i=t.size,a=Object(r.b)(n,i);return a?"".concat(a.name," ").concat(e.name):e.name}},function(e,t,n){"use strict";function i(e){var t=100,n=e.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(25),r=n(4),a=n(5),o=n(10),s=n(9),u=n(66),c=n(11),l=n(64),f=n(26),h=n(92),d=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var i=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===i?[]:i;return f.a.assert(a.every(function(e){return e instanceof h.a}),"every child must an instance of ScenegraphNode"),(e=Object(o.a)(this,Object(s.a)(t).call(this,n))).children=a,e}return Object(c.a)(t,e),Object(a.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new l.a:n,r=new l.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;f instanceof t?f.traverse(e,{worldMatrix:r}):e(f,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return f.a.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(h.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(66),u=n(11),c=n(93),l=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof c.a?(n.model=e,n._setModelNodeProps(r)):n.model=new c.a(e,r),n.managedResources=r.managedResources||[],n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return Object(s.a)(Object(o.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(n(92).a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(201),p=n(64),m=n(167);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(1),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(129),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,O=e.zoom,P=void 0===O?0:O;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:P}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(1),u=n.n(s),c=n(6),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(168),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(191),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.a}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(170).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(192),v=n(72),g=n(193),p=n(131),m=n(114),y=n(141),b=n(139),_=new d.a,x={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags),i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(i&&Array.isArray(n.dataChanged)){var r=this.state.paths.slice(),a=n.dataChanged.map(function(e){return Object(b.a)({data:r,getIndex:function(e){return e.__source.index},dataRange:e,replace:t._getPaths(e)})});this.setState({paths:r,pathsDiff:a})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.data,i=t.getPolygon,r=[],a="XY"===t.positionFormat?2:3,o=e.startRow,s=e.endRow,u=Object(v.a)(n,o,s),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var g,p=c[Symbol.iterator]();!(f=(g=p.next()).done);f=!0){var m=g.value;l.index++;var b=y.c(i(m,l),a),_=b.positions,x=b.holeIndices;if(x)for(var w=0;w<=x.length;w++){var O=_.subarray(x[w-1]||0,x[w]||_.length);r.push(this.getSubLayerRow({path:O},m,l.index))}else r.push(this.getSubLayerRow({path:_},m,l.index))}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}return r}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e._dataDiff,i=e.stroked,r=e.filled,a=e.extruded,o=e.wireframe,s=e.elevationScale,u=e.transitions,c=e.positionFormat,l=this.props,f=l.lineWidthUnits,h=l.lineWidthScale,d=l.lineWidthMinPixels,v=l.lineWidthMaxPixels,g=l.lineJointRounded,y=l.lineMiterLimit,b=l.lineDashJustified,_=this.props,x=_.getFillColor,w=_.getLineColor,O=_.getLineWidth,P=_.getLineDashArray,S=_.getElevation,j=_.getPolygon,k=_.updateTriggers,C=_.material,E=this.state,A=E.paths,T=E.pathsDiff,M=this.getSubLayerClass("fill",p.a),L=this.getSubLayerClass("stroke",m.a),I=this.shouldRenderSubLayer("fill",A)&&new M({_dataDiff:n,extruded:a,elevationScale:s,filled:r,wireframe:o,getElevation:S,getFillColor:x,getLineColor:w,material:C,transitions:u},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:k.getPolygon,getElevation:k.getElevation,getFillColor:k.getFillColor,getLineColor:k.getLineColor}}),{data:t,positionFormat:c,getPolygon:j});return[!a&&I,!a&&i&&this.shouldRenderSubLayer("stroke",A)&&new L({_dataDiff:T&&function(){return T},widthUnits:f,widthScale:h,widthMinPixels:d,widthMaxPixels:v,rounded:g,miterLimit:y,dashJustified:b,transitions:u&&{getWidth:u.getLineWidth,getColor:u.getLineColor,getPath:u.getPolygon},getColor:this.getSubLayerAccessor(w),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:k.getLineWidth,getColor:k.getLineColor,getDashArray:k.getLineDashArray}}),{data:A,positionFormat:c,getPath:function(e){return e.path}}),a&&I]}}]),t}(g.a);w.layerName="PolygonLayer",w.defaultProps=x},function(e,t,n){"use strict";var i="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",r={name:"project2",vs:i,fs:i},a=n(115);t.a={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[r,a.a]}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var r="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",a="".concat(r,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),o={ONE:1};t.a={name:"fp64",vs:a,fs:null,fp64ify:i,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var a=4*n+r;i(e[4*r+n],t,2*a)}return t},getUniforms:function(){return Object.assign({},o)}},"".concat(r)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(93),b=n(58);n.d(t,"a",function(){return w});var _=[0,0,0,255],x={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:_},getTargetColor:{type:"accessor",value:_},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n vec2 source = project_position(geometry.worldPosition, instancePositions64Low.xy).xy;\n vec2 target = project_position(geometry.worldPositionAlt, instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:_},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:_},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]);var O=u(x,d);c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);w.layerName="ArcLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(93),b=n(58);n.d(t,"a",function(){return x});var _={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.), target_commonspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),O=u(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]),c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);x.layerName="LineLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(193),v=n(171),g=n(114),p=n(192),m=n(131),y=n(139),b=n(15);function _(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},r=n.startRow,a=void 0===r?0:r,o=n.endRow,s=void 0===o?e.length:o,u=a;u0;)t=t[0];return t&&Number.isFinite(t[0])}(a,o))switch(a){case"Point":s.push(n({geometry:e},i,r));break;case"MultiPoint":o.forEach(function(e){s.push(n({geometry:{type:"Point",coordinates:e}},i,r))});break;case"LineString":u.push(n({geometry:e},i,r));break;case"MultiLineString":o.forEach(function(e){u.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"Polygon":c.push(n({geometry:e},i,r)),o.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"MultiPolygon":o.forEach(function(e){c.push(n({geometry:{type:"Polygon",coordinates:e}},i,r)),e.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))})})}else b.a.warn("".concat(a," coordinates are malformed"))()}var w={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return j});var O=new p.a,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:O};function S(e){return e.geometry.coordinates}var j=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){var t=e.props,n=e.changeFlags;if(n.dataChanged){var i=function(e){if(Array.isArray(e))return e;switch(b.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return b.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data),r=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var a=this.state.features,o={},s={};for(var u in a)o[u]=a[u].slice(),s[u]=[];var c=!0,l=!1,f=void 0;try{for(var h,d=n.dataChanged[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value,g=_(i,r,v);for(var p in a)s[p].push(Object(y.a)({data:o[p],getIndex:function(e){return e.__source.index},dataRange:v,replace:g[p]}))}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}this.setState({features:o,featuresDiff:s})}else this.setState({features:_(i,r),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var e=this.state,t=e.features,n=e.featuresDiff,i=t.pointFeatures,r=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures,s=this.props,u=s.stroked,c=s.filled,l=s.extruded,f=s.wireframe,h=s.material,d=s.transitions,p=this.props,y=p.lineWidthUnits,b=p.lineWidthScale,_=p.lineWidthMinPixels,x=p.lineWidthMaxPixels,w=p.lineJointRounded,O=p.lineMiterLimit,P=p.pointRadiusScale,j=p.pointRadiusMinPixels,k=p.pointRadiusMaxPixels,C=p.elevationScale,E=p.lineDashJustified,A=this.props,T=A.getLineColor,M=A.getFillColor,L=A.getRadius,I=A.getLineWidth,R=A.getLineDashArray,F=A.getElevation,D=A.updateTriggers,N=this.getSubLayerClass("polygons-fill",m.a),z=this.getSubLayerClass("polygons-stroke",g.a),B=this.getSubLayerClass("line-strings",g.a),U=this.getSubLayerClass("points",v.a),V=this.shouldRenderSubLayer("polygons-fill",a)&&new N({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:l,elevationScale:C,filled:c,wireframe:f,material:h,getElevation:this.getSubLayerAccessor(F),getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),transitions:d&&{getPolygon:d.geometry,getElevation:d.getElevation,getFillColor:d.getFillColor,getLineColor:d.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:D.getElevation,getFillColor:D.getFillColor,getLineColor:D.getLineColor}}),{data:a,getPolygon:S});return[!l&&V,!l&&u&&this.shouldRenderSubLayer("polygons-stroke",o)&&new z({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:o,getPath:S}),this.shouldRenderSubLayer("linestrings",r)&&new B({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:r,getPath:S}),this.shouldRenderSubLayer("points",i)&&new U({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:u,filled:c,radiusScale:P,radiusMinPixels:j,radiusMaxPixels:k,lineWidthUnits:y,lineWidthScale:b,lineWidthMinPixels:_,lineWidthMaxPixels:x,getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),getRadius:this.getSubLayerAccessor(L),getLineWidth:this.getSubLayerAccessor(I),transitions:d&&{getPosition:d.geometry,getFillColor:d.getFillColor,getLineColor:d.getLineColor,getRadius:d.getRadius,getLineWidth:d.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:D.getFillColor,getLineColor:D.getLineColor,getRadius:D.getRadius,getLineWidth:D.getLineWidth}}),{data:i,getPosition:S}),l&&V]}}]),t}(d.a);j.layerName="GeoJsonLayer",j.defaultProps=P},function(e,t,n){"use strict";var i,r=n(4),a=n(5),o=n(0),s=n(147),u=n(123),c=n(207),l=n(30),f=n(43),h=n(80),d=n(126),v=n(159),g=n(202),p=n(60),m=n(211),y=n(19),b=n(26),_=n(67),x=n(93),w="transform_uSampler_",O="transform_uSize_",P="transform_position";function S(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,c={},l=t,f={};if(a>0||i){var h=l.split("\n"),d=h.slice();if(h.forEach(function(e,t,r){if(a>0){var l=function(e,t){var n={},i=function(e){return Object(u.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(w).concat(e),n="".concat(O).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),c=s.samplerName,l=s.sizeName,f=s.uniformDeclerations,h=Object(u.e)(r),d=" ".concat(r," ").concat(a," = transform_getInput(").concat(c,", ").concat(l,").").concat(h,";\n");n[c]=a;var v={"vs:#decl":f,"vs:#main-start":d};return{updatedLine:o,inject:v,samplerTextureMap:n}}return null}(e,n);if(l){var h=l.updatedLine,v=l.inject;d[t]=h,f=Object(s.b)([f,v]),Object.assign(c,l.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(u.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Object(y.a)(r);var v="".concat(O).concat(i),g={"vs:#decl":"uniform vec2 ".concat(v,";\n"),"vs:#main-start":" vec2 ".concat(P," = transform_getPos(").concat(v,");\n gl_Position = vec4(").concat(P,", 0, 1.);\n")};f=Object(s.b)([f,g])}l=d.join("\n")}return{vs:l,targetTextureType:o,inject:f,samplerTextureMap:c}}n.d(t,"a",function(){return k});var j=(i={},Object(o.a)(i,10241,9728),Object(o.a)(i,10240,9728),Object(o.a)(i,10242,33071),Object(o.a)(i,10243,33071),i),k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,e),Object(y.a)(Object(l.d)(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this.resources={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(a.a)(e,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(a.a)(e,[{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof f.a?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Object(y.a)(!n||n===this.targetTextureVarying);var o=Object(h.e)(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,c=Object(u.d)(this.targetTextureType),l=new s(o.length*c/4),f=0,d=0;d0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,s=this.framebuffers[this.currentIndex],Object(y.a)(s),r.viewport=[0,0,s.width,s.height],o&&s.clear({color:!0})),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){b.a.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Object(y.a)(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Object(y.a)(r[o]instanceof f.a||r[o].buffer instanceof f.a);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(j)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Object(y.a)(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(b.a.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(b.a.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,h=e._swapTexture;for(var v in Object(y.a)(a&&(s||n||c)&&o),t||{})Object(y.a)(t[v]instanceof f.a||t[v].buffer instanceof f.a);for(var g in u||{})Object(y.a)(u[g]instanceof d.a);return Object(y.a)(!c||l),Object(y.a)(!h||u[h]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n,0);Object(y.a)(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e,t){var n;if(e instanceof d.a)return e;var i=this.sourceTextures[0][e];if(!i)return null;this._targetRefTexName=e;var r=Object(v.a)(i,{parameters:(n={},Object(o.a)(n,10241,9728),Object(o.a)(n,10240,9728),Object(o.a)(n,10242,33071),Object(o.a)(n,10243,33071),n),pixelStore:Object(o.a)({},37440,!1)}),a="target-texture-".concat(t);return this.resources[a]&&this.resources[a].delete(),this.resources[a]=r,r}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=this._createNewBuffer(r,{byteLength:o,usage:s,accessor:u});this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new f.a(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=n,n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Object(y.a)(this.feedbackBuffers[t][i]instanceof f.a))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new x.a(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){Object(_.a)(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=this._createNewBuffer("elementIDBuffer",{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,l=Object(s.b)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:e._fs||Object(u.b)({version:Object(m.a)(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[c.a].concat(e.modules||[]):e.modules,uniforms:i,inject:l,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return S({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}()},function(e,t,n){"use strict";(function(e){var i=n(34);t.a="undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==Object(i.a)(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(89))},function(e,t,n){var i=n(255);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){e.exports=function(e){var t;if("function"==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(38),a=n.n(r),o=n(121);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(89))},function(e,t,n){var i=n(8);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===S(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(O(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),O(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),O(i),O(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u * Released under the Apache License, Version 2.0 From e71463e659d74f8d3a3dcba4de5bb6e1ed2efa02 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Fri, 16 Aug 2019 14:00:40 +1000 Subject: [PATCH 13/24] close #209 --- R/mapdeck_tokens.R | 14 +++++++++++++- docs/articles/mapdeck.html | 28 +++++++++++++++++----------- vignettes/mapdeck.Rmd | 7 ++++++- vignettes/mapdeck.html | 34 ++++++++++++++++++++++------------ 4 files changed, 58 insertions(+), 25 deletions(-) diff --git a/R/mapdeck_tokens.R b/R/mapdeck_tokens.R index 435decff..60438bfb 100644 --- a/R/mapdeck_tokens.R +++ b/R/mapdeck_tokens.R @@ -3,8 +3,20 @@ #' Retrieves the mapdeck token that has been set #' #' @export -mapdeck_tokens <- function() getOption("mapdeck") +mapdeck_tokens <- function() { + if(!is.na( getOption("mapdeck")[["mapdeck"]][["mapbox"]] ) ) { + return( getOption("mapdeck") ) + } + + if( !is.null( get_access_token() ) ){ + return( get_access_token() ) + } + + cat("no tokens found") + return(invisible()) + +} #' @export print.mapdeck_api <- function(x, ...) { diff --git a/docs/articles/mapdeck.html b/docs/articles/mapdeck.html index cc8a0838..3b562a65 100644 --- a/docs/articles/mapdeck.html +++ b/docs/articles/mapdeck.html @@ -100,7 +100,7 @@

mapdeck

David Cooley

-

2019-06-14

+

2019-08-16

@@ -109,7 +109,7 @@

2019-06-14

-
library(mapdeck)
+
library(mapdeck)

What is Mapdeck?

@@ -124,17 +124,23 @@

The basics

You need a Mapbox Access Token to load a map. Then call mapdeck(token = token) to give you a map

- -

You can use set_token() to make your token available ‘globally’ to all future calls to mapdeck().

- +
key <- 'abc'    ## put your own token here
+mapdeck(token = key)
+

You can make your token available ‘globally’ to all mapdeck() calls by either

+
    +
  1. using set_token(), which sets the token as an option +
  2. +
  3. having the token in your environment (e.g., using Sys.setenv() ) with the key one of “MAPBOX_TOKEN”,“MAPBOX_KEY”,“MAPBOX_API_TOKEN”, “MAPBOX_API_KEY”, “MAPBOX”, “MAPDECK”
  4. +
+

Here’s an example using set_token()

+
set_token('abc')
+mapdeck_tokens()
+#  Mapdeck tokens
+#   -  mapbox : abc

You can style the map using any mapbox style template styles, or you can create one of your own

-
mapdeck(token = key, style = 'mapbox://styles/mapbox/dark-v9')
+
mapdeck(token = key, style = 'mapbox://styles/mapbox/dark-v9')

I’ve provided a convenience function to select one of the mapbox defined styles

-
mapdeck_style(style = 'dark')
+
mapdeck_style(style = 'dark')

Once you have a map you can start adding layers through the various add_*() functions (there is an example of each one in this vignette).

All details about layers, colours, tips & triks, etc, are here

    diff --git a/vignettes/mapdeck.Rmd b/vignettes/mapdeck.Rmd index d822b6f8..3be709dd 100644 --- a/vignettes/mapdeck.Rmd +++ b/vignettes/mapdeck.Rmd @@ -49,7 +49,12 @@ key <- 'abc' ## put your own token here mapdeck(token = key) ``` -You can use `set_token()` to make your token available 'globally' to all future calls to `mapdeck()`. +You can make your token available 'globally' to all `mapdeck()` calls by either + +1. using `set_token()`, which sets the token as an `option` +2. having the token in your environment (e.g., using `Sys.setenv()` ) with the key one of "MAPBOX_TOKEN","MAPBOX_KEY","MAPBOX_API_TOKEN", "MAPBOX_API_KEY", "MAPBOX", "MAPDECK" + +Here's an example using `set_token()` ```{r, eval = T} set_token('abc') diff --git a/vignettes/mapdeck.html b/vignettes/mapdeck.html index a75bccb9..cadabe55 100644 --- a/vignettes/mapdeck.html +++ b/vignettes/mapdeck.html @@ -11,7 +11,7 @@ - + mapdeck @@ -1345,9 +1345,7 @@ - - + + + + + + + +
    + +
    @@ -1555,8 +1561,8 @@

    mapdeck

    -

    David Cooley

    -

    2019-02-08

    +

    David Cooley

    +

    2019-08-16

    @@ -1573,17 +1579,21 @@

    Why did you build it?

    The basics

    You need a Mapbox Access Token to load a map. Then call mapdeck(token = token) to give you a map

    -
    key <- 'abc'    ## put your own token here
    +
    key <- 'abc'    ## put your own token here
     mapdeck(token = key)
    -

    You can use set_token() to make your token available ‘globally’ to all future calls to mapdeck().

    -
    set_token('abc')
    +

    You can make your token available ‘globally’ to all mapdeck() calls by either

    +
      +
    1. using set_token(), which sets the token as an option
    2. +
    3. having the token in your environment (e.g., using Sys.setenv() ) with the key one of “MAPBOX_TOKEN”,“MAPBOX_KEY”,“MAPBOX_API_TOKEN”, “MAPBOX_API_KEY”, “MAPBOX”, “MAPDECK”
    4. +
    +
    set_token('abc')
     mapdeck_tokens()
     #  Mapdeck tokens
     #   -  mapbox : abc

    You can style the map using any mapbox style template styles, or you can create one of your own

    -
    mapdeck(token = key, style = 'mapbox://styles/mapbox/dark-v9')
    +
    mapdeck(token = key, style = 'mapbox://styles/mapbox/dark-v9')

    I’ve provided a convenience function to select one of the mapbox defined styles

    -
    mapdeck_style(style = 'dark')
    +
    mapdeck_style(style = 'dark')

    Once you have a map you can start adding layers through the various add_*() functions (there is an example of each one in this vignette).

    All details about layers, colours, tips & triks, etc, are here

      From da6ba613ada54fc173e5987ee9a2fa85c70982e7 Mon Sep 17 00:00:00 2001 From: tospig Date: Wed, 28 Aug 2019 21:20:48 +1000 Subject: [PATCH 14/24] also trying wasm only --- inst/wasm/wasm.cpp | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 inst/wasm/wasm.cpp diff --git a/inst/wasm/wasm.cpp b/inst/wasm/wasm.cpp new file mode 100644 index 00000000..f7b40df1 --- /dev/null +++ b/inst/wasm/wasm.cpp @@ -0,0 +1,7 @@ + + +// TODO +// cpp code to call wasm to call javascript +// .wasm file will be in /inst/htmlwidgets/lib +// compiler steps.... +// From 204faecce8c3c1d7e8480baa9223d766167b3fb5 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Tue, 3 Sep 2019 10:17:20 +1000 Subject: [PATCH 15/24] deckgl 7.3.4-alpha.4 --- R/mapdeck_dependencies.R | 2 +- inst/htmlwidgets/lib/deckgl.min.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/mapdeck_dependencies.R b/R/mapdeck_dependencies.R index 496b62b6..0ecdf31b 100644 --- a/R/mapdeck_dependencies.R +++ b/R/mapdeck_dependencies.R @@ -157,7 +157,7 @@ deckgl_min_js <- function() { list( createHtmlDependency( name = "deckgl", - version = "7.2.1", + version = "7.3.0", src = system.file("htmlwidgets/lib/", package = "mapdeck"), script = c("deckgl.min.js"), all_files = FALSE diff --git a/inst/htmlwidgets/lib/deckgl.min.js b/inst/htmlwidgets/lib/deckgl.min.js index 3e8acda5..36a3b666 100644 --- a/inst/htmlwidgets/lib/deckgl.min.js +++ b/inst/htmlwidgets/lib/deckgl.min.js @@ -1,9 +1,9 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("h3"),require("S2"));else if("function"==typeof define&&define.amd)define(["h3","S2"],t);else{var n="object"==typeof exports?t(require("h3"),require("S2")):t(e.h3,e.S2);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=237)}([function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return i})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},i=g.b[t];if(Object(m.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in y)return y[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),y[t]=s,s}var _=n(59),x=n(43),w=n(61),O=n(197),P=n(60),S=n(95),j=n(126),k=n(160),C=n(112),E=n(80),A=n(177),T=n(161),M=n(202),L=n(106),I=n(203),R=n(4),F=n(5),D=n(73),N=5126,z=5124,B=5125,U=function(){function e(t){var n;for(var i in Object(R.a)(this,e),this.layout={},this.size=0,t)this._addUniform(i,t[i]);this.size+=(4-this.size%4)%4;var r=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,N,r),Object(c.a)(n,z,new Int32Array(r.buffer)),Object(c.a)(n,B,new Uint32Array(r.buffer)),n)}return Object(F.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[N]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Object(m.a)(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Object(D.a)(t);Object(m.a)(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}(),V=n(124),G=n(26),W=n(67),H=n(46);n.d(t,"S",function(){return r.a}),n.d(t,"A",function(){return a.a}),n.d(t,"B",function(){return a.b}),n.d(t,"V",function(){return a.d}),n.d(t,"X",function(){return a.e}),n.d(t,"N",function(){return o.c}),n.d(t,"O",function(){return o.d}),n.d(t,"w",function(){return s.a}),n.d(t,"J",function(){return u.b}),n.d(t,"I",function(){return u.a}),n.d(t,"E",function(){return v}),n.d(t,"H",function(){return d}),n.d(t,"F",function(){return h}),n.d(t,"D",function(){return f.a}),n.d(t,"c",function(){return g.a}),n.d(t,"L",function(){return p.b}),n.d(t,"M",function(){return p.c}),n.d(t,"G",function(){return p.a}),n.d(t,"t",function(){return b}),n.d(t,"a",function(){return _.a}),n.d(t,"b",function(){return x.a}),n.d(t,"i",function(){return w.b}),n.d(t,"q",function(){return w.c}),n.d(t,"d",function(){return w.a}),n.d(t,"f",function(){return O.a}),n.d(t,"e",function(){return P.a}),n.d(t,"h",function(){return S.a}),n.d(t,"j",function(){return j.a}),n.d(t,"l",function(){return k.a}),n.d(t,"u",function(){return C.a}),n.d(t,"v",function(){return C.b}),n.d(t,"T",function(){return E.e}),n.d(t,"U",function(){return E.f}),n.d(t,"x",function(){return E.b}),n.d(t,"y",function(){return E.c}),n.d(t,"z",function(){return E.d}),n.d(t,"s",function(){return E.a}),n.d(t,"g",function(){return A.a}),n.d(t,"k",function(){return T.a}),n.d(t,"m",function(){return M.a}),n.d(t,"p",function(){return L.a}),n.d(t,"o",function(){return I.a}),n.d(t,"n",function(){return U}),n.d(t,"Y",function(){return V.c}),n.d(t,"P",function(){return V.a}),n.d(t,"Q",function(){return V.b}),n.d(t,"R",function(){return G.a}),n.d(t,"r",function(){return m.a}),n.d(t,"Z",function(){return W.c}),n.d(t,"W",function(){return H.c}),n.d(t,"ab",function(){return H.d}),n.d(t,"K",function(){return H.b}),n.d(t,"C",function(){return H.a})},function(e,t,n){"use strict";var i=n(236);t.a=new i.a({id:"deck"}).enable()},function(e,t,n){var i=n(252),r=n(253),a=n(254);e.exports=function(e,t){return i(e)||r(e,t)||a()}},function(e,t,n){"use strict";n.r(t);var i=n(14),r=n(51),a=n(58),o=n(128),s=n(146),u=n(204),c=n(24),l=new Uint8Array([0,0,0]);function f(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function h(e){var t=Object(c.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function d(){return l}var v=n(93),g=n(224),p=n(101),m=n(190),y=n(34),b=n(4),_=n(5),x=n(125),w=n(135),O=n(19),P=n(26);var S=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.onInitialize,r=void 0===i?function(){}:i,a=n.onFinalize,o=void 0===a?function(){}:a,s=n.useDevicePixels,u=void 0===s||s,c=n.autoResizeDrawingBuffer,l=void 0===c||c;this.props={onInitialize:r,onFinalize:o},this.setProps({autoResizeDrawingBuffer:l,useDevicePixels:u}),Object(O.a)(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(_.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.onmessage=function(n){var i,r,a,o=n.data;switch(o.command){case"start":i=t,r=o.opts.canvas,a=new Map,r.addEventListener=function(e,t){i.postMessage({command:"addEventListener",type:e}),a.has(e)||a.set(e,[]),a.get(e).push(t)},r.removeEventListener=function(e,t){i.postMessage({command:"removeEventListener",type:e});var n=a.get(e);n&&n.splice(n.indexOf(t),1)},r.dispatchEvent=function(e,t){var n=a.get(e);n&&n.forEach(function(e){return e(t)})},i.canvas=r,e.start(o.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=o.width,t.canvas.height=o.height;break;case"event":t.canvas.dispatchEvent(o.type,o.event)}}}}}]),Object(_.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,Object(x.b)().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=Object(w.b)(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(Object(w.a)(this._animationFrameId),this._animationFrameId=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(y.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._animationFrameId=Object(w.b)(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=Object(x.a)(e);t.transferControlToOffscreen||P.a.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),j=n(10),k=n(9),C=n(11),E=n(60),A=n(70),T=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,e);var i=n.id,r=void 0===i?"pass":i;this.id=r,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(_.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=E.a.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),Object(A.a)(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),M=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),t}(T),L=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(b.a)(this,e),this.gl=t,this.framebuffer1=new E.a(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new E.a(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(_.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),I=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),i=Array.isArray(i)?{passes:i}:i,(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"multi-pass"},i)))).renderState=new L(e,i),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}}]),t}(M),R=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){var e=this.gl,t=this.props.clearBits,n=void 0===t?16640:t;e.clear(n)}}]),t}(T),F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(T),D="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",N=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),(n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},i)))).clipspace=new p.a(e,{id:"copy-pass",fs:D}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),z="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",B=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.a)(this,t),n=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:"texture-pass"},i)));var r=i.texture,a=i.opacity,o=void 0===a?1:a;return n.clipspace=new p.a(e,{id:"texture-pass",fs:z,uniforms:{uDiffuseSampler:r,uOpacity:o}}),n}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),U=n(140),V=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(b.a)(this,t),Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(T),G=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(b.a)(this,t);var a="".concat(n.name,"-pass");Object(U.b)(n);var o=function(e,t,n,i){if(t.filter||t.sampler){var r=q(t),a=new V(e,{id:n,model:W(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=q(t,r),s="".concat(n,"-").concat(o.length+1);return new V(e,Object.assign({id:s,model:W(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,a,r);return(i=Object(j.a)(this,Object(k.a)(t).call(this,e,Object.assign({id:a,passes:o},r)))).module=n,i}return Object(C.a)(t,e),Object(_.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.props.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1;var l=c.props,f=l.uniforms,h=l.model;f&&h.setUniforms(f),h.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(M);function W(e,t,n,i,r){var a=new p.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var H=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},X=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return H(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return X(i)}return null}var Z=n(36),Y=n(67),K={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Q=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("truncated-code-geometry"):n,r=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,f=e.verticalAxis,h=void 0===f?"y":f,d=e.topCap,v=void 0!==d&&d,g=e.bottomCap,p=void 0!==g&&g,m=(v?2:0)+(p?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,O=x(b),P=_(b),S=v?-2:0,j=l+(p?2:0),k=u+1,C=new Uint16Array(u*(l+m)*6),E=K[h],A=new Float32Array(3*y),T=new Float32Array(3*y),M=new Float32Array(2*y),L=0,I=0,R=S;R<=j;R++){var F=R/l,D=o*F,N=void 0;R<0?(D=0,F=1,N=n):R>l?(D=o,F=1,N=r):N=n+R/l*(r-n),-2!==R&&R!==l+2||(N=0,F=0),D-=o/2;for(var z=0;zl?0:B*O,T[L+E[1]]=R<0?-1:R>l?1:P,T[L+E[2]]=R<0||R>l?0:U*O,M[I+0]=z/u,M[I+1]=F,I+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cone-geometry"):n,r=e.radius,a=void 0===r?1:r,o=e.cap,s=void 0===o||o;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,topRadius:0,topCap:Boolean(s),bottomCap:Boolean(s),bottomRadius:a})))}return Object(C.a)(t,e),t}(Q),$=n(191),ee=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("cylinder-geometry"):n,r=e.radius,a=void 0===r?1:r;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,bottomRadius:a,topRadius:a})))}return Object(C.a)(t,e),t}(Q),te=n(29),ne=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],ie=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],re=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("ico-sphere-geometry"):n,r=function(e){var t=e.iterations,n=void 0===t?0:t,i=Math.PI,r=2*i,a=[].concat(ne),o=[].concat(ie);a.push(),o.push();for(var s=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,r=t>n?t:n,o="".concat(i,"|").concat(r);if(o in e)return e[o];var s=a[t],u=a[t+1],c=a[t+2],l=a[n],f=a[n+1],h=a[n+2],d=(s+l)/2,v=(u+f)/2,g=(c+h)/2,p=Math.sqrt(d*d+v*v+g*g);return d/=p,v/=p,g/=p,a.push(d,v,g),e[o]=a.length/3-1}}(),u=0;u=0;p-=3){var m=o[p+0],y=o[p+1],b=o[p+2],_=3*m,x=3*y,w=3*b,O=2*m,P=2*y,S=2*b,j=a[_+0],k=a[_+1],C=a[_+2],E=Math.acos(C/Math.sqrt(j*j+k*k+C*C)),A=Math.atan2(k,j)+i,T=E/i,M=1-A/r,L=a[x+0],I=a[x+1],R=a[x+2],F=Math.acos(R/Math.sqrt(L*L+I*I+R*R)),D=Math.atan2(I,L)+i,N=F/i,z=1-D/r,B=a[w+0],U=a[w+1],V=a[w+2],G=Math.acos(V/Math.sqrt(B*B+U*U+V*V)),W=Math.atan2(U,B)+i,H=G/i,X=1-W/r,q=[B-L,U-I,V-R],Z=[j-L,k-I,C-R],Y=new te.a(q).cross(Z).normalize(),K=void 0;(0===M||0===z||0===X)&&(0===M||M>.5)&&(0===z||z>.5)&&(0===X||X>.5)&&(a.push(a[_+0],a[_+1],a[_+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=T,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[x+0],a[x+1],a[x+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=N,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[w+0],a[w+1],a[w+2]),K=a.length/3-1,o.push(K),g[2*K+0]=1,g[2*K+1]=H,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z),v[_+0]=v[x+0]=v[w+0]=Y.x,v[_+1]=v[x+1]=v[w+1]=Y.y,v[_+2]=v[x+2]=v[w+2]=Y.z,g[O+0]=M,g[O+1]=T,g[P+0]=z,g[P+1]=N,g[S+0]=X,g[S+1]=H}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(g)}}}}(e),a=r.indices,o=r.attributes;return Object(j.a)(this,Object(k.a)(t).call(this,Object(Z.a)({},e,{id:i,indices:a,attributes:Object(Z.a)({},o,e.attributes)})))}return Object(C.a)(t,e),t}(a.a);var ae=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("plane-geometry"):n,r=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")]||1,f=e["".concat(c[1],"len")]||1,h=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(h+1)*(d+1),g=new Float32Array(3*v),p=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=h;x++){var w=x/h,O=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=O,n){case"x,y":g[b+0]=l*w-.5*l,g[b+1]=f*O-.5*f,g[b+2]=r,p[b+0]=0,p[b+1]=0,p[b+2]=o?1:-1;break;case"x,z":g[b+0]=l*w-.5*l,g[b+1]=r,g[b+2]=f*O-.5*f,p[b+0]=0,p[b+1]=o?1:-1,p[b+2]=0;break;case"y,z":g[b+0]=r,g[b+1]=l*w-.5*l,g[b+2]=f*O-.5*f,p[b+0]=o?1:-1,p[b+1]=0,p[b+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}y+=2,b+=3}for(var P=h+1,S=new Uint16Array(h*d*6),j=0;j0&&void 0!==arguments[0]?arguments[0]:{};Object(b.a)(this,t);var n=e.id,i=void 0===n?Object(Y.c)("sphere-geometry"):n,r=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var f=new Float32Array(3*c),h=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),g=0;g<=n;g++)for(var p=0;p<=r;p++){var m=p/r,y=g/n,b=p+g*(r+1),_=2*b,x=3*b,w=u*m,O=s*y,P=Math.sin(w),S=Math.cos(w),j=Math.sin(O),k=Math.cos(O),C=S*j,E=k,A=P*j,T=o(C,E,A,m,y);f[x+0]=T*C,f[x+1]=T*E,f[x+2]=T*A,h[x+0]=C,h[x+1]=E,h[x+2]=A,d[_+0]=m,d[_+1]=1-y}for(var M=n+1,L=0;L0&&void 0!==arguments[0]?arguments[0]:{};return Object(b.a)(this,t),(e=Object(j.a)(this,Object(k.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(C.a)(t,e),t}(ce.a),de=n(28);n.d(t,"isWebGL",function(){return i.N}),n.d(t,"isWebGL2",function(){return i.O}),n.d(t,"lumaStats",function(){return i.S}),n.d(t,"createGLContext",function(){return i.A}),n.d(t,"destroyGLContext",function(){return i.B}),n.d(t,"resizeGLContext",function(){return i.V}),n.d(t,"setGLContextDefaults",function(){return i.X}),n.d(t,"getContextInfo",function(){return i.E}),n.d(t,"getGLContextInfo",function(){return i.H}),n.d(t,"getContextLimits",function(){return i.F}),n.d(t,"FEATURES",function(){return i.c}),n.d(t,"hasFeature",function(){return i.L}),n.d(t,"hasFeatures",function(){return i.M}),n.d(t,"getFeatures",function(){return i.G}),n.d(t,"canCompileGLGSExtension",function(){return i.t}),n.d(t,"cloneTextureFrom",function(){return i.w}),n.d(t,"getKeyValue",function(){return i.J}),n.d(t,"getKey",function(){return i.I}),n.d(t,"setContextDefaults",function(){return i.X}),n.d(t,"glGetDebugInfo",function(){return i.D}),n.d(t,"trackContextState",function(){return r.g}),n.d(t,"resetParameters",function(){return r.d}),n.d(t,"getParameter",function(){return r.b}),n.d(t,"getParameters",function(){return r.c}),n.d(t,"setParameter",function(){return r.e}),n.d(t,"setParameters",function(){return r.f}),n.d(t,"withParameters",function(){return r.h}),n.d(t,"getModifiedParameters",function(){return r.a}),n.d(t,"Buffer",function(){return i.b}),n.d(t,"Shader",function(){return i.i}),n.d(t,"VertexShader",function(){return i.q}),n.d(t,"FragmentShader",function(){return i.d}),n.d(t,"Program",function(){return i.f}),n.d(t,"Framebuffer",function(){return i.e}),n.d(t,"Renderbuffer",function(){return i.h}),n.d(t,"Texture2D",function(){return i.j}),n.d(t,"TextureCube",function(){return i.l}),n.d(t,"clear",function(){return i.u}),n.d(t,"clearBuffer",function(){return i.v}),n.d(t,"readPixelsToArray",function(){return i.T}),n.d(t,"readPixelsToBuffer",function(){return i.U}),n.d(t,"copyToDataUrl",function(){return i.x}),n.d(t,"copyToImage",function(){return i.y}),n.d(t,"copyToTexture",function(){return i.z}),n.d(t,"blit",function(){return i.s}),n.d(t,"Query",function(){return i.g}),n.d(t,"Texture3D",function(){return i.k}),n.d(t,"TransformFeedback",function(){return i.m}),n.d(t,"VertexArrayObject",function(){return i.p}),n.d(t,"VertexArray",function(){return i.o}),n.d(t,"UniformBufferLayout",function(){return i.n}),n.d(t,"setPathPrefix",function(){return i.Y}),n.d(t,"loadFile",function(){return i.P}),n.d(t,"loadImage",function(){return i.Q}),n.d(t,"_Accessor",function(){return i.a}),n.d(t,"_clearBuffer",function(){return i.v}),n.d(t,"Geometry",function(){return a.a}),n.d(t,"Material",function(){return o.a}),n.d(t,"AmbientLight",function(){return s.a}),n.d(t,"DirectionalLight",function(){return s.b}),n.d(t,"PointLight",function(){return s.c}),n.d(t,"AnimationLoop",function(){return u.a}),n.d(t,"encodePickingColor",function(){return f}),n.d(t,"decodePickingColor",function(){return h}),n.d(t,"getNullPickingColor",function(){return d}),n.d(t,"Model",function(){return v.a}),n.d(t,"Transform",function(){return g.a}),n.d(t,"ClipSpace",function(){return p.a}),n.d(t,"_ShaderCache",function(){return m.a}),n.d(t,"_AnimationLoopProxy",function(){return S}),n.d(t,"_MultiPassRenderer",function(){return I}),n.d(t,"_RenderState",function(){return L}),n.d(t,"_Pass",function(){return T}),n.d(t,"_CompositePass",function(){return M}),n.d(t,"_ClearPass",function(){return R}),n.d(t,"_RenderPass",function(){return F}),n.d(t,"_CopyPass",function(){return N}),n.d(t,"_TexturePass",function(){return B}),n.d(t,"_ShaderModulePass",function(){return G}),n.d(t,"ConeGeometry",function(){return J}),n.d(t,"CubeGeometry",function(){return $.a}),n.d(t,"CylinderGeometry",function(){return ee}),n.d(t,"IcoSphereGeometry",function(){return re}),n.d(t,"PlaneGeometry",function(){return ae}),n.d(t,"SphereGeometry",function(){return oe}),n.d(t,"TruncatedConeGeometry",function(){return Q}),n.d(t,"PhongMaterial",function(){return se.a}),n.d(t,"PBRMaterial",function(){return ue}),n.d(t,"ScenegraphNode",function(){return ce.a}),n.d(t,"GroupNode",function(){return le.a}),n.d(t,"ModelNode",function(){return fe.a}),n.d(t,"CameraNode",function(){return he}),n.d(t,"registerShaderModules",function(){return de.v}),n.d(t,"setDefaultShaderModules",function(){return de.w}),n.d(t,"getDefaultShaderModules",function(){return de.l}),n.d(t,"assembleShaders",function(){return de.c}),n.d(t,"createShaderHook",function(){return de.g}),n.d(t,"createModuleInjection",function(){return de.f}),n.d(t,"combineInjects",function(){return de.d}),n.d(t,"normalizeShaderModule",function(){return de.q}),n.d(t,"fp32",function(){return de.j}),n.d(t,"fp64",function(){return de.k}),n.d(t,"project",function(){return de.u}),n.d(t,"lights",function(){return de.p}),n.d(t,"dirlight",function(){return de.i}),n.d(t,"picking",function(){return de.t}),n.d(t,"diffuse",function(){return de.h}),n.d(t,"gouraudlighting",function(){return de.o}),n.d(t,"phonglighting",function(){return de.s}),n.d(t,"pbr",function(){return de.r}),n.d(t,"_transform",function(){return de.b}),n.d(t,"MODULAR_SHADERS",function(){return de.a}),n.d(t,"getQualifierDetails",function(){return de.n}),n.d(t,"getPassthroughFS",function(){return de.m}),n.d(t,"typeToChannelSuffix",function(){return de.y}),n.d(t,"typeToChannelCount",function(){return de.x}),n.d(t,"convertToVec4",function(){return de.e}),n.d(t,"log",function(){return i.R}),n.d(t,"assert",function(){return i.r}),n.d(t,"uid",function(){return i.Z}),n.d(t,"self",function(){return i.W}),n.d(t,"window",function(){return i.ab}),n.d(t,"global",function(){return i.K}),n.d(t,"document",function(){return i.C})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return f}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return g}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return b});var i=n(12);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],h=t[10],d=t[11],v=t[12],g=t[13],p=t[14],m=t[15],y=n*s-i*o,b=n*u-r*o,_=n*c-a*o,x=i*u-r*s,w=i*c-a*s,O=r*c-a*u,P=l*g-f*v,S=l*p-h*v,j=l*m-d*v,k=f*p-h*g,C=f*m-d*g,E=h*m-d*p,A=y*E-b*C+_*k+x*j-w*S+O*P;return A?(A=1/A,e[0]=(s*E-u*C+c*k)*A,e[1]=(r*C-i*E-a*k)*A,e[2]=(g*O-p*w+m*x)*A,e[3]=(h*w-f*O-d*x)*A,e[4]=(u*j-o*E-c*S)*A,e[5]=(n*E-r*j+a*S)*A,e[6]=(p*_-v*O-m*b)*A,e[7]=(l*O-h*_+d*b)*A,e[8]=(o*C-s*j+c*P)*A,e[9]=(i*j-n*C-a*P)*A,e[10]=(v*w-g*_+m*y)*A,e[11]=(f*_-l*w-d*y)*A,e[12]=(s*S-o*k-u*P)*A,e[13]=(n*k-i*S+r*P)*A,e[14]=(g*b-v*x-p*y)*A,e[15]=(l*x-f*b+h*y)*A,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],h=e[11],d=e[12],v=e[13],g=e[14],p=e[15];return(t*o-n*a)*(f*p-h*g)-(t*s-i*a)*(l*p-h*v)+(t*u-r*a)*(l*g-f*v)+(n*s-i*o)*(c*p-h*d)-(n*u-r*o)*(c*g-f*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],g=t[12],p=t[13],m=t[14],y=t[15],b=n[0],_=n[1],x=n[2],w=n[3];return e[0]=b*i+_*s+x*f+w*g,e[1]=b*r+_*u+x*h+w*p,e[2]=b*a+_*c+x*d+w*m,e[3]=b*o+_*l+x*v+w*y,b=n[4],_=n[5],x=n[6],w=n[7],e[4]=b*i+_*s+x*f+w*g,e[5]=b*r+_*u+x*h+w*p,e[6]=b*a+_*c+x*d+w*m,e[7]=b*o+_*l+x*v+w*y,b=n[8],_=n[9],x=n[10],w=n[11],e[8]=b*i+_*s+x*f+w*g,e[9]=b*r+_*u+x*h+w*p,e[10]=b*a+_*c+x*d+w*m,e[11]=b*o+_*l+x*v+w*y,b=n[12],_=n[13],x=n[14],w=n[15],e[12]=b*i+_*s+x*f+w*g,e[13]=b*r+_*u+x*h+w*p,e[14]=b*a+_*c+x*d+w*m,e[15]=b*o+_*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,f,h,d,v,g=n[0],p=n[1],m=n[2];return t===e?(e[12]=t[0]*g+t[4]*p+t[8]*m+t[12],e[13]=t[1]*g+t[5]*p+t[9]*m+t[13],e[14]=t[2]*g+t[6]*p+t[10]*m+t[14],e[15]=t[3]*g+t[7]*p+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=f,e[9]=h,e[10]=d,e[11]=v,e[12]=i*g+s*p+f*m+t[12],e[13]=r*g+u*p+h*m+t[13],e[14]=a*g+c*p+d*m+t[14],e[15]=o*g+l*p+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,f,h,d,v,g,p,m,y,b,_,x,w,O,P,S,j,k,C,E=r[0],A=r[1],T=r[2],M=Math.sqrt(E*E+A*A+T*T);return M0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=Ce.a,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return u()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.fp64,a=e.dataChanged;if(this.data=t,this.getGeometry=n,this.fp64=r,this.positionSize="XY"===i?2:3,Array.isArray(a)){var o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;this._rebuildGeometry(f)}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(je.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var f,h=o[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,f=!1,h=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}var g=this.attributes,p=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in p){var _=p[b];_.copy=Boolean(e),_.fp64Only&&!y||(g[b]=m.allocate(g[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.opts=t}return u()(e,[{key:"equals",value:function(e){return this===e||this.constructor===e.constructor&&Object(Le.a)(this.opts,e.opts)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var t=e.constructor.defaultProps,n=void 0===t?{}:t,i={updateTriggers:{}};for(var r in n)if(r in this.props){var a=n[r],o=this.props[r];i[r]=o,a&&"accessor"===a.type&&(i.updateTriggers[r]=this.props.updateTriggers[r],"function"==typeof o&&(i[r]=this.getSubLayerAccessor(o,!0)))}return i}},{key:"initializeState",value:function(e,t){}},{key:"updateState",value:function(e,t){}},{key:"finalizeState",value:function(e){}}]),e}();n.d(t,"experimental",function(){return Re}),n.d(t,"COORDINATE_SYSTEM",function(){return i.a}),n.d(t,"LightingEffect",function(){return r.a}),n.d(t,"PointLight",function(){return m}),n.d(t,"DirectionalLight",function(){return y.a}),n.d(t,"_CameraLight",function(){return _}),n.d(t,"_SunLight",function(){return F}),n.d(t,"PostProcessEffect",function(){return D.a}),n.d(t,"_LayersPass",function(){return N.a}),n.d(t,"Deck",function(){return z.a}),n.d(t,"LayerManager",function(){return B.a}),n.d(t,"AttributeManager",function(){return U.a}),n.d(t,"Layer",function(){return V.a}),n.d(t,"CompositeLayer",function(){return G.a}),n.d(t,"DeckRenderer",function(){return W.a}),n.d(t,"Viewport",function(){return H.a}),n.d(t,"WebMercatorViewport",function(){return X.a}),n.d(t,"project",function(){return q.a}),n.d(t,"project64",function(){return Z.a}),n.d(t,"View",function(){return Y.a}),n.d(t,"MapView",function(){return K.a}),n.d(t,"FirstPersonView",function(){return Q.a}),n.d(t,"ThirdPersonView",function(){return te}),n.d(t,"OrbitView",function(){return ne.a}),n.d(t,"PerspectiveView",function(){return ae}),n.d(t,"OrthographicView",function(){return oe.a}),n.d(t,"Controller",function(){return se.a}),n.d(t,"MapController",function(){return ue.a}),n.d(t,"_FirstPersonController",function(){return ce.a}),n.d(t,"_OrbitController",function(){return le.b}),n.d(t,"_OrthographicController",function(){return fe.a}),n.d(t,"Effect",function(){return he.a}),n.d(t,"TRANSITION_EVENTS",function(){return de.a}),n.d(t,"LinearInterpolator",function(){return ve.a}),n.d(t,"FlyToInterpolator",function(){return Oe}),n.d(t,"log",function(){return Pe.a}),n.d(t,"createIterable",function(){return je.a}),n.d(t,"fp64LowPart",function(){return ke.c}),n.d(t,"AmbientLight",function(){return Me.AmbientLight}),n.d(t,"LayerExtension",function(){return Ie});var Re={Tesselator:Ee,flattenVertices:Se.c,fillArray:Se.a,count:Ae.a,memoize:Te.a}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return r}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return f}),n.d(t,"g",function(){return h}),n.d(t,"e",function(){return d});var i={};function r(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function a(e){return Math.round(e/i.EPSILON)*i.EPSILON}function o(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i=-90&&a<=90,"invalid latitude");var o=a*f;return[(t*=d)*(r*f+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*h,s*h]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*f);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:p(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*f),h=c/360,g=h/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[h,-g,m],s.degreesPerPixel=[1/h,-1/g,1/m],o){var y=f*Math.tan(t*f)/l,b=h*y/2,_=c/v*y,x=_/g*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],f=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),h=f.pixelsPerMeter,d=f.pixelsPerMeter2,v=y(e,1);v[0]+=u*(h[0]+d[0]*c),v[1]+=c*(h[1]+d[1]*c);var g=b(v,1),p=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[g[0],g[1],p]:g}function O(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,h=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*f),a.m(d,d,i*f),h&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.h([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?g:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,h=o*f,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-h-d),p=Math.cos(Math.PI/2-h)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:p*l}}function S(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function j(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var f=Object(r.d)(t,[s,c,0,1]),h=Object(r.d)(t,[s,c,1,1]),d=f[2],v=h[2],g=d===v?0:((n||0)-d)/(v-d);return o.d([],f,h,g)}},function(e,t,n){"use strict";var i=n(109),r=n(132),a=n(147),o=n(140),s=n(123),u=n(205),c=n(220),l=n(64),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h={modelMatrix:f,viewMatrix:f,projectionMatrix:f,cameraPositionWorld:[0,0,0]};var d="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",v={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new l.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(d,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(d)},g=n(115),p={lightDirection:new Float32Array([1,1,2])};var m={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[v]},y=n(206),b={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var _={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},x=n(189),w=n(219),O=n(207);n.d(t,"a",function(){return P}),n.d(t,"v",function(){return i.c}),n.d(t,"w",function(){return i.e}),n.d(t,"l",function(){return i.a}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.b}),n.d(t,"q",function(){return o.b}),n.d(t,"n",function(){return s.c}),n.d(t,"m",function(){return s.b}),n.d(t,"y",function(){return s.e}),n.d(t,"x",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u.a}),n.d(t,"k",function(){return c.a}),n.d(t,"u",function(){return v}),n.d(t,"p",function(){return g.a}),n.d(t,"i",function(){return m}),n.d(t,"t",function(){return y.a}),n.d(t,"h",function(){return _}),n.d(t,"o",function(){return x.a}),n.d(t,"s",function(){return x.b}),n.d(t,"r",function(){return w.a}),n.d(t,"b",function(){return O.a});var P={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",uniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(22),l=n(40),f=[0,0,0],h=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.c(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.j(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.k(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?f:n;return l.l(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,n,i){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e[3]=s+i*(n[3]-s),e}function g(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}function p(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function m(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=i.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-u)<=i.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=i.b*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var y,b;y=new i.a(4),i.a!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),b=y},function(e,t,n){e.exports=n(259)()},,function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"g",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"n",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return v}),n.d(t,"a",function(){return g}),n.d(t,"m",function(){return m}),n.d(t,"f",function(){return y});var i=n(12);function r(){var e=new i.a(3);return i.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function l(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function f(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function h(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function v(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function g(e,t){var n=o(e[0],e[1],e[2]),i=o(t[0],t[1],t[2]);u(n,n),u(i,i);var r=c(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var p,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},y=a;p=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},f=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||f(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:f,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={LNG_LAT:1,LNGLAT_AUTO_OFFSET:4,METER_OFFSETS:2,LNGLAT_OFFSETS:3,IDENTITY:0}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(32),u=n(11),c=n(52),l=n(59),f=n(30),h=n(118),d=n(234),v=n(19),g=n(26),p={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"},m={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:p},y={removedProps:p},b=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(s.a)(n)),n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=Object(d.a)("Buffer",e,m),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=Object(d.a)("Buffer",e,y))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new l.a(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Object(v.a)(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(Object(f.a)(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return Object(f.a)(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;Object(f.a)(this.gl);var c,l,d=Object(h.c)(this.accessor.type||5126,{clamped:!1}),g=this._getAvailableElementCount(r),p=o;n?c=(l=n.length)-p:l=p+(c=Math.min(g,u||g));var m=Math.min(g,c);return u=u||m,Object(v.a)(u<=m),n=n||new d(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Object(v.a)(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:10}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=Object(h.b)(e);return Object(v.a)(i),this.setAccessor(new l.a(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/Object(h.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new l.a(this.accessor,{type:Object(h.b)(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return g.a.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return g.a.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new l.a(this.accessor,e),this}},{key:"type",get:function(){return g.a.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return g.a.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(c.a)},,function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(15),l=n(85),f=n(22),h=n(64),d=n(29),v=n(20),g=n(27),p=n(18),m=Math.PI/180,y=Object(l.a)(),b=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,f=t.height,h=void 0===f?1:f;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=h||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(f.e)(t.projectionMatrix,this.projectionMatrix)&&Object(f.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(g.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,f=a&&a*this.distanceScales.pixelsPerMeter[2],h=Object(g.h)([s,l,c],this.pixelUnprojectionMatrix,f),d=this.unprojectPosition(h),v=r()(d,3),p=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[p,m,y]:Number.isFinite(a)?[p,m,a]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(g.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(g.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Object(o.b)(t);var r=n.id,a=n.userData,s=void 0===a?{}:a;this.gl=t,this.id=r||Object(u.c)(this.constructor.name),this.userData=s,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=Object(o.d)(this.gl),u={},c=n||Object.keys(r),l=!0,f=!1,h=void 0;try{for(var d,v=c[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value,p=r[g];if(p&&(!("webgl2"in p)||a)&&(!("extension"in p)||this.gl.getExtension(p.extension))){var m=i?Object(s.a)(this.gl,g):g;u[m]=this.getParameter(g,e),i&&"GLenum"===p.type&&(u[m]=Object(s.a)(this.gl,u[m]))}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return u}},{key:"setParameter",value:function(e,t){e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Object(s.b)(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return Object(l.a)(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(f)}},{key:"_deleteHandle",value:function(){throw new Error(f)}},{key:"_bindHandle",value:function(){throw new Error(f)}},{key:"_getOptsFromHandle",value:function(){throw new Error(f)}},{key:"_getParameter",value:function(e,t){throw new Error(f)}},{key:"_setParameter",value:function(e,t){throw new Error(f)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=a.a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;a.a.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=a.a.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=a.a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}()},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(45),l=/([0-9]+\.?[0-9]*)(%|px)/;function f(e){switch(r()(e)){case"number":return{position:e,relative:!1};case"string":var t=e.match(l);if(t&&t.length>=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function h(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(105),v=n(18);n.d(t,"a",function(){return g});var g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,f=void 0===l?"100%":l,h=t.height,d=void 0===h?"100%":h,g=t.projectionMatrix,p=void 0===g?null:g,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,O=t.modelMatrix,P=void 0===O?null:O,S=t.viewportInstance,j=void 0===S?null:S,k=t.type,C=void 0===k?c.a:k;Object(v.a)(!j||j instanceof c.a),this.viewportInstance=j,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=Object.assign({},t,{id:this.id,projectionMatrix:p,fovy:y,near:_,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:f,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:h(this._x,t),y:h(this._y,n),width:h(this._width,t),height:h(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=f(t),this._y=f(n),this._width=f(i),this._height=f(r)}}]),e}()},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(34),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(78),n(89))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(37);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.n([],t,e);return i.k(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(0),r=n(4),a=n(10),o=n(9),s=n(5),u=n(11),c=n(52),l=n(43),f=n(98),h=n(70),d=n(30),v=n(49),g=n(67),p=n(26),m=n(19),y=[9729,9728],b=function(e){function t(e,n){var i;Object(r.a)(this,t);var s=n.id,u=void 0===s?Object(g.c)("texture"):s,c=n.handle,l=n.target;return(i=Object(a.a)(this,Object(o.a)(t).call(this,e,{id:u,handle:c}))).target=l,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&Object(f.d)(e,n))&&(!i||Object(f.e)(e,n))),r}}]),Object(s.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var r=t.pixels,a=void 0===r?null:r,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,f=void 0!==l&&l,h=t.parameters,d=void 0===h?{}:h,v=t.pixelStore,g=void 0===v?{}:v,m=t.textureUnit,y=void 0===m?void 0:m,b=t.unpackFlipY,_=void 0===b||b,x=t.mipmaps,w=void 0===x||x;n||(n=a);var O=t.width,P=t.height,S=t.dataFormat,j=t.type,k=t.depth,C=void 0===k?0:k,E=this._deduceParameters({format:s,type:j,dataFormat:S,compressed:!1,data:n,width:O,height:P});O=E.width,P=E.height,S=E.dataFormat,j=E.type,this.width=O,this.height=P,this.depth=C,this.format=s,this.type=j,this.dataFormat=S,this.border=c,this.textureUnit=y,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var A=Object(i.a)({},37440,_),T=Object.assign({},A,g);return w&&this._isNPOT()&&(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),w=!1,this._updateForNPOT(d)),this.mipmaps=w,this.setImageData({data:n,width:O,height:P,depth:C,format:s,type:j,dataFormat:S,border:c,mipmaps:w,parameters:T}),w&&this.generateMipmap(),this.setParameters(d),f&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.height,n=e.width,i=e.mipmaps,r=void 0!==i&&i;return n!==this.width||t!==this.height?this.initialize({width:n,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(p.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,v=e.offset,g=void 0===v?0:v,p=e.parameters,y=void 0===p?{}:p,b=e.data,_=void 0===b?null:b,x=e.type,w=void 0===x?this.type:x,O=e.width,P=void 0===O?this.width:O,S=e.height,j=void 0===S?this.height:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E;_||(_=r);var T=this._deduceParameters({format:u,type:w,dataFormat:C,compressed:A,data:_,width:P,height:j});w=T.type,C=T.dataFormat,A=T.compressed,P=T.width,j=T.height;var M=this.gl;M.bindTexture(this.target,this.handle);var L,I=this._getDataType({data:_,compressed:A});if(_=I.data,L=I.dataType,Object(h.a)(this.gl,y,function(){switch(L){case"null":M.texImage2D(n,o,u,P,j,l,C,w,_);break;case"typed-array":M.texImage2D(n,o,u,P,j,l,C,w,_,g);break;case"buffer":Object(d.a)(M),M.bindBuffer(35052,_.handle||_),M.texImage2D(n,o,u,P,j,l,C,w,g),M.bindBuffer(35052,null);break;case"browser-object":Object(d.d)(M)?M.texImage2D(n,o,u,P,j,l,C,w,_):M.texImage2D(n,o,u,C,w,_);break;case"compressed":M.compressedTexImage2D(n,o,u,P,j,l,_);break;default:Object(m.a)(!1,"Unknown image data type")}}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var R=f.a[this.dataFormat]||4,F=f.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,f=e.y,g=void 0===f?0:f,p=e.width,y=void 0===p?this.width:p,b=e.height,_=void 0===b?this.height:b,x=e.level,w=void 0===x?0:x,O=e.format,P=void 0===O?this.format:O,S=e.type,j=void 0===S?this.type:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,A=void 0!==E&&E,T=e.offset,M=void 0===T?0:T,L=e.border,I=(void 0===L&&this.border,e.parameters),R=void 0===I?{}:I,F=this._deduceParameters({format:P,type:j,dataFormat:C,compressed:A,data:s,width:y,height:_});if(j=F.type,C=F.dataFormat,A=F.compressed,y=F.width,_=F.height,Object(m.a)(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var D=s;s=D.data,y=D.shape[0],_=D.shape[1]}s instanceof l.a&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Object(h.a)(this.gl,R,function(){A?t.gl.compressedTexSubImage2D(i,w,c,g,y,_,P,s):null===s?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s,M):s instanceof v.b?(Object(d.a)(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,w,c,g,y,_,C,j,M),t.gl.bindBuffer(35052,null)):Object(d.d)(t.gl)?t.gl.texSubImage2D(i,w,c,g,y,_,C,j,s):t.gl.texSubImage2D(i,w,c,g,C,j,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return p.a.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof l.a?{data:t.handle,dataType:"buffer"}:t instanceof v.b?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=f.b[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},Object(m.a)(i,"Could not deduced texture size"),Object(m.a)(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Object(m.a)(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Object(m.a)(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Object(d.d)(this.gl)&&(!(!this.width||!this.height)&&(!Object(g.b)(this.width)||!Object(g.b)(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===y.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(c.a)},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(76);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function o(e){for(var t=1;t0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}n.d(t,"a",function(){return s}),n.d(t,"b",function(){return u})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(36),r=n(4),a=n(5),o=n(67),s=n(19),u={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,e);var n=t.id,i=void 0===n?Object(o.c)("geometry"):n,a=t.drawMode,s=void 0===a?u.TRIANGLES:a,c=t.attributes,l=void 0===c?{}:c,f=t.indices,h=void 0===f?null:f,d=t.vertexCount,v=void 0===d?null:d;this.id=i,this.drawMode=0|s,this.attributes={},this.userData={},this._setAttributes(l,h),this.vertexCount=v||this._calculateVertexCount(this.attributes,this.indices)}return Object(a.a)(e,null,[{key:"DRAW_MODE",get:function(){return u}}]),Object(a.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?Object(i.a)({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Object(s.a)(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||i.size||(i.size=3),"indices"===n?(Object(s.a)(!this.indices),this.indices=i):this.attributes[n]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}return Object(s.a)(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}()},function(e,t,n){"use strict";var i=n(176);function r(e,t,n){return(r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Object(i.a)(a,n.prototype),a}).apply(null,arguments)}var a=n(4),o=n(5),s=n(118),u=n(19),c=n(234);n.d(t,"a",function(){return h});var l={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},f={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},h=function(){function e(){var t=this;Object(a.a)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=Object(c.a)("Accessor",e,f)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(0),r=n(24),a=n(4),o=n(10),s=n(9),u=n(32),c=n(5),l=n(11),f=n(52),h=n(126),d=n(95),v=n(112),g=n(80),p=n(127),m=n(30),y=n(68),b=n(19),_=n(26),x=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this,t),(n=Object(o.a)(this,Object(s.a)(t).call(this,e,i))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.initialize(i),Object.seal(Object(u.a)(n)),n}return Object(l.a)(t,e),Object(c.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(Object(m.d)(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(c.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,f=e.stencil,h=void 0!==f&&f,d=e.check,v=void 0===d||d,g=e.readBuffer,p=e.drawBuffers;if(Object(b.a)(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,h,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:g,drawBuffers:p}),o&&v&&this.checkStatus()}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Object(b.a)(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&_.a.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,a=void 0!==i&&i,o=n.resizeAttachments,s=void 0===o||o,u={};a&&Object.keys(this.attachments).forEach(function(e){u[e]=null}),Object.assign(u,e);var c=this.gl.bindFramebuffer(36160,this.handle);for(var l in u){Object(b.a)(void 0!==l,"Misspelled framebuffer binding point?");var f=Number(l),h=u[f],v=h;if(v)if(v instanceof d.a)this._attachRenderbuffer({attachment:f,renderbuffer:v});else if(Array.isArray(h)){var g=Object(r.a)(h,3),p=g[0],m=g[1],y=void 0===m?0:m,_=g[2],x=void 0===_?0:_;v=p,this._attachTexture({attachment:f,texture:p,layer:y,level:x})}else this._attachTexture({attachment:f,texture:v,layer:0,level:0});else this._unattach(f);s&&v&&v.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(w(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&Object(v.a)(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){Object(v.b)({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _.a.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;Object(m.a)(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Object(y.a)(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?Object(y.a)(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>_.a.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Object(g.b)(this,{maxHeight:100});return _.a.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,r,a){var o,s=null;e&&((s=s||{})[36064]=new h.a(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:r,height:a,mipmaps:!1,parameters:(o={},Object(i.a)(o,10241,9729),Object(i.a)(o,10240,9729),Object(i.a)(o,10242,33071),Object(i.a)(o,10243,33071),o)}));return t&&n?(s=s||{})[33306]=new d.a(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:r,height:111}):t?(s=s||{})[36096]=new d.a(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:r,height:a}):n&&Object(b.a)(!1),s}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof d.a?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Object(b.a)(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;Object(m.d)(t)?t.readBuffer(e):Object(b.a)(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(Object(m.d)(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Object(b.a)(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=Object(p.a)(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(f.a);function w(e){return(x.STATUS||{})[e]||"Framebuffer error ".concat(e)}x.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(9),o=n(5),s=n(11),u=n(162),c=35632,l=35633;function f(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Object(u.a)(t)||"(unnamed)",f="".concat(function(e){switch(e){case c:return"fragment";case l:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),v=0;v1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=d(a,r-o);return s+n+e})}(t);return{shaderName:f,errors:h(a,b),warnings:h(o,b)}}function h(e,t){for(var n="",i=0;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(f.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(f.a)(e)}}]),t}(n(133).a),p=n(20),m=n(47),y=n(40),b=n(37);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=h,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=f,this[15]=g,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,h=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=f,this[12]=h,this[13]=d,this[14]=v,this[15]=g,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(f.a)(n):this[t][e]=Object(f.a)(n),this}},{key:"determinant",value:function(){return p.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return p.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return p.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return p.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return p.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,f=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var h=i/2,d=s*Math.tan(h),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:f})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return p.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return p.p(this,this),this.check()}},{key:"invert",value:function(){return p.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return p.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return p.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return p.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return p.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return p.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return p.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?p.n(this,this,e):p.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return p.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),h(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.n(t,e,this),h(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new g,b.n(t,e,this),h(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.n(t,[e[0],e[1],0,n],this),t.length=2,h(t,2);break;case 3:t=t||new v.a,b.n(t,[e[0],e[1],e[2],n],this),t.length=3,h(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new g,b.n(t,e,this),h(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(62),r=n(198),a=n(144);function o(e,t,n){var r=i.c[t],o=r?r(e,Number(t)):e.getParameter(Number(t)),s=i.d[t];return Object(a.a)("function"==typeof s),s(e,n,Number(t)),o}function s(e,t){var n={};for(var r in t){var a=Number(r),o=i.d[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],a))}var s=e.state&&e.state.cache;if(s){var u=Object.assign({},s,t);for(var c in n){(0,i.a[c])(e,u)}}}function u(e,t){var n=i.c[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function c(e,t){t=t||i.b;var n=Array.isArray(t)?t:Object.keys(t),r={},a=!0,o=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value;r[f]=u(e,f)}}catch(e){o=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return r}function l(e){s(e,Object.assign({},i.b,{}))}function f(e){var t=c(e,Object.keys(i.b)),n={};for(var a in i.b)Object(r.a)(t[a],i.b[a])||(n[a]=t[a]);return n}},function(e,t,n){"use strict";var i=n(9);function r(e,t,n){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(i.a)(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i=n(19),r={};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";r[e]=r[e]||1;var t=r[e]++;return"".concat(e,"-").concat(t)}function o(e){return Object(i.a)("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function s(e){var t=!0;for(var n in e){t=!1;break}return t}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var i=n(19);function r(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var r=e[t=t.replace(/^.*\./,"")];return Object(i.a)(void 0!==r,"Accessing undefined constant GL.".concat(t)),r}function a(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(77),r=n.n(i),a=n(41),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},f=function(e){o.a.isReady()&&o.a.listenFor("init",e)},h=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(90),r=n(148),a=n(233),o=n(144);function s(e,t,n){if(Object(a.a)(t))return n(e);var s,u=t.nocatch,c=void 0===u||u;if(Object(o.a)(!t.frameBuffer),Object(i.c)(e),Object(r.a)(e,t),c)s=n(e),Object(i.b)(e);else try{s=n(e)}finally{Object(i.b)(e)}return s}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});var i="vs",r="fs"},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}function o(e){return e&&e[Symbol.asyncIterator]}},function(e,t,n){"use strict";n.d(t,"c",function(){return _}),n.d(t,"a",function(){return x}),n.d(t,"b",function(){return w});var i,r=n(24),a=n(0),o=n(19),s=5120,u=5121,c=5122,l=5123,f=0,h=1,d=2,v=3,g=4,p=5,m=6,y=5126,b=(i={},Object(a.a)(i,y,[y,1,"float"]),Object(a.a)(i,35664,[y,2,"vec2"]),Object(a.a)(i,35665,[y,3,"vec3"]),Object(a.a)(i,35666,[y,4,"vec4"]),Object(a.a)(i,5124,[5124,1,"int"]),Object(a.a)(i,35667,[5124,2,"ivec2"]),Object(a.a)(i,35668,[5124,3,"ivec3"]),Object(a.a)(i,35669,[5124,4,"ivec4"]),Object(a.a)(i,5125,[5125,1,"uint"]),Object(a.a)(i,36294,[5125,2,"uvec2"]),Object(a.a)(i,36295,[5125,3,"uvec3"]),Object(a.a)(i,36296,[5125,4,"uvec4"]),Object(a.a)(i,35670,[y,1,"bool"]),Object(a.a)(i,35671,[y,2,"bvec2"]),Object(a.a)(i,35672,[y,3,"bvec3"]),Object(a.a)(i,35673,[y,4,"bvec4"]),Object(a.a)(i,35674,[y,8,"mat2"]),Object(a.a)(i,35685,[y,8,"mat2x3"]),Object(a.a)(i,35686,[y,8,"mat2x4"]),Object(a.a)(i,35675,[y,12,"mat3"]),Object(a.a)(i,35687,[y,12,"mat3x2"]),Object(a.a)(i,35688,[y,12,"mat3x4"]),Object(a.a)(i,35676,[y,16,"mat4"]),Object(a.a)(i,35689,[y,16,"mat4x2"]),Object(a.a)(i,35690,[y,16,"mat4x3"]),i);function _(e){switch(e){case f:return f;case h:case v:case d:return h;case g:case p:case m:return g;default:return Object(o.a)(!1),0}}function x(e){var t=b[e];if(!t)return null;var n=Object(r.a)(t,2);return{type:n[0],components:n[1]}}function w(e,t){switch(e){case s:case u:case c:case l:e=y}for(var n in b){var i=Object(r.a)(b[n],3),a=i[0],o=i[1],f=i[2];if(a===e&&o===t)return{glType:n,name:f}}return null}},function(e,t,n){"use strict";n.d(t,"e",function(){return y}),n.d(t,"d",function(){return b}),n.d(t,"b",function(){return _}),n.d(t,"a",function(){return w}),n.d(t,"c",function(){return O});var i,r=n(0),a=n(60),o=n(95),s=n(56),u=n(26),c=(i={},Object(r.a)(i,5126,function(e,t,n){return e.uniform1fv(t,g(n,1))}),Object(r.a)(i,35664,function(e,t,n){return e.uniform2fv(t,g(n,2))}),Object(r.a)(i,35665,function(e,t,n){return e.uniform3fv(t,g(n,3))}),Object(r.a)(i,35666,function(e,t,n){return e.uniform4fv(t,g(n,4))}),Object(r.a)(i,5124,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35667,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35668,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35669,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35670,function(e,t,n){return e.uniform1iv(t,p(n,1))}),Object(r.a)(i,35671,function(e,t,n){return e.uniform2iv(t,p(n,2))}),Object(r.a)(i,35672,function(e,t,n){return e.uniform3iv(t,p(n,3))}),Object(r.a)(i,35673,function(e,t,n){return e.uniform4iv(t,p(n,4))}),Object(r.a)(i,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,g(n,4))}),Object(r.a)(i,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,g(n,9))}),Object(r.a)(i,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,g(n,16))}),Object(r.a)(i,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,5125,function(e,t,n){return e.uniform1uiv(t,m(n,1))}),Object(r.a)(i,36294,function(e,t,n){return e.uniform2uiv(t,m(n,2))}),Object(r.a)(i,36295,function(e,t,n){return e.uniform3uiv(t,m(n,3))}),Object(r.a)(i,36296,function(e,t,n){return e.uniform4uiv(t,m(n,4))}),Object(r.a)(i,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,g(n,6))}),Object(r.a)(i,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,g(n,8))}),Object(r.a)(i,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,g(n,6))}),Object(r.a)(i,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,g(n,12))}),Object(r.a)(i,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,g(n,8))}),Object(r.a)(i,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,g(n,12))}),Object(r.a)(i,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36311,function(e,t,n){return e.uniform1i(t,n)}),i),l={},f={},h={},d=[0];function v(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(d[0]=e,e=d);var r=e.length;if(r%t&&u.a.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&uHTMLVideoElement.HAVE_METADATA&&(i.width!==o.videoWidth||i.height!==o.videoHeight?(i.resize({width:o.videoWidth,height:o.videoHeight,mipmaps:!0}),i.setSubImageData({data:o,paramters:P})):i.setSubImageData({data:o}),i.generateMipmap());i&&r&&r.setUniforms(Object.assign({},t,{bitmapTexture:i,desaturate:s,transparentColor:u.map(function(e){return e/255}),tintColor:c.slice(0,3).map(function(e){return e/255})})).draw()}},{key:"loadTexture",value:function(e){var t=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),e instanceof O.a?this.setState({bitmapTexture:e}):e instanceof HTMLVideoElement?this.setState({bitmapTexture:new O.a(t,{width:1,height:1,parameters:P,mipmaps:!1})}):e&&this.setState({bitmapTexture:new O.a(t,{data:e,parameters:P})})}},{key:"calculatePositions",value:function(e){var t=e.value,n=this.state.positions;t.set(n)}},{key:"calculatePositions64xyLow",value:function(e){var t=this.use64bitPositions();(e.constant=!t,t)?e.value.set(this.state.positions.map(b.c)):e.value=new Float32Array(4)}}]),t}(_.a);S.layerName="BitmapLayer",S.defaultProps={image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};var j,k=n(72),C=n(80),E=n(122),A=1024,T=4,M=function(){},L=(j={},y()(j,10241,9987),y()(j,10240,9729),j);function I(e){return e&&(e.id||e.url)}function R(e,t,n){for(var i=0;i0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,f=0,h=[],d=0;dl&&(R(a,h,c),s=0,c=f+c+i,f=0,h=[]),h.push({icon:v,xOffset:s}),s=s+p+i,f=Math.max(f,g)}}return h.length>0&&R(a,h,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=f+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,f=u.yOffset,h=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=f,this._canvasHeight=h,this._texture||(this._texture=new O.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:L})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(C.f)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:L}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(E.b)(e.url).then(function(r){var a=I(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,f=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:f,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},L,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),D=[0,0,0,255],N={iconAtlas:{type:"object",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},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:D},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},z=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new F(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instanceIconFrames:{size:4,accessor:"getIcon",update:this.calculateInstanceIconFrames},instanceColorModes:{size:1,type:5121,accessor:"getIcon",update:this.calculateInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:D},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(h()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,f=!1;if(s||this.props._asyncPropOriginalValues.iconAtlas?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),f=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),f=!0),f&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),r.extensionsChanged){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"calculateInstancePositions64xyLow",value:function(e){var t=this.use64bitPositions();if(e.constant=!t,t){var n=this.props,i=n.data,r=n.getPosition,a=e.value,o=0,s=Object(k.a)(i),u=s.iterable,c=s.objectInfo,l=!0,f=!1,h=void 0;try{for(var d,v=u[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;c.index++;var p=r(g,c);a[o++]=Object(b.c)(p[0]),a[o++]=Object(b.c)(p[1])}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}else e.value=new Float32Array(2)}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.width/2-m.anchorX||0,o[s++]=m.height/2-m.anchorY||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceColorMode",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l).mask;o[s++]=m?1:0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}},{key:"calculateInstanceIconFrames",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props.data,a=this.state.iconManager,o=e.value,s=n*e.size,u=Object(k.a)(r,n,i),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=v.value;l.index++;var m=a.getIconMapping(p,l);o[s++]=m.x||0,o[s++]=m.y||0,o[s++]=m.width||0,o[s++]=m.height||0}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(_.a);z.layerName="IconLayer",z.defaultProps=N;var B=n(222),U=n(192),V=[0,0,0,255],G=[0,0,1],W=new U.a,H={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:G},getColor:{type:"accessor",value:V},material:W,radiusPixels:{deprecatedFor:"pointSize"}};var X=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(e){return v()(h()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:G},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:V}})}},{key:"updateState",value:function(e){var n,i,r,a=e.props,o=e.oldProps,s=e.changeFlags;if(v()(h()(t.prototype),"updateState",this).call(this,{props:a,oldProps:o,changeFlags:s}),s.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),this.getAttributeManager().invalidateAll()}s.dataChanged&&(n=a.data,i=n.header,r=n.attributes,i&&r&&(n.length=i.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION,r.instancePositions64xyLow={constant:!0,value:new Float32Array(2)}),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0&&(r.instanceColors=r.COLOR_0)))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new x.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new w.a({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(k.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var p,m=f[Symbol.iterator]();!(d=(p=m.next()).done);d=!0){var y=p.value;h.index++;var _=s(y,h);u[c++]=Object(b.c)(_[0]),u[c++]=Object(b.c)(_[1])}}catch(e){v=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(v)throw g}}}else e.value=new Float32Array(2)}}]),t}(_.a);X.layerName="PointCloudLayer",X.defaultProps=H;var q=n(171),Z=n(170),Y=n(217),K=n(114),Q=n(218),J=n(223),$=n(193),ee=n(16),te=n.n(ee),ne=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(h()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position); \n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){v()(h()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(h()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(h()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getParagraphSize,f=r.getRowSize,h=r.getOffsets,d=e.value,v=n*e.size,g=Object(k.a)(a,n,i).iterable,p=!0,m=!1,y=void 0;try{for(var b,_=g[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){var x=b.value,w=o[s(x)]||{},O=l(x),P=te()(O,2),S=P[0],j=P[1],C=f(x),E=te()(C,1)[0],A=h(x),T=te()(A,2),M=T[0],L=T[1],I=u(x),R=c(x),F=(1-I)*(S-E)/2;d[v++]=(I-1)*S/2+F+w.width/2+M||0,d[v++]=(R-1)*j/2+w.height/2+L||0}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(k.a)(a,n,i).iterable,f=!0,h=!1,d=void 0;try{for(var v,g=l[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var p=o(v.value);this.encodePickingColor(p,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}}}]),t}(z);ne.layerName="MultiIconLayer",ne.defaultProps={getRowSize:{type:"accessor",value:function(e){return e.rowSize||[0,0]}},getOffsets:{type:"accessor",value:function(e){return e.offsets||[0,0]}},getParagraphSize:{type:"accessor",value:function(e){return e.size||[1,1]}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ie=n(231),re=n.n(ie),ae=n(15),oe=32;function se(e,t,n,i,r){var a=e.split("\n"),o=[0,0],s=0;a.forEach(function(e){var a=function(e,t,n){var i=0,r=0,a=Array.from(e);return{characters:a=a.map(function(e,a){var o={text:e,offsetLeft:i},s=t[e];return s?(i+=s.width,r||(r=s.height*n)):(ae.a.warn("Missing character: ".concat(e))(),i+=oe),o}),rowWidth:i,rowHeight:r}}(e,n,t),u=a.characters,c=a.rowWidth,l=a.rowHeight,f=[c,l];u.forEach(function(e){e.offsetTop=s,e.size=o,e.rowSize=f,r.push(i(e))}),s+=l,o[0]=Math.max(o[0],c)}),o[1]=s}var ue=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ce=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),le="Monaco, monospace",fe="normal",he=64,de=2,ve=.25,ge=3,pe=new ue(3),me=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function ye(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};me.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=pe.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=pe.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),pe.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,f=n&&n.data;f||((f=document.createElement("canvas")).width=1024);var h=f.getContext("2d");be(h,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,f=void 0===l?0:l,h=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,h++),s[e]={x:d+r,y:f+h*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,g=i+2*r;return{mapping:s,xOffset:d,yOffset:f+h*g,canvasHeight:(v=f+(h+1)*g,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return h.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,g=d.canvasHeight,p=d.xOffset,m=d.yOffset;if(f.height!==g){var y=h.getImageData(0,0,f.width,f.height);f.height=g,h.putImageData(y,0,0)}if(be(h,r,o,a),u){var b=new re.a(o,s,c,l,r,a),_=h.getImageData(0,0,b.size,b.size),x=!0,w=!1,O=void 0;try{for(var P,S=t[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;ye(b.draw(j),_),h.putImageData(_,v[j].x-s,v[j].y-s)}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}}else{var k=!0,C=!1,E=void 0;try{for(var A,T=t[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h.fillText(M,v[M].x,v[M].y+.9*o)}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}}return{xOffset:p,yOffset:m,mapping:v,data:f,width:f.width,height:f.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=pe.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),xe=n(139),we={fontSize:he,buffer:de,sdf:!1,radius:ge,cutoff:ve},Oe={start:1,middle:0,end:-1},Pe={top:1,center:0,bottom:-1},Se=["fontSize","buffer","sdf","radius","cutoff"],je={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ce,fontFamily:le,fontWeight:fe,lineHeight:1,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},ke=function(e){function t(){return o()(this,t),l()(this,h()(t).apply(this,arguments))}return p()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new _e(this.context.gl)}}},{key:"updateState",value:function(e){var t=this,n=e.props,i=e.oldProps,r=e.changeFlags,a=this.fontChanged(i,n);a&&this.updateFontAtlas({oldProps:i,props:n});var o=r.dataChanged||a||n.lineHeight!==i.lineHeight||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText);if(o&&Array.isArray(r.dataChanged)){var s=this.state.data.slice(),u=r.dataChanged.map(function(e){return Object(xe.a)({data:s,getIndex:function(e){return e.__source.index},dataRange:e,replace:t.transformStringToLetters(e)})});this.setState({data:s,dataDiff:u})}else o&&this.setState({data:this.transformStringToLetters(),dataDiff:null})}},{key:"finalizeState",value:function(){v()(h()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},we,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return Se.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,r=n.lineHeight,a=n.getText,o=this.state.iconMapping,s=t.startRow,u=t.endRow,c=Object(k.a)(i,s,u),l=c.iterable,f=c.objectInfo,h=[],d=!0,v=!1,g=void 0;try{for(var p,m=function(){var t=p.value;f.index++;var n=a(t,f);n&&se(n,r,o,function(n){return e.getSubLayerRow(n,t,f.index)},h)},y=l[Symbol.iterator]();!(d=(p=y.next()).done);d=!0)m()}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}return h}},{key:"getAnchorXFromTextAnchor",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Oe[e]||0}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return Oe[e(t)]||0}):function(){return Pe[e]||0}}},{key:"renderLayers",value:function(){var e=this.state,t=e.data,n=e.dataDiff,i=e.scale,r=e.iconAtlas,a=e.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,f=o.getTextAnchor,h=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.billboard,g=o.sdf,p=o.sizeScale,m=o.sizeUnits,y=o.sizeMinPixels,b=o.sizeMaxPixels,_=o.transitions,x=o.updateTriggers;return new(this.getSubLayerClass("characters",ne))({sdf:g,iconAtlas:r,iconMapping:a,_dataDiff:n&&function(){return n},getPosition:this.getSubLayerAccessor(s),getColor:this.getSubLayerAccessor(u),getSize:this.getSubLayerAccessor(c),getAngle:this.getSubLayerAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(f),getAnchorY:this.getAnchorYFromAlignmentBaseline(h),getPixelOffset:this.getSubLayerAccessor(d),getPickingIndex:function(e){return e.__source.index},billboard:v,sizeScale:p*i,sizeUnits:m,sizeMinPixels:y*i,sizeMaxPixels:b*i,transitions:_&&{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:x.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:x.getPixelOffset,getAnchorX:x.getTextAnchor,getAnchorY:x.getAlignmentBaseline}}),{data:t,getIcon:function(e){return e.text},getRowSize:function(e){return e.rowSize},getOffsets:function(e){return[e.offsetLeft,e.offsetTop]},getParagraphSize:function(e){return e.size}})}}]),t}($.a);ke.layerName="TextLayer",ke.defaultProps=je;var Ce=n(131);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return S}),n.d(t,"IconLayer",function(){return z}),n.d(t,"LineLayer",function(){return B.a}),n.d(t,"PointCloudLayer",function(){return X}),n.d(t,"ScatterplotLayer",function(){return q.a}),n.d(t,"ColumnLayer",function(){return Z.a}),n.d(t,"GridCellLayer",function(){return Y.a}),n.d(t,"PathLayer",function(){return K.a}),n.d(t,"PolygonLayer",function(){return Q.a}),n.d(t,"GeoJsonLayer",function(){return J.a}),n.d(t,"TextLayer",function(){return ke}),n.d(t,"SolidPolygonLayer",function(){return Ce.a}),n.d(t,"_MultiIconLayer",function(){return ne})},function(e,t,n){"use strict";var i=n(43),r=n(60),a=n(56),o=n(70),s=n(30),u=n(118),c=n(19);function l(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(c.a)(!1),0}}var f=n(159),h=n(26);function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,f=t.sourceAttachment,h=void 0===f?36064:f,d=t.target,v=void 0===d?null:d,g=t.sourceWidth,p=t.sourceHeight,m=t.sourceType,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=_.attachments;g=g||_.width,p=p||_.height,36064===h&&null===O&&(h=1028),Object(c.a)(P[h]),v=function(e,t,n,i,r){if(e)return e;t=t||5121;var a=Object(u.c)(t,{clamped:!1}),o=l(n);return new a(i*r*o)}(v,m=m||P[h].type,s,g,p),m=m||Object(u.b)(v);var S=w.bindFramebuffer(36160,O);return w.readPixels(i,a,g,p,s,m,v),w.bindFramebuffer(36160,S||null),x&&_.delete(),v}function v(e,t){var n=t.sourceX,r=void 0===n?0:n,a=t.sourceY,u=void 0===a?0:a,f=t.sourceFormat,h=void 0===f?6408:f,d=t.target,v=void 0===d?null:d,g=t.targetByteOffset,p=void 0===g?0:g,m=t.sourceWidth,y=t.sourceHeight,_=t.sourceType,x=b(e),w=x.framebuffer,O=x.deleteFramebuffer;Object(c.a)(w);var P=w.gl;if(m=m||w.width,y=y||w.height,Object(s.a)(P),_=_||(v?v.type:5121),!v){var S=l(h),j=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(c.a)(!1),0}}(_),k=p+m*y*S*j;v=new i.a(P,{byteLength:k,accessor:{type:_,size:S}})}return v.bind({target:35051}),Object(o.a)(P,{framebuffer:w},function(){P.readPixels(r,u,m,y,h,_,p)}),v.unbind({target:35051}),O&&w.delete(),v}function g(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=d(e,{sourceAttachment:i}),s=e.width,c=e.height;c>a;){var l=Object(u.d)({data:o,width:s,height:c});o=l.data,s=l.width,c=l.height}Object(u.a)({data:o,width:s,height:c});var f=document.createElement("canvas");f.width=s,f.height=c;var h=f.getContext("2d"),v=h.createImageData(s,c);return v.data.set(o),h.putImageData(v,0,0),f.toDataURL()}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=g(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,o=n.sourceY,s=void 0===o?0:o,u=n.targetX,l=n.targetY,f=n.targetZ,h=n.targetMipmaplevel,d=void 0===h?0:h,v=n.targetInternalFormat,g=void 0===v?6408:v,p=n.width,m=n.height,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=void 0!==u||void 0!==l||void 0!==f;u=u||0,l=l||0,f=f||0;var S=w.bindFramebuffer(36160,O);Object(c.a)(t);var j=null;if(t instanceof a.a&&(j=t,p=Number.isFinite(p)?p:j.width,m=Number.isFinite(m)?m:j.height,j.bind(0),t=j.target),P)switch(t){case 3553:case 34067:w.copyTexSubImage2D(t,d,u,l,r,s,p,m);break;case 35866:case 32879:w.copyTexSubImage3D(t,d,u,l,f,r,s,p,m)}else w.copyTexImage2D(t,d,g,r,s,p,m,0);return j&&j.unbind(),w.bindFramebuffer(36160,S||null),x&&_.delete(),j}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,u=n.sourceY0,l=void 0===u?0:u,f=n.sourceX1,d=n.sourceY1,v=n.targetX0,g=void 0===v?0:v,p=n.targetY0,m=void 0===p?0:p,y=n.targetX1,_=n.targetY1,x=n.color,w=void 0===x||x,O=n.depth,P=void 0!==O&&O,S=n.stencil,j=void 0!==S&&S,k=n.mask,C=void 0===k?0:k,E=n.filter,A=void 0===E?9728:E,T=b(e),M=T.framebuffer,L=T.deleteFramebuffer,I=b(t),R=I.framebuffer,F=I.deleteFramebuffer;Object(c.a)(M),Object(c.a)(R);var D=R.gl,N=R.handle,z=R.width,B=R.height,U=R.readBuffer;Object(s.a)(D),M.handle||36064!==r||(r=1028),w&&(C|=16384),P&&(C|=256),j&&(C|=1024),(L||F)&&1280&C&&(C=16384,h.a.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Object(c.a)(C),f=void 0===f?M.width:f,d=void 0===d?M.height:d,y=void 0===y?z:y,_=void 0===_?B:_;var V=D.bindFramebuffer(36009,N),G=D.bindFramebuffer(36008,M.handle);return D.readBuffer(r),D.blitFramebuffer(o,l,f,d,g,m,y,_,C,A),D.readBuffer(U),D.bindFramebuffer(36008,G||null),D.bindFramebuffer(36009,V||null),L&&M.delete(),F&&R.delete(),R}function b(e){return e instanceof r.a?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Object(f.b)(e),deleteFramebuffer:!0}}n.d(t,"e",function(){return d}),n.d(t,"f",function(){return v}),n.d(t,"b",function(){return g}),n.d(t,"c",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return y})},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(179),v=n(22),g=["longitude","latitude","zoom","bearing","pitch"],p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return r()(this,t),u()(this,l()(t).call(this,e))}return h()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(81),u=n(180),c=n(18),l=function(){},f={BREAK:1,SNAP_TO_END:2,IGNORE:3},h={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:f.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},h,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},h,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===f.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===f.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),e}();d.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(82),u=n(15),c=n(18),l={transitionDuration:0},f=["wheel"],h=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],g=["keydown"],p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,p=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(f,x&&n),this.toggleEvents(h,x&&(r||o)),this.toggleEvents(d,x&&(p||y)),this.toggleEvents(v,x&&c),this.toggleEvents(g,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=p,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,e.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){if(!this.isDragging())return!1;var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState,r={};switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut(),r.isZooming=!0;break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn(),r.isZooming=!0;break;case 37:n?(t=i.rotateLeft(),r.isRotating=!0):(t=i.moveLeft(),r.isPanning=!0);break;case 39:n?(t=i.rotateRight(),r.isRotating=!0):(t=i.moveRight(),r.isPanning=!0);break;case 38:n?(t=i.rotateUp(),r.isRotating=!0):(t=i.moveUp(),r.isPanning=!0);break;case 40:n?(t=i.rotateDown(),r.isRotating=!0):(t=i.moveDown(),r.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),r),!0}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";var i=n(205),r=n(42),a=Object.keys(r.a).map(function(e){return"const float COORDINATE_SYSTEM_".concat(e," = ").concat(r.a[e],".;")}).join(""),o="".concat(a,"\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform float project_uAntimeridian;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n dy = clamp(dy, -1., 1.);\n }\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n"),s=n(136),u={};t.a={name:"project",dependencies:[i.a],vs:o,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?Object(s.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return v});var i=n(29);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-t[2],-t[6],-t[10]],up:[t[1],t[5],t[9]],right:[t[0],t[4],t[8]]}}var o=new i.a,s=new i.a,u=new i.a,c=new i.a,l=new i.a,f=new i.a,h=new i.a;function d(e){var t=e.aspect,n=e.near,r=e.far,a=e.fovyRadians,d=e.position,v=e.direction,g=e.up,p=e.right;s.copy(v);var m=1/s.len();s.normalize(),o.copy(d),u.copy(g).normalize(),c.copy(p).normalize();var y=2*Math.tan(a/2)*n,b=y*t;l.copy(s).scale(n*m).add(o),f.copy(s).scale(r*m).add(o);var _=s.clone().negate(),x=_.dot(l),w={near:{distance:x,normal:_},far:{distance:s.dot(f),normal:s.clone()}};return h.copy(c).scale(.5*b).add(l).subtract(o).normalize(),_=new i.a(u).cross(h),x=o.dot(_),w.right={normal:_,distance:x},h.copy(c).scale(.5*-b).add(l).subtract(o).normalize(),_=new i.a(h).cross(u),x=o.dot(_),w.left={normal:_,distance:x},h.copy(u).scale(.5*y).add(l).subtract(o).normalize(),_=new i.a(h).cross(c),x=o.dot(_),w.top={normal:_,distance:x},h.copy(u).scale(.5*-y).add(l).subtract(o).normalize(),_=new i.a(c).cross(h),x=o.dot(_),w.bottom={normal:_,distance:x},w}function v(e){return e-Math.fround(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(96),r=n(54);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t){var n,i,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),Object(c.a)(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new h(t,{copyState:o,enable:r}),a.a){f(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function g(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(78))},function(e,t,n){"use strict";var i=n(36),r=n(90),a=n(49),o="Failed to create WebGL context in Node.js, headless gl not available",s="Failed to create WebGL context in Node.js, headless gl returned null";var u=n(125);var c=n(111),l=(n(19),n(110)),f=n(26),h=n(46);n.d(t,"e",function(){return g}),n.d(t,"a",function(){return p}),n.d(t,"c",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"d",function(){return b});function d(e){return Boolean(e&&2===e._version)}var v={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(v,{width:1,height:1},e)}function p(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},v,t),r=n.width,h=n.height;function g(e){if(t.throwOnError)throw new Error(e);return null}if(l.a){var p=t.canvas;e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(Object(u.a)({canvas:p,width:r,height:h,onError:g}),t)}else e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,u=e.onError;if(r&&!i)return u("headless-gl does not support WebGL2");if(!a.c)return u(o);var c=Object(a.c)(t,n,e);return c||u(s)}(Object(i.a)({},t,{width:r,height:h,onError:g}));return e?(function(e){var t=d(e)?"WebGL2":"WebGL1",n=Object(c.a)(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";f.a.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=m(e,t)),e):null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==a.a&&e instanceof a.a)return 2;return 1}(e);var n=t=Object.assign({},v,t),i=n.manageState,o=n.debug;return i&&Object(r.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(5),a=n(29),o=n(64),s=n(67),u=n(19),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id;this.id=n||Object(s.c)(this.constructor.name),this.display=!0,this.position=new a.a,this.rotation=new a.a,this.scale=new a.a(1,1,1),this.matrix=new o.a,this.userData={},this.props={},this._setScenegraphNodeProps(t)}return Object(r.a)(e,[{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:"setPosition",value:function(e){return Object(u.a)(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return Object(u.a)(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return Object(u.a)(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Object(u.a)(e),t=t||this.matrix;var n=new o.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{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)}}]),e}()},function(e,t,n){"use strict";var i=n(0),r=n(36),a=n(4),o=n(5),s=n(10),u=n(9),c=n(66),l=n(11),f=n(43),h=n(202),d=n(19),v={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function g(e,t){var n=(t||{}).attributeMap,i=void 0===n?v:n;return i&&i[e]||e}function p(e,t){var n;switch(e){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2}Object(d.a)(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var m=n(30),y=n(203),b=n(112),_=n(177),x=n(197),w=n(28),O=n(132),P=n(208),S=n(209),j=n(210),k=n(41),C=n.n(k),E=n(46),A={},T=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},M=new Map;C.a.listenFor("luma.gl",function(e){var t=A[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){E.d.__SEER_INITIALIZED__&&(M.has(e)||M.set(e,new Map),M.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();T(i,n,e.value),t.setUniforms(i)}});var L=n(67),I=n(26),R=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),Object(d.a)(Object(m.c)(t));var i=n.id,r=void 0===i?Object(L.c)("base-model"):i;this.id=r,this.gl=t,this.id=n.id||Object(L.c)("Model"),this.lastLogTime=0,this.initialize(n),this._setBaseModelProps(n)}return Object(o.a)(e,[{key:"initialize",value:function(e){this.props={},this.program=this._createProgram(e),this.vertexArray=new y.a(this.gl,{program:this.program}),this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(),this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.program.delete(),this.vertexArray.delete(),t=this.id,delete A[t],C.a.deleteItem("luma.gl",t)}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"getUniforms",value:function(){return this.program.uniforms}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),function(e,t){if(E.d.__SEER_INITIALIZED__&&e){var n=M.get(e);n&&n.forEach(function(e,n){T(t,n,e)})}}(this.id,e),e=this._extractAnimatedUniforms(e),this.program.setUniforms(e),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return Object(b.a)(this.program.gl,e),this}},{key:"drawGeometry",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.moduleSettings,i=void 0===n?null:n,r=t.framebuffer,a=t.uniforms,o=void 0===a?{}:a,s=t.attributes,u=void 0===s?{}:s,c=t.transformFeedback,l=void 0===c?this.transformFeedback:c,f=t.parameters,h=void 0===f?{}:f,d=t.vertexArray,v=void 0===d?this.vertexArray:d,g=t.animationProps;A[(e=this).id]||(A[e.id]=e,C.a.listItem("luma.gl",e.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(g);var p=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&I.a.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,b=m.indexType,_=m.indexOffset,x=this.isInstanced,w=this.instanceCount,O=function(){},P=this.props,S=P.onBeforeRender,j=void 0===S?O:S,k=P.onAfterRender,E=void 0===k?O:k;j(),this._timerQueryStart();var T=this.program.draw(Object.assign({},t,{logPriority:p,uniforms:null,framebuffer:r,parameters:h,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:b,isInstanced:x,instanceCount:w,offset:y?_:0}));return this._timerQueryEnd(),E(),this._logDrawCallEnd(p,v,r),T}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&_.a.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&I.a.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_createProgram",value:function(e){var t=e.vs,n=void 0===t?null:t,i=e.fs,r=void 0===i?null:i,a=e.modules,o=void 0===a?null:a,s=e.defines,u=void 0===s?{}:s,c=e.inject,l=void 0===c?{}:c,f=e.shaderCache,h=void 0===f?null:f,v=e.varyings,g=void 0===v?null:v,p=e.bufferMode,m=void 0===p?35981:p,y=e.program,b=void 0===y?null:y;this.getModuleUniforms=function(e){};var _=this.id;if(!b){n=n||w.a.vs,r=r||w.a.fs;var P=Object(O.a)(this.gl,{vs:n,fs:r,modules:o,inject:l,defines:u,log:I.a});n=P.vs,r=P.fs,b=h?h.getProgram(this.gl,{id:_,vs:n,fs:r}):new x.a(this.gl,{id:_,vs:n,fs:r,varyings:g,bufferMode:m}),this.getModuleUniforms=P.getUniforms||function(e){}}return Object(d.a)(b instanceof x.a,"Model needs a program"),b}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!Object(L.a)(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new _.a(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,I.a.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(I.a.priority>> DRAWING MODEL ".concat(this.id),{collapsed:I.a.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=Object(P.a)({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=Object(S.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,c=Object(S.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),l=c.table;c.count>0&&I.a.log("MISSING UNIFORMS",Object.keys(l))(),u>0&&I.a.log("UNUSED UNIFORMS",Object.keys(s))();var f=Object(j.a)(this.vertexArray.configuration);I.a.table(e,r)(),I.a.table(e,o)(),I.a.table(e+1,f)(),function(e,t){if(C.a.isReady()&&!C.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);C.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),I.a.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}();n.d(t,"a",function(){return F});var F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,t);var i=n.id,o=void 0===i?Object(L.c)("model"):i;return Object(s.a)(this,Object(u.a)(t).call(this,e,Object(r.a)({},n,{id:o})))}return Object(l.a)(t,e),Object(o.a)(t,[{key:"initialize",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Object(d.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){Object(c.a)(Object(u.a)(t.prototype),"delete",this).call(this),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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Object(d.a)(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Object(d.a)(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=function(e,t,n){var i={},a=t.indices;for(var o in t.attributes){var s=t.attributes[o],u=g(o,n);if("indices"===o)a=s;else if(s.constant)i[u]=s.value;else{var c=s.value,l=Object(r.a)({},s);delete l.value,i[u]=[new f.a(e,c),l],p(o,l)}}if(a){var h=a.value||a;Object(d.a)(h instanceof Uint16Array||h instanceof Uint32Array,'attribute array for "indices" must be of integer type');var v={size:1,isIndexed:void 0===a.isIndexed||a.isIndexed};i.indices=[new f.a(e,{data:h,target:34963}),v]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(L.a)(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,r=e.feedbackBuffers,a=e.unbindModels,o=void 0===a?[]:a,s=e.parameters;r&&this._setFeedbackBuffers(r),n&&(s=Object.assign({},s,Object(i.a)({},35977,n))),o.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:s}))}finally{o.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return I.a.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof f.a&&t.delete()}}},{key:"_setAnimationProps",value:function(e){if(this.animated){Object(d.a)(e,"Model.draw(): animated uniforms but no animationProps");var t=this._evaluateAnimateUniforms(e);this.program.setUniforms(t)}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(L.a)(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new h.a(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}}]),t}(R)},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,i))).initialize(i),Object.seal(Object(s.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=Object(v.d)(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,d)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(u.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Object(g.a)(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Object(v.d)(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*d[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(174),r="7.2.1",a=Object(i.a)()},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"webgl2-polyfill: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return h});var i,r,a,o=n(0),s=n(30),u=(i={},Object(o.a)(i,6407,{dataFormat:6407,types:[5121,33635]}),Object(o.a)(i,6408,{dataFormat:6408,types:[5121,32819,32820]}),Object(o.a)(i,6406,{dataFormat:6406,types:[5121]}),Object(o.a)(i,6409,{dataFormat:6409,types:[5121]}),Object(o.a)(i,6410,{dataFormat:6410,types:[5121]}),Object(o.a)(i,33326,{dataFormat:6403,types:[5126],gl2:!0}),Object(o.a)(i,33328,{dataFormat:33319,types:[5126],gl2:!0}),Object(o.a)(i,34837,{dataFormat:6407,types:[5126],gl2:!0}),Object(o.a)(i,34836,{dataFormat:6408,types:[5126],gl2:!0}),i),c=(r={},Object(o.a)(r,6403,1),Object(o.a)(r,36244,1),Object(o.a)(r,33319,2),Object(o.a)(r,33320,2),Object(o.a)(r,6407,3),Object(o.a)(r,36248,3),Object(o.a)(r,6408,4),Object(o.a)(r,36249,4),Object(o.a)(r,6402,1),Object(o.a)(r,34041,1),Object(o.a)(r,6406,1),Object(o.a)(r,6409,1),Object(o.a)(r,6410,2),r),l=(a={},Object(o.a)(a,5126,4),Object(o.a)(a,5125,4),Object(o.a)(a,5124,4),Object(o.a)(a,5123,2),Object(o.a)(a,5122,2),Object(o.a)(a,5131,2),Object(o.a)(a,5120,1),Object(o.a)(a,5121,1),a);function f(e,t){var n=u[t];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var i=Object(s.d)(e)&&n.gl2||n.gl1;return"string"==typeof i?e.getExtension(i):i}function h(e,t){var n=u[t];switch(n&&n.types[0]){case 5126:return e.getExtension("OES_texture_float_linear");case 5131:return e.getExtension("OES_texture_half_float_linear");default:return!0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"}},,function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(10),a=n(9),o=n(11),s=n(93),u=n(58),c="attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",l=[-1,-1,1,-1,-1,1,1,1],f=function(e){function t(e,n){var o;Object(i.a)(this,t);var s=l.map(function(e){return-1===e?0:e});return(o=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},n,{vs:c,geometry:new u.a({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(l)},aTexCoord:{size:2,value:new Float32Array(s)},aCoordinate:{size:2,value:new Float32Array(s)}}})})))).setVertexCount(4),o}return Object(o.a)(t,e),t}(s.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(178),v=n(70),g=n(112),p=n(148),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;return Object(v.a)(n,{framebuffer:e.outputBuffer},function(){return t.drawLayers(e)})}},{key:"drawLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.views,a=e.onViewportActive,o=e.deviceRect,s=void 0===o?null:o,u=e.parameters,c=void 0===u?{}:u,l=e.pass,f=void 0===l?"draw":l,h=e.redrawReason,d=void 0===h?"":h,v=e.clearCanvas,g=void 0===v||v,p=e.effects,m=e.effectProps,y=this.gl;g&&this.clearCanvas(y);var b=[];return i.forEach(function(e,i){var o=t.getViewportFromDescriptor(e),u=r&&r[o.id];a(o);var l=t.drawLayersInViewport(y,{layers:n,viewport:o,view:u,deviceRect:s,parameters:c,pass:f,redrawReason:d,effects:p,effectProps:m});b.push(l)}),b}},{key:"drawLayersInViewport",value:function(e,t){var n=this,i=t.layers,r=t.viewport,a=t.view,o=(t.deviceRect,t.parameters),s=void 0===o?{}:o,u=(t.pass,t.redrawReason,t.effects),c=t.effectProps,l=this.getGLViewport(e,{viewport:r});if(a&&a.props.clear){var f=!0===a.props.clear?{color:!0,depth:!0}:a.props.clear;Object(v.a)(e,{scissorTest:!0,scissor:l},function(){return Object(g.a)(e,f)})}var h={totalCount:i.length,visibleCount:0,compositeCount:0,pickableCount:0};return Object(p.a)(e,s||{}),i.forEach(function(t,i){var a=n.shouldDrawLayer(t,r);a&&t.props.pickable&&h.pickableCount++,t.isComposite&&h.compositeCount++,a&&(h.visibleCount++,n.drawLayerInViewport({gl:e,layer:t,layerIndex:i,glViewport:l,parameters:s,effects:u,effectProps:c}))}),h}},{key:"drawLayerInViewport",value:function(e){e.gl;var t=e.layer,n=e.layerIndex,i=e.glViewport,r=e.parameters,a=e.effects,o=e.effectProps,s=this.getModuleParameters(t,a,o),u=Object.assign({},t.context.uniforms,{layerIndex:n}),c=this.getLayerParameters(t,n,i,r);t.drawLayer({moduleParameters:s,uniforms:u,parameters:c})}},{key:"getViewportFromDescriptor",value:function(e){return e.viewport?e.viewport:e}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!1})),i}},{key:"getModuleParameters",value:function(e){return Object.assign(Object.create(e.props),{viewport:e.context.viewport,mousePosition:e.context.mousePosition,pickingActive:0,devicePixelRatio:this.props.pixelRatio})}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n}),r}},{key:"getGLViewport",value:function(e,t){var n=t.viewport,i=e.canvas?e.canvas.clientHeight||e.canvas.height:100,r=n,a=this.props.pixelRatio;return[r.x*a,(i-r.y-r.height)*a,r.width*a,r.height*a]}},{key:"clearCanvas",value:function(e){var t=e.drawingBufferWidth,n=e.drawingBufferHeight;Object(v.a)(e,{viewport:[0,0,t,n]},function(){e.clear(16640)})}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i,r=n(0),a=n(30),o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",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"};t.b=(i={},Object(r.a)(i,o.WEBGL2,[function(e){return Object(a.d)(e)}]),Object(r.a)(i,o.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(r.a)(i,o.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(r.a)(i,o.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(r.a)(i,o.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(r.a)(i,o.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(r.a)(i,o.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(r.a)(i,o.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(r.a)(i,o.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(r.a)(i,o.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(r.a)(i,o.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(r.a)(i,o.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(r.a)(i,o.COLOR_ATTACHMENT_HALF_FLOAT,[!1,"EXT_color_buffer_half_float"]),Object(r.a)(i,o.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(r.a)(i,o.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(r.a)(i,o.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(r.a)(i,o.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),i)},function(e,t,n){"use strict";function i(e,t){return e===t||Object.keys(e).every(function(n){return Array.isArray(e[n])&&Array.isArray(t[n])?i(e[n],t[n]):e[n]===t[n]})}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(32),o=n(9),s=n(66),u=n(5),c=n(11),l=n(52),f=n(43),h=n(30),d=null;function v(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!d||d.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var u=s.id||s.program&&s.program.id;return(n=Object(r.a)(this,Object(o.a)(t).call(this,e,Object.assign({},s,{id:u})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(s),Object.seal(Object(a.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?Object(h.d)(e)||"Chrome"===function(e){if(!e&&!Object(m.a)())return"Node";if(Object(y.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":p.b.chrome?"Chrome":p.b.safari?"Safari":p.b.mozInnerScreenX?"Firefox":"Unknown"}():Object(h.d)(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Object(g.a)(!1)}}}]),Object(u.a)(t,[{key:"delete",value:function(){Object(s.a)(Object(o.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(g.a)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Object(g.a)(Object(h.d)(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new f.a(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=v(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof a.a)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof a.a)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new a.a(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"e",function(){return c}),n.d(t,"a",function(){return l}),n.d(t,"c",function(){return f}),n.d(t,"d",function(){return h}),n.d(t,"b",function(){return d});var u=new s;function c(e){u.setDefaultShaderModules(e)}function l(){return u.getDefaultShaderModules()}function f(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;u.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function h(e){return e=e.concat(u.defaultShaderModules),v(e=u.resolveModules(e))}function d(e){return u.getShaderModule(e)}function v(e){var t={},n={};return g({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function g(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,a=t.color,l=void 0===a?null:a,f=t.depth,h=void 0===f?null:f,d=t.stencil,g=void 0===d?null:d,p={};i&&(p.framebuffer=i);var m=0;l&&(m|=c,!0!==l&&(p.clearColor=l)),h&&(m|=s,!0!==h&&(p.clearDepth=h)),g&&(m|=u,!0!==h&&(p.clearStencil=h)),Object(o.a)(0!==m,v),Object(r.a)(e,p,function(){e.clear(m)})}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,s=void 0===n?null:n,u=t.buffer,c=void 0===u?l:u,g=t.drawBuffer,p=void 0===g?0:g,m=t.value,y=void 0===m?[0,0,0,0]:m;Object(a.a)(e),Object(r.a)(e,{framebuffer:s},function(){switch(c){case l:switch(y.constructor){case Int32Array:e.clearBufferiv(c,p,y);break;case Uint32Array:e.clearBufferuiv(c,p,y);break;case Float32Array:default:e.clearBufferfv(c,p,y)}break;case f:e.clearBufferfv(f,0,[y]);break;case h:e.clearBufferiv(h,0,[y]);break;case d:var t=Object(i.a)(y,2),n=t[0],r=t[1];e.clearBufferfi(d,0,n,r);break;default:Object(o.a)(!1,v)}})}},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=function(e){function t(e){var n;r()(this,t),n=u()(this,l()(t).call(this,e));var i=e._shadow,a=void 0!==i&&i;return n.shadow=a,n}return h()(t,e),o()(t,[{key:"getProjectedLight",value:function(){return this}}]),t}(n(146).b)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(130),p=n(93),m=n(58),y=n(21),b=n(85),_=y.experimental.Tesselator,x=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,fp64:o,positionFormat:a,attributes:{startPositions:{size:3,padding:3},endPositions:{size:3,padding:3},segmentTypes:{size:1,type:Uint8ClampedArray},startPositions64XyLow:{size:2,padding:2,fp64Only:!0},endPositions64XyLow:{size:2,padding:2,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){var t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t<3?0:t+1:t-1}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.startPositions64XyLow,o=n.endPositions64XyLow,s=n.segmentTypes,u=this.fp64,c=t.geometrySize;if(0!==c)for(var l,f,h=this.isClosed(e),d=t.vertexStart,v=0;v=e.length&&(t+=1-e.length/n),[e[t*n],e[t*n+1],3===n?e[t*n+2]:0]}return t>=e.length&&(t+=1-e.length),e[t]}},{key:"isClosed",value:function(e){var t=this.getPathLength(e),n=this.getPointOnPath(e,0),i=this.getPointOnPath(e,t-1);return n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]}}]),t}(_);n.d(t,"a",function(){return S});var w=[0,0,0,255],O={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:w},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},P={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},S=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec4 instanceLeftStartPositions64xyLow;\nattribute vec4 instanceEndRightPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width, vec2 widthPixels\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(vCornerOffset * widthPixels * isValid, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n return currPoint + vec3(offset.xy / widthPixels * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n vec2 width = billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width, widthPixels\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.worldPosition = instanceStartPositions;\n geometry.worldPositionAlt = instanceEndPositions;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceLeftStartPositions64xyLow.xy, instanceLeftStartPositions64xyLow.zw, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceLeftStartPositions64xyLow.zw, instanceEndRightPositions64xyLow.xy, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceEndRightPositions64xyLow.xy, instanceEndRightPositions64xyLow.zw, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({startPositions:{size:3,offset:12,transition:P,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{offset:0},instanceStartPositions:{offset:12}}},endPositions:{size:3,transition:P,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0,shaderAttributes:{instanceEndPositions:{offset:0},instanceRightPositions:{offset:12}}},instanceLeftStartPositions64xyLow:{size:4,stride:8,update:this.calculateLeftStartPositions64xyLow,noAlloc:!0},instanceEndRightPositions64xyLow:{size:4,stride:8,update:this.calculateEndRightPositions64xyLow,noAlloc:!0},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:P,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:P,defaultValue:w},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new x({})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,fp64:this.use64bitPositions(),dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),r.dataChanged||a.invalidateAll()}if(r.extensionsChanged){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,f=i.dashJustified,h="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(f),widthScale:u*h,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new p.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.a({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateSegmentTypes",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("segmentTypes")}},{key:"calculateLeftStartPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("startPositions64XyLow"):new Float32Array(4)}},{key:"calculateEndRightPositions64xyLow",value:function(e){var t=this.use64bitPositions();e.constant=!t,e.value=t?this.state.pathTesselator.get("endPositions64XyLow"):new Float32Array(4)}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,o=n.pointLights,s=n.directionalLights,u=i||o&&o.length>0||s&&s.length>0;return u?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,o=void 0===r?[]:r,s={};s["lighting_uAmbientLight.color"]=t?a(t):[0,0,0];return i.forEach(function(e,t){s["lighting_uPointLight[".concat(t,"].color")]=a(e),s["lighting_uPointLight[".concat(t,"].position")]=e.position,s["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),s.lighting_uPointLightCount=i.length,o.forEach(function(e,t){s["lighting_uDirectionalLight[".concat(t,"].color")]=a(e),s["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),s.lighting_uDirectionalLightCount=o.length,s}({ambientLight:i,pointLights:o,directionalLights:s}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var c={pointLights:[],directionalLights:[]},l=!0,f=!1,h=void 0;try{for(var d,v=(t.lights||[])[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;switch(g.type){case"ambient":c.ambientLight=g;break;case"directional":c.directionalLights.push(g);break;case"point":c.pointLights.push(g)}}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}return e({lightSources:c})}return{}},defines:{MAX_LIGHTS:3}},{});function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o});var i=n(57),r={};function a(e){e=Array.isArray(e)?e:[e];var t=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var u=o.value,c=Object(i.b)(u),l=!0,f=!1,h=void 0;try{for(var d,v=c.extensions[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var g=d.value;r[g]=c}}catch(e){f=!0,h=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw h}}}}catch(e){n=!0,a=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}}function o(){return Object.values(r)}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"d",function(){return s});var i="Failed to deduce GL constant from typed array";function r(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(i)}}function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u=24&&2303741511===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint32(16,u),height:e.getUint32(20,u)}}}],["image/jpeg",{test:function(e){return e.byteLength>=2&&65496===e.getUint16(0,u)},getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,u))return null;var t=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),n=t.tableMarkers,i=t.sofMarkers,r=2;for(;r=10&&1195984440===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint16(6,c),height:e.getUint16(8,c)}}}],["image/bmp",{test:function(e){return e.byteLength>=2&&16973===e.getUint16(0,u)},getSize:function(e){return{width:e.getUint32(18,c),height:e.getUint32(22,c)}}}]]);var f="Invalid MIME type. Supported MIME types are: ".concat(Array.from(l.keys()).join(", "));function h(e){var t=g(e),n=!0,i=!1,r=void 0;try{for(var a,o=l.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=Object(s.a)(a.value,2),c=u[0];if((0,u[1].test)(t))return c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(0,v(t=t||h(e)).getSize)(g(e));if(!n)throw new Error("invalid image data for type: ".concat(t));return n}(e,t=t||h(e));return n.mimeType=t,n}function v(e){var t=l.get(e);if(!t)throw new Error(f);return t}function g(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}n.d(t,"a",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"e",function(){return _}),n.d(t,"c",function(){return x});var p=o.a._parseImageNode||"undefined"!=typeof ImageBitmap;function m(e,t){if(o.a._parseImageNode){var n=d(e).mimeType;return o.a._parseImageNode(e,n,t)}return _(e,t)}function y(e){return b.apply(this,arguments)}function b(){return(b=Object(a.a)(r.a.mark(function e(t){var n,i,a,o=arguments;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:{},"undefined"!=typeof Image){e.next=9;break}return e.next=4,fetch(t,n);case 4:return i=e.sent,e.next=7,i.arrayBuffer();case 7:return a=e.sent,e.abrupt("return",m(a,n));case 9:return e.next=11,x(t,n);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _(e,t){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var n=new Blob([new Uint8Array(e)]);return createImageBitmap(n,{imageOrientation:t.imageOrientation||"none",premultiplyAlpha:t.premultiplyAlpha||"default"})}function x(e,t){return w.apply(this,arguments)}function w(){return(w=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return f});var i=n(24),r=n(119),a="void main() {gl_FragColor = vec4(0);}",o="#version 300 es\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}";function s(e,t){t=Array.isArray(t)?t:[t];var n=e.replace(/^\s+/,"").split(/\s+/),r=Object(i.a)(n,3),a=r[0],o=r[1],s=r[2];return t.includes(a)&&o&&s?{qualifier:a,type:o,name:s.split(";")[0]}:null}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=f(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function f(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var i=n(19),r="";function a(e){r=e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)("string"==typeof e),e=r+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function s(e,t){return Object(i.a)("string"==typeof e),e=r+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i,r=n(110).a&&"undefined"!=typeof document,a=r&&"complete"===document.readyState;function o(){return i||(i=r?new Promise(function(e,t){if(r&&"complete"===document.readyState)return a=!0,void e(document);window.onload=function(){a=!0,e(document)}}):Promise.resolve({})),i}function s(e){var t,n=e.canvas,i=e.width,r=e.height,o=e.onError,s=void 0===o?function(){}:o;return"string"==typeof n?(a||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:s}),t}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(56),l=n(30),f=n(124),h=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.b)(e),(s instanceof Promise||"string"==typeof s)&&(s={data:s}),"string"==typeof s.data&&(s=Object.assign({},s,{data:Object(f.b)(s.data)})),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},s,{target:3553})))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e,t){return c.a.isSupported(e,t)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return u});var i=n(104),r=n(30),a=n(19);function o(e,t){return s(e,t)}function s(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return c(e,t)})}function u(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=Object(r.d)(e),i.b)e.luma.caps[t]=c(e,t);return e.luma.caps}function c(e,t){var n=i.b[t];Object(a.a)(n,t);var o,s=Object(r.d)(e)&&n[1]||n[0];if("function"==typeof s)o=s(e);else if(Array.isArray(s)){o=!0;var u=!0,c=!1,l=void 0;try{for(var f,h=s[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;o=o&&Boolean(e.getExtension(d))}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}else"string"==typeof s?o=Boolean(e.getExtension(s)):"boolean"==typeof s?o=s:Object(a.a)(!1);return o}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(4),r=function e(){Object(i.a)(this,e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return O});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(184),v=n(22),g=n(83),p=n(137),m=n(81),y=n(82),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,f=e.rotationX,h=void 0===f?b.rotationX:f,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,g=e.target,p=void 0===g?b.target:g,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minZoom,O=void 0===w?b.minZoom:w,P=e.maxZoom,S=void 0===P?b.maxZoom:P,j=e.startPanPosition,k=e.startTarget,C=e.startRotationX,E=e.startRotationOrbit,A=e.startZoomPosition,T=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:h,rotationOrbit:v,target:p,fovy:x,zoom:y,minZoom:O,maxZoom:S})))._interactiveState={startPanPosition:j,startTarget:k,startRotationX:C,startRotationOrbit:E,startZoomPosition:A,startZoom:T},n.ViewportType=i,n}return h()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;if(!Number.isFinite(r)||!Number.isFinite(a))return this;var o=Object(v.b)(r+180*n,-89.999,89.999),s=(a+180*t)%360;return this._getUpdatedState({rotationX:o,rotationOrbit:s,isRotating:!0})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,f=c.startZoomPosition,h=c.startTarget;Number.isFinite(l)||(l=a,h=u,f=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),g=x(d),p=(o/2-f[0])*(g/v-1),m=(s/2-f[1])*(g/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:h,zoom:d,pixelOffset:[p,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;return e.zoom=i>t?t:i,e.zoom=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(_.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==b()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==b()(n)||null===n)return"".concat(u," changed shallowly");for(var c=Object.keys(t),l=0;l=0&&n.modules.splice(i,1)}return"inject"in t&&(n.inject=Object.assign({},e.inject,t.inject)),n}var T=n(151),M=n(99),L=n(72),I={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return N(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return R(e,t)}},accessor:{validate:function(e,t){var n=z(e);return"function"===n||n===z(t.value)},equal:function(e,t,n){return"function"==typeof t||R(e,t)}},array:{validate:function(e,t){return t.optional&&!e||N(e)},equal:function(e,t,n){return n.compare?R(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function R(e,t){if(e===t)return!0;if(!N(e)||!N(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=Q,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):Object(L.b)(t)?this._resolveAsyncIterable(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(_.a)(void 0!==t),this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){t=n._postProcessValue(e,t),n._setAsyncPropValue(e,t,r);var i=n.layer.props.onDataLoad;"data"===e&&i&&i(t,{propName:e,layer:n.layer})}).catch(function(e){return C.a.error(e)()})}},{key:"_resolveAsyncIterable",value:function(){var e=Z()(X.a.mark(function e(t,n){var i,r,a,o,s,u,c,l,f,h,d,v;return X.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"data"!==t&&this._setPropValue(t,n),(i=this.asyncProps[t]).pendingLoadCount++,r=i.pendingLoadCount,a=[],o=0,s=!0,u=!1,e.prev=8,l=K()(n);case 10:return e.next=12,l.next();case 12:return f=e.sent,s=f.done,e.next=16,f.value;case 16:if(h=e.sent,s){e.next=26;break}d=h,a=this._postProcessValue(t,d,a),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:o,endRow:a.length}]}),o=a.length,this._setAsyncPropValue(t,a,r);case 23:s=!0,e.next=10;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(8),u=!0,c=e.t0;case 32:if(e.prev=32,e.prev=33,s||null==l.return){e.next=37;break}return e.next=37,l.return();case 37:if(e.prev=37,!u){e.next=40;break}throw c;case 40:return e.finish(37);case 41:return e.finish(32);case 42:(v=this.layer.props.onDataLoad)&&v(a,{propName:t,layer:this.layer});case 44:case"end":return e.stop()}},e,this,[[8,28,32,42],[33,,37,41]])}));return function(t,n){return e.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(e,t,n){var i=(this.component?this.component.props:{}).dataTransform;return"data"!==e?t:i?i(t,n):n?n.concat(t):t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),$=0,ee=function(){function e(){o()(this,e),this.props=function(){for(var e=U(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i2&&void 0!==arguments[2]?arguments[2]:{}).url,i=null;return i=(i=i||function(e,t){var n=t.match(Pe),i=n&&n[0];return i&&function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object(xe.b)(s);var u=!0,c=!1,l=void 0;try{for(var f,h=s.extensions[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var d=f.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(e,i)}(t,void 0===n?"":n))||function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if("string"==typeof t){if(je(t,s))return s}else if(t instanceof ArrayBuffer&&ke(t,s))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(t,e)}function je(e,t){return t.testText&&t.testText(e)}function ke(e,t){switch(Array.isArray(t.test)?"array":Object(se.a)(t.test)){case"function":return t.test(e,t);case"string":case"array":return(Array.isArray(t.test)?t.test:[t.test]).some(function(t){return t===function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;if(e.byteLength<=t+n)return"";for(var i=new DataView(e),r="",a=0;a0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setLayerNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this))}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.shouldUpdateState(this._getUpdateParams())}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{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:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(T.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(ne.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(_.a)(Array.isArray(e)),Object(T.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){C.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){C.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(_.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitPositions",value:function(){return this.props.coordinateSystem===g.a.LNGLAT||this.props.coordinateSystem===g.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return C.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(_.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(_.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.props.extensions[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=A(e,o.getShaders.call(this,o))}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return e}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();if(t.dataChanged&&n){var i=t.dataChanged;if(Array.isArray(i)){var r=!0,a=!1,o=void 0;try{for(var s,u=i[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;n.invalidateAll(c)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}else n.invalidateAll()}}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(C.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(C.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;this._setModelAttributes(o,e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"_updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}}},{key:"updateTransition",value:function(){var e=this.getAttributeManager();e&&e.updateTransition(this.context.time)}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.numInstances,i=e.value,r=e.size;if(1!==i[0]){var a=qe.length/r;if(a2?f[d*c+2]:0;a[3*l]=v,a[3*l+1]=g,a[3*l+2]=p,u&&(o[2*l]=Object(O.c)(v),o[2*l+1]=Object(O.c)(g)),s[l]=1,l++}if(h)for(var m=0;m2&&void 0!==arguments[2]?arguments[2]:{},i=h[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function p(e,t){var n=h[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return p(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(f)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x=n(147);n.d(t,"c",function(){return k}),n.d(t,"b",function(){return C}),n.d(t,"a",function(){return E});var w="\n\n".concat(x.a,"\n\n"),O=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),P=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),S={},j="precision highp float;\n\n";function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");P[a][s]=Object.assign(t,{signature:o})}function C(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2);S[e]=S[e]||{},S[e][o]=S[e][o]||{},Object(s.a)(!S[e][o][n],"Module injection already created"),S[e][o][n]={injection:i,order:a}}function E(e,t){var n=t.vs,i=t.fs,r=Object(o.d)(t.modules||[]);return{gl:e,vs:A(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:A(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:T(r),modules:M(r)}}function A(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=t.defines,c=void 0===u?{}:u,l=t.inject,f=void 0===l?{}:l,h=t.prologue,v=void 0===h||h,p=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var b=r===a.b,_=i.split("\n"),k=100,C="",E=i;0===_[0].indexOf("#version ")&&(k=300,C=_[0],E=_.slice(1).join("\n"));var A={};o.forEach(function(e){Object.assign(A,e.getDefines())}),Object.assign(A,c);var T=v?"".concat(C,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(O[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(O[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&g(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&g(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(A),"\n").concat(b?"":j,"\n"):"".concat(C,"\n"),M=!1,L={},I={};for(var R in f){var F="string"==typeof f[R]?{injection:f[R],order:0}:f[R];R.match(/^(v|f)s:/)?"#"===R[3]?I[R]=[F]:L[R]=[F]:I[R]=[F]}var D=!0,N=!1,z=void 0;try{for(var B,U=o[Symbol.iterator]();!(D=(B=U.next()).done);D=!0){var V=B.value;switch(V.name){case"inject":M=!0;break;default:if(p&&V.checkDeprecations(E,p),T+=V.getModuleSource(r,k),S[V.name]){var G=S[V.name][r];for(var W in G)W.match(/^(v|f)s:#/)?(I[W]=I[W]||[],I[W].push(G[W])):(L[W]=L[W]||[],L[W].push(G[W]))}}}}catch(e){N=!0,z=e}finally{try{D||null==U.return||U.return()}finally{if(N)throw z}}return T+=w,T+=function(e,t){var n="",i=P[e];for(var r in i){var a=i[r];if(n+="void ".concat(a.signature," {\n"),a.header&&(n+=" ".concat(a.header)),t[r]){var o=t[r];o.sort(function(e,t){return e.order-t.order});var s=!0,u=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;n+=" ".concat(h.injection,"\n")}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}a.footer&&(n+=" ".concat(a.footer)),n+="}\n"}return n}(r,L),T+=E,T=Object(x.c)(T,r,I,M)}function T(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function M(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.b)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(134),c=n(22),l=function(e,t){if(!e)throw new Error(t)},f=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t=0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,h=void 0===l?d:l,v=e.wrapLongitude,p=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||f},g({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:h,wrapLongitude:p}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(29),u=n(201),c=n(18),l={position:[0,0,0],lookAt:[0,0,0],up:[0,0,1],rotationX:0,rotationY:0,fov:50,near:1,far:100},f=function(){function e(t){r()(this,e);var n=t.width,i=t.height,a=t.position,o=void 0===a?l.position:a;Object(c.a)(Number.isFinite(n),"`width` must be supplied"),Object(c.a)(Number.isFinite(i),"`height` must be supplied"),this._viewportProps=this._applyConstraints(Object.assign({},t,{position:new s.a(o)}))}return o()(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getDirection",value:function(){return new u.a({bearing:this._viewportProps.bearing,pitch:this._viewportProps.pitch}).toVector3().normalize()}},{key:"getDirectionFromBearing",value:function(e){return new u.a({bearing:e,pitch:90}).toVector3().normalize()}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}()},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function i(e){for(var t=e.data,n=e.getIndex,i=e.dataRange,r=e.replace,a=i.startRow,o=void 0===a?0:a,s=i.endRow,u=void 0===s?1/0:s,c=t.length,l=c,f=c,h=0;hh&&d>=o&&(l=h),d>=u){f=h;break}}for(var v=l,g=f-l!==r.length,p=g&&t.slice(f),m=0;m=t.min)}},array:{validate:function(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function c(e){var t=l(e);return"object"===t?e?"type"in e?Object.assign({},e,u[e.type]):"value"in e?(t=l(e.value),Object.assign({type:t},e,u[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},u[t])}function l(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":Object(s.a)(e)}n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var f=function(){function e(t){var n=t.name,r=t.vs,a=t.fs,s=t.dependencies,u=void 0===s?[]:s,l=t.uniforms,f=t.getUniforms,h=t.deprecations,d=void 0===h?[]:h,v=t.defines,g=void 0===v?{}:v,p=t.vertexShader,m=t.fragmentShader;Object(i.a)(this,e),Object(o.a)("string"==typeof n),this.name=n,this.vs=r||p,this.fs=a||m,this.getModuleUniforms=f,this.dependencies=u,this.deprecations=this._parseDeprecationDefinitions(d),this.defines=g,l&&(this.uniforms=function(e){var t={};for(var n in e){var i=c(e[n]);t[n]=i}return t}(l))}return Object(r.a)(e,[{key:"getModuleSource",value:function(e,t){var n;switch(e){case"vs":n=a(this.vs||"",t,!0);break;case"fs":n=a(this.fs||"",t,!1);break;default:Object(o.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase(),"\n").concat(n,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,t){this.deprecations.forEach(function(n){n.regex.test(e)&&(n.deprecated?t.deprecated(n.old,n.new)():t.removed(n.old,n.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=this.uniforms;for(var i in n){var r=n[i];i in e&&!r.private?(r.validate&&Object(o.a)(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function h(e){if(!e.normalized&&(e.normalized=!0,e.uniforms&&!e.getUniforms)){var t=new f(e);e.getUniforms=t.getUniforms.bind(t)}return e}},function(e,t,n){"use strict";n.d(t,"b",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"a",function(){return g});var i=n(230),r=n.n(i);function a(e){if(e=e&&e.positions||e,!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new Error("invalid polygon")}function o(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=h(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return h(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var g,p=e[Symbol.iterator]();!(l=(g=p.next()).done);l=!0){c+=f(g.value)}}catch(e){d=!0,v=e}finally{try{l||null==p.return||p.return()}finally{if(d)throw v}}return c}return f(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,f=s.holeIndices;if(f){for(var h=0,v=0;v<=f.length;v++)h=l(i,h,u,t,f[v-1],f[v]),r.push(h);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var g=0,p=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(p=(b=_.next()).done);p=!0){g=c(i,g,b.value,t),r.push(g)}}catch(e){m=!0,y=e}finally{try{p||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function g(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(97),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return h});function l(e){return Boolean(e&&2===e._version)}var f=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),h={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return p}),n.d(t,"c",function(){return m});var i=n(5),r=n(10),a=n(9),o=n(11),s=n(4),u=n(29),c=n(67),l=[255,255,255],f=[0,0,1],h=[0,0,-1],d=[0,0,1],v=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e),this.id=t.id||Object(c.c)("light");var n=t.color,i=void 0===n?l:n;this.color=i;var r=t.intensity,a=void 0===r?1:r;this.intensity=a},g=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="ambient",e}return Object(o.a)(t,e),t}(v),p=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="directional";var i=n.direction,o=void 0===i?h:i;return e.direction=new u.a(o).normalize().toArray(),e}return Object(o.a)(t,e),t}(v),m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="point";var i=n.position,o=void 0===i?d:i;return e.position=o,e.attenuation=e._getAttenuation(n),e}return Object(o.a)(t,e),Object(i.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:f}}]),t}(v)},function(e,t,n){"use strict";var i,r=n(0),a=n(71),o=n(119);n.d(t,"a",function(){return u}),n.d(t,"c",function(){return h}),n.d(t,"b",function(){return d});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u="__LUMA_INJECT_DECLARATIONS__",c=/void main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,f=[];function h(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),f.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(65),r=n(24),a=n(25);function o(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var s={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(a.a)(t))},blendEquation:function(e,t){t=o(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(a.a)(t))},blendFunc:function(e,t){t=o(t)&&2===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,e.blendFuncSeparate.apply(e,Object(a.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(a.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(a.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(a.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(a.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(a.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(a.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=o(t)?t:[t,t],i=Object(r.a)(n,2),a=i[0],s=i[1];e.stencilMaskSeparate(1028,a),e.stencilMaskSeparate(1029,s)},stencilFunc:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilFuncSeparate(1028,s,u,c),e.stencilFuncSeparate(1029,l,f,h)},stencilOp:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],f=i[4],h=i[5];e.stencilOpSeparate(1028,s,u,c),e.stencilOpSeparate(1029,l,f,h)},viewport:function(e,t){return e.viewport.apply(e,Object(a.a)(t))}};function u(e,t){for(var n in Object(i.f)(e,t),t){var r=s[n];r&&r(e,t[n],n)}}n.d(t,"a",function(){return u})},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(126),v=n(109),g=n(146),p=n(113),m=n(103),y=n(64),b=n(29),_=n(8),x=n.n(_),w=n(13),O=n.n(w),P=n(102),S=n(95),j=n(60),k=n(70),C=function(e){function t(e,n){var i,a,o;return r()(this,t),(o=u()(this,l()(t).call(this,e,n))).shadowMap=new d.a(e,{width:1,height:1,parameters:(i={},x()(i,10241,9729),x()(i,10240,9729),x()(i,10242,33071),x()(i,10243,33071),i)}),o.depthBuffer=new S.a(e,{format:33189,width:1,height:1}),o.fbo=new j.a(e,{id:"shadowmap",width:1,height:1,attachments:(a={},x()(a,36064,o.shadowMap),x()(a,36096,o.depthBuffer),a)}),o}return h()(t,e),o()(t,[{key:"render",value:function(e){var n=this,i=this.fbo;Object(k.a)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var r=e.viewports[0],a=r.width*n.props.pixelRatio,o=r.height*n.props.pixelRatio;a===i.width&&o===i.height||i.resize({width:a,height:o}),O()(l()(t.prototype),"render",n).call(n,Object.assign(e,{outputBuffer:i}))})}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,drawToShadowMap:!0,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{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)}}]),t}(P.a),E=n(163);n.d(t,"a",function(){return L});var A={color:[255,255,255],intensity:1},T=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],M=[0,0,0,200/255],L=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],n.shadowColor=M,n.shadowPasses=[],n.dummyShadowMaps=[],n.shadow=!1,e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n._applyDefaultLights(),n.directionalLights.some(function(e){return e.shadow})&&(n.shadow=!0,n._addShadowModule()),n}return h()(t,e),o()(t,[{key:"prepare",value:function(e,t){var n=t.layers,i=t.viewports,r=t.onViewportActive,a=t.views,o=t.pixelRatio;if(!this.shadow)return{};var s=this._createLightMatrix();0===this.shadowPasses.length&&this._createShadowPasses(e,o),0===this.dummyShadowMaps.length&&this._createDummyShadowMaps(e);for(var u=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return h()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.a)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new g.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(p.a)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(178).a),y=n(140);n.d(t,"a",function(){return b});var b=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(y.b)(e),n.module=e,n}return h()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=w(t),a=new m(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=w(t,r),s="".concat(n,"-").concat(a);return new m(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return _(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return x(i)}return null}},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return h});var i=n(16),r=n.n(i),a=n(31),o=n(136),s=n(37),u=n(40),c=n(27);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),f=r()(l,2);return[f[0],f[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function f(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,f=t.offsetMode,h=r()(e,3),d=h[0],v=h[1],g=h[2];if(i){var p=s.n([],[d,v,g,1],i),m=r()(p,3);d=m[0],v=m[1],g=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,g],n,f);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],g+(u[2]||0)],n,f);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,g]),n,f);case a.a.IDENTITY:default:return n.projectPosition([d,v,g])}}function h(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,h=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!0}),g=l(s,i,!0);return u.m(v,v,g),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return f(e,{viewport:i,modelMatrix:c,coordinateSystem:h,coordinateOrigin:d,offsetMode:!1})}}},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.overAlloc,i=void 0===n?2:n,a=t.poolSize,o=void 0===a?100:a;r()(this,e),this.overAlloc=i,this.poolSize=o,this._pool=[]}return o()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=void 0===i?1:i,a=n.type,o=n.padding,s=void 0===o?0:o,u=n.copy,c=void 0!==u&&u,l=a||e&&e.constructor||Float32Array,f=t*r+s;if(ArrayBuffer.isView(e)){if(f<=e.length)return e;if(f*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new l(e.buffer,0,f)}var h=this._allocate(l,f);return e&&c?h.set(e):h.fill(0,0,4),this._release(e),h}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,t){t=Math.max(Math.ceil(t*this.overAlloc),1);var n=this._pool,i=e.BYTES_PER_ELEMENT*t,r=n.findIndex(function(e){return e.byteLength>=i});return r>=0?new e(n.splice(r,1)[0],0,t):new e(t)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.poolSize&&t.shift()}}}]),e}();t.a=new s},function(e,t){function n(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise(function(r,a){var o=e.apply(t,i);function s(e){n(o,r,a,s,u,"next",e)}function u(e){n(o,r,a,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(32),c=n(24),l=n(55),f=n(27),h=n(20),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();h.g(c,c,this.projectionMatrix),h.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var f=Object(l.a)();h.n(f,f,[this.width/2,-this.height/2,1]),h.o(f,f,[1,-1,0]),h.g(f,f,this.viewProjectionMatrix);var v=h.e(Object(l.a)(),f);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=f,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&h.b(t.projectionMatrix,this.projectionMatrix)&&h.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(f.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,h=r&&r*this.pixelsPerMeter,d=Object(f.h)([o,l,u],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),g=Object(c.a)(v,3),p=g[0],m=g[1],y=g[2];return Number.isFinite(u)?[p,m,y]:Number.isFinite(r)?[p,m,r]:[p,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),g=n(200),p=n(47);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,h=n.longitude,d=void 0===h?0:h,v=n.zoom,g=void 0===v?0:v,p=n.pitch,m=void 0===p?0:p,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,O=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(f.l)(g);x=Math.max(.75,x);var S=Object(f.g)([d,l],P);S[2]=0;var j=Object(f.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:O||1.01}),k=Object(f.f)({height:s,center:S,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:k,projectionMatrix:j}))).latitude=l,e.longitude=d,e.zoom=g,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=P,e.center=S,e.pixelsPerMeter=Object(f.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(f.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(f.h)(n,this.pixelUnprojectionMatrix),r=Object(f.g)(t,this.scale),a=p.a([],r,p.e([],i)),o=p.a([],this.center,a);return Object(f.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(g.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,,function(e,t,n){"use strict";(function(e){var t=n(97),i=n(143);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,f=e.getExtension(r),h=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(f&&"function"==typeof f[n]?i=function(){return f[n].apply(f,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return u({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},Object(a.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=s(t),r=o(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}}))},function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return l});var i=n(0),r=n(126),a=n(160),o=n(161),s=n(60),u=n(19);function c(e,t){Object(u.a)(e instanceof r.a||e instanceof a.a||e instanceof o.a);var n=e.constructor,i=e.gl,s=e.width,c=e.height,l=e.format,f=e.type,h=e.dataFormat,d=e.border,v=e.mipmaps;return new n(i,Object.assign({width:s,height:c,format:l,type:f,dataFormat:h,border:d,mipmaps:v},t))}function l(e,t){var n=e.gl,r=e.width,a=e.height,o=e.id;return new s.a(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(i.a)({},36064,e)}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(50),r=n.n(i),a=n(116),o=n(4),s=n(5),u=n(10),c=n(9),l=n(32),f=n(11),h=n(56),d=n(30),v=n(26),g=[34069,34070,34071,34072,34073,34074],p=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,t),Object(d.b)(e),(n=Object(u.a)(this,Object(c.a)(t).call(this,e,Object.assign({},i,{target:34067})))).initialize(i),Object.seal(Object(l.a)(n)),n}return Object(f.a)(t,e),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(a.a)(r.a.mark(function e(t){var n,i,a,o,s,u,c,l,f,h,d,p,m,y=this;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,a=t.pixels,o=t.data,s=t.border,u=void 0===s?0:s,c=t.format,l=void 0===c?6408:c,f=t.type,h=void 0===f?5121:f,d=this.gl,p=a||o,e.next=5,Promise.all(g.map(function(e){var t=p[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:m=e.sent,this.bind(),g.forEach(function(e,t){m[t].length>1&&!1!==y.opts.mipmaps&&v.a.warn("".concat(y.id," has mipmap and multiple LODs."))(),m[t].forEach(function(t,r){n&&i?d.texImage2D(e,r,l,n,i,u,l,h,t):d.texImage2D(e,r,l,l,h,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,f=e.type,h=void 0===f?5121:f,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,h,v):d.texImage2D(n,0,l,l,h,v),this}}]),t}(h.a);p.FACES=g},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(70),l=n(30),f=n(56),h=n(98),d=n(43),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.a)(e),s=Object.assign({depth:1},s,{target:32879,unpackFlipY:!1}),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(s.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,l=void 0===u?1:u,f=e.border,v=void 0===f?0:f,g=e.format,p=e.type,m=void 0===p?5121:p,y=e.offset,b=void 0===y?0:y,_=e.data,x=e.parameters,w=void 0===x?{}:x;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(c.a)(this.gl,w,function(){ArrayBuffer.isView(_)&&t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,_),_ instanceof d.a&&(t.gl.bindBuffer(35052,_.handle),t.gl.texImage3D(t.target,i,a,o,s,l,v,g,m,b))}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var O=h.a[this.dataFormat]||4,P=h.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*O*P,"Texture")}return this.loaded=!0,this}}]),t}(f.a)},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(77),r=n.n(i),a=n(16),o=n.n(a),s=n(132),u=n(42),c=n(64),l=n(29),f=n(94),h=n(27),d=Object(f.a)(function(e){var t=e.viewport,n=e.center;return new c.a(t.viewProjectionMatrix).invert().transformVector4(n)}),v=Object(f.a)(function(e){var t=e.viewport,n=e.shadowMatrices,i=[],a=t.pixelUnprojectionMatrix,s=[[0,0],[t.width,0],[0,t.height],[t.width,t.height],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(function(e){return function(e,t){var n=o()(e,3),i=n[0],r=n[1],a=n[2],s=Object(h.h)([i,r,a],t);if(Number.isFinite(a))return s;return[s[0],s[1],0]}(e,a)}),u=!0,f=!1,d=void 0;try{for(var v,g=function(){var e=v.value,n=e.clone().translate(new l.a(t.center).negate()),a=s.map(function(e){return n.transformVector3(e)}),o=(new c.a).ortho({left:Math.min.apply(Math,r()(a.map(function(e){return e[0]}))),right:Math.max.apply(Math,r()(a.map(function(e){return e[0]}))),bottom:Math.min.apply(Math,r()(a.map(function(e){return e[1]}))),top:Math.max.apply(Math,r()(a.map(function(e){return e[1]}))),near:Math.min.apply(Math,r()(a.map(function(e){return-e[2]}))),far:Math.max.apply(Math,r()(a.map(function(e){return-e[2]})))});i.push(o.multiplyRight(e))},p=n[Symbol.iterator]();!(u=(v=p.next()).done);u=!0)g()}catch(e){f=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(f)throw d}}return i});Object(s.b)("shadow",{hook:"vs:DECKGL_FILTER_GL_POSITION",injection:"\nposition = shadow_setVertexPosition(geometry.position);\n "}),Object(s.b)("shadow",{hook:"fs:DECKGL_FILTER_COLOR",injection:"\ncolor = shadow_filterShadowColor(color);\n "});var g=[0,0,0,1],p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];t.a={name:"shadow",dependencies:["project"],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap[max_lights];\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[i], shadow_uShadowMap[i]) * shadow_uColor.a / shadow_uLightCount;\n }\n }\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){var n={},i=e.shadowEnabled;return(void 0===i||i)&&e.shadowMatrices&&e.shadowMatrices.length>0?Object.assign(n,function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||g,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=d({viewport:e.viewport,center:t.project_uCenter}),r=[],a=v({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice(),o=0;o0?n["shadow_uShadowMap[".concat(f,"]")]=e.shadowMaps[f]:n["shadow_uShadowMap[".concat(f,"]")]=e.dummyShadowMaps[0];return n}(e,t)):Object.assign(n,{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}),n}return{}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(165),g=n(172),p=function(e){function t(e){return r()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:v.a})))}return h()(t,e),o()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.a})}}]),t}(d.a);p.displayName="MapView"},function(e,t,n){"use strict";n.d(t,"a",function(){return O});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(87),p=n.n(g),m=n(45),y=n(27),b=n(200),_=n(47),x=n(18),w="Illegal argument to WebMercatorViewport",O=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,f=n.pitch,d=void 0===f?0:f,v=n.bearing,g=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,O=void 0!==w&&w,P=n.width,S=n.height,j=n.altitude,k=void 0===j?1.5:j;P=P||1,S=S||1,k=Math.max(.75,k);var C=Object(y.e)({width:P,height:S,pitch:d,altitude:k,nearZMultiplier:b,farZMultiplier:x}),E=C.fov,A=C.aspect,T=C.focalDistance,M=C.near,L=C.far,I=Object(y.f)({height:S,pitch:d,bearing:g,altitude:k}),R=Object.assign({},n,{width:P,height:S,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:O,fovyRadians:E,aspect:A,orthographicFocalDistance:T,near:M,far:L});return(e=l()(this,h()(t).call(this,R))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=g,e.altitude=k,e.orthographic=O,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(p()(p()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(p()(p()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(p()(p()(e))),Object.freeze(p()(p()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],f=i*u[1]*c[1];return 2===e.length?[l,f]:[l,f,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);O.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(77),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(18),l=n(190),f=n(41),h=n.n(f),d=n(130),v=n(99),g=n(15),p=n(75),m=n(267),y=n(45),b=n(69),_=Object.seal({layerManager:null,deck:null,gl:null,time:-1,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,mousePosition:null,userData:{}}),x=function(e){return e instanceof d.a?"".concat(e):e?"invalid":"null"},w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,r=n.stats,a=n.viewport,s=void 0===a?null:a;o()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},_,{layerManager:this,deck:i,gl:t,shaderCache:t&&new l.a({gl:t,_cachePrograms:!0}),stats:r||new m.a({id:"deck.gl"}),viewport:s||new y.a({id:"DEFAULT-INITIAL-VIEWPORT"})}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(b.e)(this._initSeer),Object(b.c)(this._editSeer)}return u()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(e===this.lastRenderedLayers)return g.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"time"in e&&(this.context.time=e.time);var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(r()(this.lastRenderedLayers)))}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){g.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(s)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(c.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?g.a.warn("Multiple old layers with same id ".concat(x(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],f=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),h=this._finalizeOldLayers(i);return this._needsUpdate=!1,{error:f||h,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var f=n[l.id];null===f&&g.a.warn("Multiple new layers with same id ".concat(x(l)))(),n[l.id]=null;var h=null;try{if(this._debug&&f!==l&&l.validateProps(),f){this._transferLayerState(f,l);var d=this._updateLayer(l);r=r||d,Object(b.g)(l)}else{var v=this._initializeLayer(l);r=r||v,Object(b.b)(l)}i.push(l),h=l.isComposite&&l.getSubLayers()}catch(v){g.a.warn("error during matching of ".concat(x(l)),v)(),r=r||v}if(h){var p=this._updateSublayersRecursively({newLayers:h,oldLayerMap:n,generatedLayers:i});r=r||p}}}catch(v){o=!0,s=v}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){g.a.log(2,"initializing ".concat(x(e)))();var t=null;try{e._initialize(),e.lifecycle=v.a.INITIALIZED}catch(n){g.a.warn("error while initializing ".concat(x(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=v.a.MATCHED,t!==e?(g.a.log(4,"matched ".concat(x(t)),e,"->",t)(),e.lifecycle=v.a.AWAITING_GC):g.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){g.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){g.a.warn("error during update of ".concat(x(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(c.a)(e.lifecycle!==v.a.AWAITING_FINALIZATION),e.lifecycle=v.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(x(e)));try{e._finalize()}catch(n){g.a.warn("error during finalization of ".concat(x(e)),n)(),t=n}return e.lifecycle=v.a.FINALIZED,g.a.log(2,"finalizing ".concat(x(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(b.b)(e),Object(b.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(b.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(83),p=n(137),m=n(22),y=n(29);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,f=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),g=e.startPanPosition,p=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,h()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:f,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:g,startRotateCenter:p,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),f=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return f/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(p.a),x=function(e){function t(e){return o()(this,t),l()(this,h()(t).call(this,_,e))}return v()(t,e),t}(g.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(83),v=n(129),g=n(81),p=n(82),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new g.a(["target","zoom"]),transitionInterruption:p.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return h()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(16),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(13),v=n.n(d),g=n(7),p=n.n(g),m=n(43),y=n(18),b=n(72),_=n(75),x=[],w=[[0,1/0]];var O=n(15),P=n(127),S=n(104),j=n(59),k=n(67),C=n(26),E=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(k.c)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(P.b)(t,S.a.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a),this._setAccessor(e);for(var o=this.elementOffset,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=l()(this,h()(t).call(this,e,i));var a=i.transition,o=void 0!==a&&a,s=i.noAlloc,u=void 0!==s&&s,c=i.update,f=void 0===c?null:c,d=i.accessor,v=void 0===d?null:d,g=i.bufferLayout,p=void 0===g?null:g,m=i.defaultValue,y=void 0===m?[0,0,0,0]:m;if(y=Array.isArray(y)?y:[y],n.shaderAttributes={},n.hasShaderAttributes=!1,i.shaderAttributes){var b=i.shaderAttributes;for(var _ in b){var x=b[_];n.shaderAttributes[_]=new t(n.gl,Object.assign({offset:n.offset,stride:n.stride,normalized:n.normalized},x,{id:_,constant:x.constant||!1,isIndexed:x.isIndexed||x.elements,size:(x.elements?1:x.size)||n.size,value:x.value||null,divisor:x.instanced||x.divisor||n.divisor,buffer:n.getBuffer(),noAlloc:!0})),n.hasShaderAttributes=!0}}return Object.assign(n.userData,T,i,{transition:o,noAlloc:u,update:f||v&&n._standardAccessor,accessor:v,defaultValue:y,bufferLayout:p}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return p()(t,e),o()(t,[{key:"delete",value:function(){v()(h()(t.prototype),"delete",this).call(this),A.a.release(this.userData.allocatedValue)}},{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};return this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this,e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return Number.isFinite(r)&&(r={duration:r}),r&&r.duration>0?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===w)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=w}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=x}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;if(t.update){Object(y.a)(Number.isFinite(e));var n=Math.max(e,1),i=L(this.type||5126),r=t.allocatedValue,a=t.updateRanges!==w;return this.constant=!1,this.value=A.a.allocate(r,n,{size:this.size,type:i,padding:this.elementOffset,copy:a}),this.buffer&&this.buffer.byteLength=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return n+e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(E);function L(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce type from array")}}var I=n(224);function R(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=r))&&t instanceof m.a){var l=new Float32Array(r),f=t.getData({}),h=n.size,d=n.constant,v=d?n.getValue():n.getBuffer().getData({}),g=d?function(e,t){return c(v,t)}:function(e,t){return c(v.subarray(e,e+h),t)};!function(e){var t=e.source,n=e.target,i=e.size,r=e.offset,a=void 0===r?0:r,o=e.getData,s=e.sourceLayout,u=e.targetLayout;if(!Array.isArray(u))return R({source:t,target:n,getData:o}),n;for(var c=a,l=a,f=o&&function(e,t){return o(e+l,t)},h=Math.min(s.length,u.length),d=0;d0),this.needsRedraw=!0;var n=Object.assign({},U,t);e.start(Object.assign({},this._getNextTransitionStates(e,t),n))}}]),e}();n.d(t,"a",function(){return H});function G(){}var W={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;O.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;W.savedMessages=[],W.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;W.savedMessages&&W.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-W.timeStart),a="".concat(r,"ms");O.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=W.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var f=c.value;O.a.log(t,f)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}O.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),W.savedMessages=null}},H=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new V(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(W.onLog=t||G),void 0!==n&&(W.onUpdateStart=n||G),void 0!==i&&(W.onUpdate=i||G),void 0!==r&&(W.onUpdateEnd=r||G)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,f=!1;for(var h in W.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[h];d.setExternalBuffer(u[h]||t.attributes&&t.attributes[h])||d.setGenericValue(o[d.getAccessor()])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}f&&W.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&O.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new M(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),O.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&W.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);W.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(192),b=n(93),_=n(229),x=n.n(_),w=n(15),O=n(67),P=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(O.c)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;w.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),f=new Float32Array(3*u),h=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:j},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:j},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=r.extensionsChanged;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new P({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,transition:!0,accessor:"getPosition"},instancePositions64xyLow:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,f=i.lineWidthMinPixels,h=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:f,lineWidthMaxPixels:h})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);w.layerName="ScatterplotLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),f=n(3),h=n.n(f),d=n(7),v=n.n(d),g=n(22),p=n(83),m=n(137),y=n(154),b=n(55),_=85.05113,x=-85.05113;var w=n(18),O=n(81),P=n(82);n.d(t,"a",function(){return A});var S={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new O.a,transitionInterruption:P.a.BREAK},j={transitionDuration:0},k={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},C={pitch:0,bearing:0,altitude:1.5},E=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,f=void 0===c?C.bearing:c,d=n.pitch,v=void 0===d?C.pitch:d,g=n.altitude,p=void 0===g?C.altitude:g,m=n.maxZoom,y=void 0===m?k.maxZoom:m,b=n.minZoom,_=void 0===b?k.minZoom:b,x=n.maxPitch,O=void 0===x?k.maxPitch:x,P=n.minPitch,S=void 0===P?k.minPitch:P,j=n.startPanLngLat,E=n.startZoomLngLat,A=n.startBearing,T=n.startPitch,M=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,h()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:f,pitch:v,altitude:p,maxZoom:y,minZoom:_,maxPitch:O,minPitch:S})))._interactiveState={startPanLngLat:j,startZoomLngLat:E,startBearing:A,startPitch:T,startZoom:M},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),f=l[0],h=l[1];return this._getUpdatedState({zoom:u,longitude:f,latitude:h})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(g.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(g.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),f=l.project([i,_])[1],h=l.project([i,x])[1],d=0;return h-f0?d=f:h0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),A=function(e){function t(e){var n;return o()(this,t),(n=l()(this,h()(t).call(this,E,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return S}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,f=0;n>0?Math.abs(c-o)>5&&(f=n/(o-c)*1.2):n<0&&o>5&&(f=1-a/o),f=Math.min(1,Math.max(-1,f));var h=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:f});return this.updateViewport(h,j,{isDragging:!0,isRotating:!0})}}]),t}(p.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(15),u=n(6),c=n.n(u),l=n(3),f=n.n(l),h=n(13),d=n.n(h),v=n(7),g=n.n(v),p=function(e){function t(){return r()(this,t),c()(this,f()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(f()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(102).a),m=n(182),y=n(183),b=n(150),_=n(60);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new p(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,f=e.effects,h=void 0===f?[]:f,d=e.pass,v=e.stats,g=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,p=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:h,pixelRatio:this.pixelRatio}),m=this.lastPostProcessEffect?this.screenBuffer:_.a.getDefaultFramebuffer(this.gl),y=g.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:h,effectProps:p,outputBuffer:m});this.postRender(h),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.a(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.a(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.a.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,f="";f+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(f+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,f)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(34),r=n(175);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(89))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(34);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(89))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(127),f=n(104),h=n(30),d=n(19),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(h.d)(e),i=Object(l.c)(e,f.a.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Object(d.a)(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(s.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(22),u=n(18),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(35),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(102),p=n(70),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):h()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,f=s.height,h=e.redrawReason,d=void 0===h?"":h,v=this.gl;return Object(p.a)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,f],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(g.a)},function(e,t,n){"use strict";function i(e){return e&&"undefined"!=typeof window?window.devicePixelRatio:1}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(133),c=n(47),l=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,r=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,r=void 0===n?16:n,a=t.size,o=void 0===a?1:a,s="[",u=0;u0&&(s+=",".concat(u%o==0?" ":"")),s+=i(e[u],t);var c=e.length>r?"...":"]";return"".concat(s).concat(c)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return r?"0":"0.";if(r)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var a=e.toPrecision(2);return a.indexOf(".0")===a.length-2?a.slice(0,-1):a}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var i=n(115),r="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var a={name:"gouraud-lighting",dependencies:[i.a],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:u},o={name:"phong-lighting",dependencies:[i.a],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:u},s={};function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor.map(function(e){return e/255}),t}(t):{lighting_uEnabled:!1}}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(4),r=n(5),a=n(61),o=n(197),s=n(19),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Object(s.a)(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new a.c(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new a.a(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Object(s.a)(this._compareContexts(e,this.gl)),Object(s.a)("string"==typeof t.vs),Object(s.a)("string"==typeof t.fs),Object(s.a)("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new o.a(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(36),r=n(4),a=n(10),o=n(9),s=n(11),u=n(58),c=n(67),l=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]),f=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]),h=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]),d=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]),v={POSITION:{size:3,value:new Float32Array(f)},NORMAL:{size:3,value:new Float32Array(h)},TEXCOORD_0:{size:2,value:new Float32Array(d)}},g=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.id,s=void 0===n?Object(c.c)("cube-geometry"):n;return Object(a.a)(this,Object(o.a)(t).call(this,Object(i.a)({},e,{id:s,indices:{size:1,value:new Uint16Array(l)},attributes:Object(i.a)({},v,e.attributes)})))}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(11),u=n(128),c={ambient:.35,diffuse:.6,shininess:32,specularColor:[30,30,30]},l=function(e){function t(e){var n;return Object(i.a)(this,t),n=Object(r.a)(this,Object(a.a)(t).call(this,e)),e=Object.assign({},c,e),Object.assign(Object(o.a)(n),e),n}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(130),p=n(15),m=n(75),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){h()(l()(t.prototype),"setState",this).call(this,e),this.setLayerNeedsUpdate()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?Object.assign(t,{object:n.__source.object,index:n.__source.index}):t}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerRow",value:function(e,t,n){return e.__source={parent:this,object:t,index:n},e}},{key:"getSubLayerAccessor",value:function(e){if("function"==typeof e){var t={data:this.props.data,target:[]};return function(n,i){return n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,i)}}return e}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,f=t.coordinateOrigin,h=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,g=t.extensions,p=t._subLayerProps,m={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:v,extensions:g};if(e){var y=p&&p[e.id],b=y&&y.updateTriggers;Object.assign(m,e,y,{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers,b)})}var _=!0,x=!1,w=void 0;try{for(var O,P=g[Symbol.iterator]();!(_=(O=P.next()).done);_=!0){var S=O.value,j=S.getSubLayerProps.call(this,S);Object.assign(m,j,{updateTriggers:Object.assign(m.updateTriggers,j.updateTriggers)})}}catch(e){x=!0,w=e}finally{try{_||null==P.return||P.return()}finally{if(x)throw w}}return m}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?p.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,p.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(g.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(35),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(166),l=n(18),f=n(105),h=n(53),d=n(45),v=n(15),g=n(75),p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return u()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i={x:e[0],y:e[1]},r=n.length-1;r>=0;--r){var a=n[r];if(a.containsPixel(i)){var o=e.slice();return o[0]-=a.x,o[1]-=a.y,a.unproject(o,t)}}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(l.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(g.b)(e,{filter:Boolean}).map(function(e){return e instanceof d.a?new h.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(f.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):v.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),m=n(164),y=n(149),b=new y.a,_=function(){function e(){o()(this,e),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return u()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(f.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e,this._createInternalEffects()}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=!0,o=!1,s=void 0;try{for(var u,c=this._internalEffects[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){u.value.cleanup()}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some(function(e){return e instanceof y.a})||this._internalEffects.push(b)}}]),e}(),x=n(103),w=n(173),O=n(60),P=n(80),S=n(183),j=n(182),k={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function C(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,f=a*a,h=-1,d=0,g=0;gf)d+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=f&&(f=_,h=d)}d+=4}}if(h>=0){var x=t[h+3]-1,w=t.slice(h,h+4),O=n[x];if(O){var P=O.decodePickingColor(w);return{pickedColor:w,pickedLayer:O,pickedObjectIndex:P}}v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return k}function E(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,f=t.pickedColor,h=t.pickedLayer,d=t.pickedObjectIndex,v=h?[h]:[];if("hover"===i){var g=n.index,p=n.layerId,m=h&&h.props.id;if(m!==p||d!==g){if(m!==p){var y=r.find(function(e){return e.props.id===p});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===h&&(t.color=f,t.index=d,t.picked=!0),t=A({layer:e,info:t,mode:i}),e===h&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&h===e?f:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function A(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var T=function(){function e(t){o()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new j.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return u()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(S.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,f=e.event,h=void 0===f?null:f;this.pickingEvent=h;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new O.a(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,f=this.pixelRatio,h=Math.round(i*f),d=Math.round(this.gl.canvas.height-(r+1)*f),v=Math.round(a*f),g=this.pickingFBO,p=g.width,m=g.height,y=this.getPickingRect({deviceX:h,deviceY:d,deviceRadius:v,deviceWidth:p,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:g,redrawReason:s}),layers:t}),m=new Map;return p.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=A({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(l.a)(r),Object(l.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(l.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,u=r.y,c=r.width,f=r.height,h=new Uint8Array(c*f*4);return Object(P.e)(o,{sourceX:s,sourceY:u,sourceWidth:c,sourceHeight:f,target:h}),h}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight,o=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-o,c=Math.min(a,n+i+1)-s;return u<=0||c<=0?null:{x:o,y:s,width:u,height:c}}},{key:"callLayerPickingCallbacks",value:function(e,t){var n=[],i=this.pickingEvent;return e.forEach(function(e){if(e.layer){var r=!1;switch(t){case"hover":r=e.layer.onHover(e,i);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}}),n}}]),e}(),M=n(196),L=n(204),I=n(91),R=n(90),F=n(148),D=n(107),N=n(267),z=n(24),B=n(4),U=n(5),V=1,G=2,W=4,H={mousedown:V,mousemove:G,mouseup:W};var X,q,Z=null;"undefined"!=typeof document&&(Z=n(256),X=Z.PointerEventInput,q=X.prototype.handler,X.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&G&&0===e.which&&(t=W),this.pressed&&(t&W&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var Y=Z;var K=Y?[[Y.Rotate,{enable:!1}],[Y.Pinch,{enable:!1}],[Y.Swipe,{enable:!1}],[Y.Pan,{threshold:0,enable:!1}],[Y.Press,{enable:!1}],[Y.Tap,{event:"doubletap",taps:2,enable:!1}],[Y.Tap,{event:"anytap",enable:!1}],[Y.Tap,{enable:!1}]]:null,Q={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},J={doubletap:["tap"]},$={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ee=["keydown","keyup"],te=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],ne=["wheel","mousewheel","DOMMouseScroll"],ie={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",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"},re={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ae=n(120),oe=-1!==ae.b.indexOf("firefox"),se=ne,ue=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=se.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!ae.a&&{passive:!1})})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;ae.c.WheelEvent&&(oe&&e.deltaMode===ae.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=ae.c.devicePixelRatio),e.deltaMode===ae.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ce=te,le=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=ce.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),fe=ee,he=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=fe.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(U.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),de=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(B.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(U.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),ve=1,ge=2,pe=4,me={pointerdown:ve,pointermove:ge,pointerup:pe,mousedown:ve,mousemove:ge,mouseup:pe},ye=1,be=2,_e=3,xe=0,we=1,Oe=2,Pe=1,Se=2,je=4;var ke=function(){function e(t){Object(B.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(U.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(B.a)(this,e),this.options=Object.assign({},Ce,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(U.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||K}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(Q).forEach(function(e){var n=t.manager.get(e);n&&Q[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new ue(e,this._onOtherEvent,{enable:!1}),this.moveInput=new le(e,this._onOtherEvent,{enable:!1}),this.keyInput=new he(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new de(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,f=this.events[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=Object(z.a)(l.value,2),d=h[0],v=h[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=J[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=re[e]||e,o=r.get(a);o||(o=new ke(this),r.set(a,o),o.recognizerName=ie[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=re[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,f=n.values()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;if(h.recognizerName===a&&!h.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==f.return||f.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=$[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),Ae=n(31);function Te(){}n.d(t,"a",function(){return Le});var Me={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:Te,onResize:Te,onViewStateChange:Te,onBeforeRender:Te,onAfterRender:Te,onLoad:Te,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Le=function(){function e(t){o()(this,e),t=Object.assign({},Me,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),function(){if(void 0===("undefined"==typeof window?"undefined":r()(window)))return!1;return-1!==((window.navigator||{}).userAgent||"").indexOf("Trident/")}()&&v.a.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new N.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return u()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&v.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&v.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),f}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,f=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),f}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(l.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new L.a({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(I.a)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new m.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.callback=this.props.onHover,t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(R.a)(e,{enable:!0,copyState:!0})),Object(F.a)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new Ee(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Ae.b)this.eventManager.on(t,this._onEvent);this.viewManager=new p({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(l.a)(this.viewManager);var n=this.viewManager.getViewports()[0];this.layerManager=new c.a(e,{deck:this,stats:this.stats,viewport:n}),this.effectManager=new _,this.deckRenderer=new w.a(e),this.deckPicker=new T(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(F.a)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),v.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=Ae.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){var e=this.stats;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();var t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var e=this.metrics,t=this.stats;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();var n=D.a.get("Memory Usage");e.bufferMemory=n.get("Buffer Memory").count,e.textureMemory=n.get("Texture Memory").count,e.renderbufferMemory=n.get("Renderbuffer Memory").count,e.gpuMemory=n.get("GPU Memory").count}}]),e}();Le.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(x.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Le.defaultProps=Me,Le.VERSION=M.a.VERSION},function(e,t,n){"use strict";var i=n(109),r=n(132),a=n(205),o=n(189),s=n(206),u={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n} geometry;\n",fs:"\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n"},c=n(84),l={name:"project32",dependencies:[c.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"};function f(){Object(i.c)([a.a,c.a,l,o.a,o.b,s.a]),Object(i.e)([u,c.a]),Object(r.c)("vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)"),Object(r.c)("fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"),Object(r.b)("picking",{hook:"fs:DECKGL_FILTER_COLOR",order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n"})}n.d(t,"a",function(){return f})},function(e,t,n){"use strict";var i=n(117),r=n(122),a=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],o=(r.a&&r.d,!r.a&&r.b,r.e,{extensions:a,loadAndParse:r.c}),s=n(108),u=n(15);var c={name:"JSON",extensions:["json","geojson"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},l=n(195);if(s.a.deck&&"7.2.1"!==s.a.deck.VERSION)throw new Error("deck.gl - multiple versions detected: ".concat(s.a.deck.VERSION," vs ").concat("7.2.1"));s.a.deck||(u.a.log(0,"deck.gl ".concat("7.2.1"," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),s.a.deck=s.a.deck||{VERSION:"7.2.1",version:"7.2.1",log:u.a},Object(i.b)([c,o]),Object(l.a)());t.a=s.a.deck},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(32),s=n(9),u=n(66),c=n(11),l=n(52),f=n(56),h=n(60),d=n(74),v=n(61),g=n(59),p=n(30),m=n(73),y=function(){function e(t){Object(i.a)(this,e),this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}return Object(r.a)(e,[{key:"getAttributeInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var t=this.getAttributeInfo(e);return t?t.location:-1}},{key:"getAttributeAccessor",value:function(e){var t=this.getAttributeInfo(e);return t?t.accessor:null}},{key:"getVaryingInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var t=this.getVaryingInfo();return t?t.location:-1}},{key:"getVaryingAccessor",value:function(e){var t=this.getVaryingInfo();return t?t.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var t=e.gl,n=t.getProgramParameter(e.handle,35721),i=0;i=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(Object(p.d)(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(s.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",P),n._isCached=!1,n.initialize(r),Object.seal(Object(o.a)(n)),n._setId(r.id),n}return Object(c.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vs,n=e.fs,i=e.varyings,r=e.bufferMode,a=void 0===r?35981:r;return this.vs="string"==typeof t?new v.c(this.gl,{id:"".concat(e.id,"-vs"),source:t}):t,this.fs="string"==typeof n?new v.a(this.gl,{id:"".concat(e.id,"-fs"),source:n}):n,Object(x.a)(this.vs instanceof v.c),Object(x.a)(this.fs instanceof v.a),this.uniforms={},i&&(Object(p.a)(this.gl),this.varyings=i,this.gl.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new y(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,f=void 0!==l&&l,h=e.indexType,d=void 0===h?5123:h,v=e.isInstanced,g=void 0!==v&&v,y=e.instanceCount,O=void 0===y?0:y,P=e.vertexArray,S=void 0===P?null:P,j=e.transformFeedback,k=e.framebuffer,C=e.parameters,E=void 0===C?{}:C,A=e.uniforms,T=e.samplers;if((A||T)&&(w.a.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(A||{})),void 0!==n){var M=k?k.id:"default",L="mode=".concat(Object(_.a)(this.gl,r)," verts=").concat(a," ")+"instances=".concat(O," indexType=").concat(Object(_.a)(this.gl,d)," ")+"isInstanced=".concat(g," isIndexed=").concat(f," ")+"Framebuffer=".concat(M);w.a.log(n,L)()}return Object(x.a)(S),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(S.bindForDraw(a,O,function(){if(void 0!==k&&(E=Object.assign({},E,{framebuffer:k})),j){var e=Object(m.c)(r);j.begin(e)}t._bindTextures(),Object(b.a)(t.gl,E,function(){f&&g?t.gl.drawElementsInstanced(r,a,d,s,O):f&&Object(p.d)(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):f?t.gl.drawElements(r,a,d,s):g?t.gl.drawArraysInstanced(r,s,a,O):t.gl.drawArrays(r,s,a)}),j&&j.end()}),!0)}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=!1,i={};for(var r in e)Object(d.a)(this.uniforms[r],e[r])||(n=!0,i[r]=e[r],this.uniforms[r]=Object(d.c)(e[r]));return n&&(t(),Object(d.b)(i,this.id,this._uniformSetters),this._setUniforms(i)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof h.a)i=i.texture;if(i instanceof f.a)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof h.a&&(n=n.texture),n instanceof f.a)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof h.a&&(n=n.texture),n instanceof f.a){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new v.c({handle:u});break;case 35632:n.fs=new v.a({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Object(O.c)(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),w.a.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),w.a.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||w.a.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1)for(var s=0;s0&&w[1]>0);var O=w[0]/x[0],P=w[1]/x[1],S=(u.right-u.left)/2/O,j=(u.bottom-u.top)/2/P,k=[(_[0]+b[0])/2+S,(_[1]+b[1])/2+j],C=y.unproject(k),E=y.zoom+Math.log2(Math.abs(Math.min(O,P)));return{longitude:C[0],latitude:C[1],zoom:E}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(24),r=n(4),a=n(5),o=n(22),s=n(29),u=n(40),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.g(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(32),s=n(5),u=n(11),c=n(52),l=n(43),f=n(30),h=n(67),d=n(26),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(f.a)(e),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(f.d)(e)}}]),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(h.a)(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,d.a.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof l.a==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(4),r=n(5),a=n(59),o=n(43),s=n(106),u=n(235),c=n(26),l=n(19),f=/^(.+)__LOCATION_([0-9]+)$/,h=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.vertexArrayObject=s.a.isSupported(t)?new s.a(t):s.a.getDefaultArray(t),Object(u.a)(this,"VertexArray","v6.0",h),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new o.a(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof o.a){var a=n;if(r){var s=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,s)}else{var u=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,u)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c.a.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(34),r=n(50),a=n.n(r),o=n(116),s=n(4),u=n(5),c=n(91),l=n(107),f=n(125),h=n(177),d=n(135),v=n(30),g=n(65),p=n(60),m=n(26),y=n(19),b=0,_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e);var n=t.onCreateContext,i=void 0===n?function(e){return Object(c.a)(e)}:n,r=t.onAddHTML,a=void 0===r?null:r,o=t.onInitialize,u=void 0===o?function(){}:o,f=t.onRender,h=void 0===f?function(){}:f,d=t.onFinalize,v=void 0===d?function(){}:d,g=t.gl,p=void 0===g?null:g,y=t.glOptions,_=void 0===y?{}:y,x=t.debug,w=void 0!==x&&x,O=t.createFramebuffer,P=void 0!==O&&O,S=t.autoResizeViewport,j=void 0===S||S,k=t.autoResizeDrawingBuffer,C=void 0===k||k,E=t.stats,A=void 0===E?l.a.get("animation-loop-".concat(b++)):E,T=t.useDevicePixels,M=void 0===T||T;"useDevicePixelRatio"in t&&(m.a.deprecated("useDevicePixelRatio","useDevicePixels")(),M=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:a,onInitialize:u,onRender:h,onFinalize:v,gl:p,glOptions:_,debug:w,createFramebuffer:P},this.gl=p,this.needsRedraw=null,this.timeline=null,this.stats=A,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:j,autoResizeDrawingBuffer:C,useDevicePixels:M}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(u.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Object(y.a)("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,Object(f.b)().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=h.a.isSupported(e.gl,["timers"])?new h.a(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),Object(d.a)(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(o.a)(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return m.a.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;Object(d.a)(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||Object(d.b)(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(i.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Object(c.c)(this.props.gl,e):this.onCreateContext(e),!Object(v.c)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(g.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Object(c.d)(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new p.a(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()&&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}}]),e}()},function(e,t,n){"use strict";t.a={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}},function(e,t,n){"use strict";var i={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};t.a={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}}},function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(0),r=n(43),a=n(68),o=n(73),s=n(187);function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=c(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),f=t.accessors[s.location];f&&(u="".concat(o,": ").concat(l(s.name,f))),r[u]=c(t,a[o],f,i)}}return r}function c(e,t,n,o){var u,c,l,f,h=e.gl,d="NOT PROVIDED",v="N/A",g="N/A",p="N/A";if(n&&(d=n.type,v=n.size,c=-1!==(d=String(d).replace("Array","")).indexOf("nt")),t instanceof r.a){var m,y,b=t,_=b.getDebugData(),x=_.data;if(l=_.modified?"*":"",f=x,g=(p=b.byteLength)/x.BYTES_PER_ELEMENT/v,n){var w=n.divisor>0;y="".concat(w?"I ":"P "," ").concat(g," (x").concat(v,"=").concat(p," bytes ").concat(Object(a.a)(h,d),")")}else c=!0,y="".concat(p," bytes");return m={},Object(i.a)(m,o,"".concat(l).concat(Object(s.a)(f,{size:v,isInteger:c}))),Object(i.a)(m,"Format ",y),m}return f=t,v=t.length,c=-1!==(d=String(t.constructor.name).replace("Array","")).indexOf("nt"),u={},Object(i.a)(u,o,"".concat(Object(s.a)(f,{size:v,isInteger:c})," (constant)")),Object(i.a)(u,"Format ","".concat(v,"x").concat(d," (constant)")),u}function l(e,t){var n=t.type,i=t.size,r=Object(o.b)(n,i);return r?"".concat(e," (").concat(r.name,")"):e}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(0),r=n(19),a=n(187);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,o=e.program,u=e.uniforms,c=e.undefinedOnly,l=void 0!==c&&c;Object(r.a)(o);var f=o._uniformSetters,h={},d=Object.keys(f).sort(),v=0,g=!0,p=!1,m=void 0;try{for(var y,b=d[Symbol.iterator]();!(g=(y=b.next()).done);g=!0){var _=y.value;_.match(".*_.*")||_.match(".*Matrix")||s({table:h,header:n,uniforms:u,uniformName:_,undefinedOnly:l})&&v++}}catch(e){p=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(p)throw m}}var x=!0,w=!1,O=void 0;try{for(var P,S=d[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;j.match(".*Matrix")&&s({table:h,header:n,uniforms:u,uniformName:j,undefinedOnly:l})&&v++}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}var k=!0,C=!1,E=void 0;try{for(var A,T=d[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var M=A.value;h[M]||s({table:h,header:n,uniforms:u,uniformName:M,undefinedOnly:l})&&v++}}catch(e){C=!0,E=e}finally{try{k||null==T.return||T.return()}finally{if(C)throw E}}var L=0,I={};if(!l)for(var R in u){var F=u[R];h[R]||(L++,I[R]=Object(i.a)({Type:"NOT USED: ".concat(F)},n,Object(a.a)(F)))}return{table:h,count:v,unusedTable:I,unusedCount:L}}function s(e){var t,n=e.table,r=e.header,o=e.uniforms,s=e.uniformName,u=e.undefinedOnly,c=o[s],l=function(e){return null!=e}(c);return(!u||!l)&&(n[s]=(t={},Object(i.a)(t,r,l?Object(a.a)(c):"N/A"),Object(i.a)(t,"Uniform Type",l?c:"NOT PROVIDED"),t),!0)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(0),r=n(73);function a(e){var t={},n="Accessors for ".concat(e.id),r=!0,a=!1,s=void 0;try{for(var u,c=e.attributeInfos[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var l=u.value;if(l){var f=o(l);t["in ".concat(f)]=Object(i.a)({},n,JSON.stringify(l.accessor))}}}catch(e){a=!0,s=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw s}}var h=!0,d=!1,v=void 0;try{for(var g,p=e.varyingInfos[Symbol.iterator]();!(h=(g=p.next()).done);h=!0){var m=g.value;if(m){var y=o(m);t["out ".concat(y)]=Object(i.a)({},n,JSON.stringify(m.accessor))}}}catch(e){d=!0,v=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw v}}return t}function o(e){var t=e.accessor,n=t.type,i=t.size,a=Object(r.b)(n,i);return a?"".concat(a.name," ").concat(e.name):e.name}},function(e,t,n){"use strict";function i(e){var t=100,n=e.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(25),r=n(4),a=n(5),o=n(10),s=n(9),u=n(66),c=n(11),l=n(64),f=n(26),h=n(92),d=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var i=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===i?[]:i;return f.a.assert(a.every(function(e){return e instanceof h.a}),"every child must an instance of ScenegraphNode"),(e=Object(o.a)(this,Object(s.a)(t).call(this,n))).children=a,e}return Object(c.a)(t,e),Object(a.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new l.a:n,r=new l.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;f instanceof t?f.traverse(e,{worldMatrix:r}):e(f,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return f.a.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(h.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(66),u=n(11),c=n(93),l=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof c.a?(n.model=e,n._setModelNodeProps(r)):n.model=new c.a(e,r),n.managedResources=r.managedResources||[],n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return Object(s.a)(Object(o.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(n(92).a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(201),p=n(64),m=n(167);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new g.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new p.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(1),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(129),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s=(new g.a).lookAt({eye:[0,0,o]});s.rotateX(r*m),"Z"===i?s.rotateZ(a*m):s.rotateY(a*m);var u=1/(t||1);return s.scale([u,u,u]),s}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,f=void 0===c?50:c,h=e.near,d=e.far,v=e.orbitAxis,g=void 0===v?"Z":v,p=e.target,m=void 0===p?[0,0,0]:p,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,O=e.zoom,P=void 0===O?0:O;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:f,orbitAxis:g,rotationX:_,rotationOrbit:w,zoom:P}),fovy:f,near:h,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(1),u=n.n(s),c=n(6),l=n.n(c),f=n(7),h=n.n(f),d=n(53),v=n(45),g=n(64),p=n(168),m=(new g.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new g.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,f=e.far,h=void 0===f?1e3:f,d=e.zoom,g=void 0===d?0:d,p=e.target,b=void 0===p?[0,0,0]:p;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:h}),zoom:g}))}return h()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return h()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(191),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.a}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(170).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(192),v=n(72),g=n(193),p=n(131),m=n(114),y=n(141),b=n(139),_=new d.a,x={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags),i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(i&&Array.isArray(n.dataChanged)){var r=this.state.paths.slice(),a=n.dataChanged.map(function(e){return Object(b.a)({data:r,getIndex:function(e){return e.__source.index},dataRange:e,replace:t._getPaths(e)})});this.setState({paths:r,pathsDiff:a})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.data,i=t.getPolygon,r=[],a="XY"===t.positionFormat?2:3,o=e.startRow,s=e.endRow,u=Object(v.a)(n,o,s),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var g,p=c[Symbol.iterator]();!(f=(g=p.next()).done);f=!0){var m=g.value;l.index++;var b=y.c(i(m,l),a),_=b.positions,x=b.holeIndices;if(x)for(var w=0;w<=x.length;w++){var O=_.subarray(x[w-1]||0,x[w]||_.length);r.push(this.getSubLayerRow({path:O},m,l.index))}else r.push(this.getSubLayerRow({path:_},m,l.index))}}catch(e){h=!0,d=e}finally{try{f||null==p.return||p.return()}finally{if(h)throw d}}return r}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e._dataDiff,i=e.stroked,r=e.filled,a=e.extruded,o=e.wireframe,s=e.elevationScale,u=e.transitions,c=e.positionFormat,l=this.props,f=l.lineWidthUnits,h=l.lineWidthScale,d=l.lineWidthMinPixels,v=l.lineWidthMaxPixels,g=l.lineJointRounded,y=l.lineMiterLimit,b=l.lineDashJustified,_=this.props,x=_.getFillColor,w=_.getLineColor,O=_.getLineWidth,P=_.getLineDashArray,S=_.getElevation,j=_.getPolygon,k=_.updateTriggers,C=_.material,E=this.state,A=E.paths,T=E.pathsDiff,M=this.getSubLayerClass("fill",p.a),L=this.getSubLayerClass("stroke",m.a),I=this.shouldRenderSubLayer("fill",A)&&new M({_dataDiff:n,extruded:a,elevationScale:s,filled:r,wireframe:o,getElevation:S,getFillColor:x,getLineColor:w,material:C,transitions:u},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:k.getPolygon,getElevation:k.getElevation,getFillColor:k.getFillColor,getLineColor:k.getLineColor}}),{data:t,positionFormat:c,getPolygon:j});return[!a&&I,!a&&i&&this.shouldRenderSubLayer("stroke",A)&&new L({_dataDiff:T&&function(){return T},widthUnits:f,widthScale:h,widthMinPixels:d,widthMaxPixels:v,rounded:g,miterLimit:y,dashJustified:b,transitions:u&&{getWidth:u.getLineWidth,getColor:u.getLineColor,getPath:u.getPolygon},getColor:this.getSubLayerAccessor(w),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:k.getLineWidth,getColor:k.getLineColor,getDashArray:k.getLineDashArray}}),{data:A,positionFormat:c,getPath:function(e){return e.path}}),a&&I]}}]),t}(g.a);w.layerName="PolygonLayer",w.defaultProps=x},function(e,t,n){"use strict";var i="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",r={name:"project2",vs:i,fs:i},a=n(115);t.a={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[r,a.a]}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var r="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",a="".concat(r,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),o={ONE:1};t.a={name:"fp64",vs:a,fs:null,fp64ify:i,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var a=4*n+r;i(e[4*r+n],t,2*a)}return t},getUniforms:function(){return Object.assign({},o)}},"".concat(r)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(93),b=n(58);n.d(t,"a",function(){return w});var _=[0,0,0,255],x={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:_},getTargetColor:{type:"accessor",value:_},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n vec2 source = project_position(geometry.worldPosition, instancePositions64Low.xy).xy;\n vec2 target = project_position(geometry.worldPositionAlt, instancePositions64Low.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instancePositions64Low:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions64Low},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:_},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:_},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(g.a)(a,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,p=void 0;try{for(var m,y=f[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;h.index++;var _=o(b,h);u[c++]=_[0],u[c++]=_[1];var x=s(b,h);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}}},{key:"calculateInstancePositions64Low",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]);var O=u(x,d);c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);w.layerName="ArcLayer",w.defaultProps=x},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(93),b=n(58);n.d(t,"a",function(){return x});var _={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return h()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec4 instanceSourceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourceTargetPositions64xyLow.xy, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceSourceTargetPositions64xyLow.zw, vec3(0.), target_commonspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,transition:!0,accessor:"getTargetPosition"},instanceSourceTargetPositions64xyLow:{size:4,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstanceSourceTargetPositions64xyLow},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new y.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new b.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateInstanceSourceTargetPositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getSourcePosition,u=a.getTargetPosition,c=e.value,l=n*e.size,f=Object(g.a)(o,n,i),h=f.iterable,d=f.objectInfo,v=!0,m=!1,y=void 0;try{for(var b,_=h[Symbol.iterator]();!(v=(b=_.next()).done);v=!0){var x=b.value;d.index++;var w=s(x,d),O=u(x,d);c[l++]=Object(p.c)(w[0]),c[l++]=Object(p.c)(w[1]),c[l++]=Object(p.c)(O[0]),c[l++]=Object(p.c)(O[1])}}catch(e){m=!0,y=e}finally{try{v||null==_.return||_.return()}finally{if(m)throw y}}}else e.value=new Float32Array(4)}}]),t}(m.a);x.layerName="LineLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(7),h=n.n(f),d=n(193),v=n(171),g=n(114),p=n(192),m=n(131),y=n(139),b=n(15);function _(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},r=n.startRow,a=void 0===r?0:r,o=n.endRow,s=void 0===o?e.length:o,u=a;u0;)t=t[0];return t&&Number.isFinite(t[0])}(a,o))switch(a){case"Point":s.push(n({geometry:e},i,r));break;case"MultiPoint":o.forEach(function(e){s.push(n({geometry:{type:"Point",coordinates:e}},i,r))});break;case"LineString":u.push(n({geometry:e},i,r));break;case"MultiLineString":o.forEach(function(e){u.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"Polygon":c.push(n({geometry:e},i,r)),o.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"MultiPolygon":o.forEach(function(e){c.push(n({geometry:{type:"Polygon",coordinates:e}},i,r)),e.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))})})}else b.a.warn("".concat(a," coordinates are malformed"))()}var w={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return j});var O=new p.a,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:O};function S(e){return e.geometry.coordinates}var j=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return h()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){var t=e.props,n=e.changeFlags;if(n.dataChanged){var i=function(e){if(Array.isArray(e))return e;switch(b.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return b.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data),r=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var a=this.state.features,o={},s={};for(var u in a)o[u]=a[u].slice(),s[u]=[];var c=!0,l=!1,f=void 0;try{for(var h,d=n.dataChanged[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value,g=_(i,r,v);for(var p in a)s[p].push(Object(y.a)({data:o[p],getIndex:function(e){return e.__source.index},dataRange:v,replace:g[p]}))}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}this.setState({features:o,featuresDiff:s})}else this.setState({features:_(i,r),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var e=this.state,t=e.features,n=e.featuresDiff,i=t.pointFeatures,r=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures,s=this.props,u=s.stroked,c=s.filled,l=s.extruded,f=s.wireframe,h=s.material,d=s.transitions,p=this.props,y=p.lineWidthUnits,b=p.lineWidthScale,_=p.lineWidthMinPixels,x=p.lineWidthMaxPixels,w=p.lineJointRounded,O=p.lineMiterLimit,P=p.pointRadiusScale,j=p.pointRadiusMinPixels,k=p.pointRadiusMaxPixels,C=p.elevationScale,E=p.lineDashJustified,A=this.props,T=A.getLineColor,M=A.getFillColor,L=A.getRadius,I=A.getLineWidth,R=A.getLineDashArray,F=A.getElevation,D=A.updateTriggers,N=this.getSubLayerClass("polygons-fill",m.a),z=this.getSubLayerClass("polygons-stroke",g.a),B=this.getSubLayerClass("line-strings",g.a),U=this.getSubLayerClass("points",v.a),V=this.shouldRenderSubLayer("polygons-fill",a)&&new N({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:l,elevationScale:C,filled:c,wireframe:f,material:h,getElevation:this.getSubLayerAccessor(F),getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),transitions:d&&{getPolygon:d.geometry,getElevation:d.getElevation,getFillColor:d.getFillColor,getLineColor:d.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:D.getElevation,getFillColor:D.getFillColor,getLineColor:D.getLineColor}}),{data:a,getPolygon:S});return[!l&&V,!l&&u&&this.shouldRenderSubLayer("polygons-stroke",o)&&new z({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:o,getPath:S}),this.shouldRenderSubLayer("linestrings",r)&&new B({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(T),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:r,getPath:S}),this.shouldRenderSubLayer("points",i)&&new U({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:u,filled:c,radiusScale:P,radiusMinPixels:j,radiusMaxPixels:k,lineWidthUnits:y,lineWidthScale:b,lineWidthMinPixels:_,lineWidthMaxPixels:x,getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(T),getRadius:this.getSubLayerAccessor(L),getLineWidth:this.getSubLayerAccessor(I),transitions:d&&{getPosition:d.geometry,getFillColor:d.getFillColor,getLineColor:d.getLineColor,getRadius:d.getRadius,getLineWidth:d.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:D.getFillColor,getLineColor:D.getLineColor,getRadius:D.getRadius,getLineWidth:D.getLineWidth}}),{data:i,getPosition:S}),l&&V]}}]),t}(d.a);j.layerName="GeoJsonLayer",j.defaultProps=P},function(e,t,n){"use strict";var i,r=n(4),a=n(5),o=n(0),s=n(147),u=n(123),c=n(207),l=n(30),f=n(43),h=n(80),d=n(126),v=n(159),g=n(202),p=n(60),m=n(211),y=n(19),b=n(26),_=n(67),x=n(93),w="transform_uSampler_",O="transform_uSize_",P="transform_position";function S(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,c={},l=t,f={};if(a>0||i){var h=l.split("\n"),d=h.slice();if(h.forEach(function(e,t,r){if(a>0){var l=function(e,t){var n={},i=function(e){return Object(u.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(w).concat(e),n="".concat(O).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),c=s.samplerName,l=s.sizeName,f=s.uniformDeclerations,h=Object(u.e)(r),d=" ".concat(r," ").concat(a," = transform_getInput(").concat(c,", ").concat(l,").").concat(h,";\n");n[c]=a;var v={"vs:#decl":f,"vs:#main-start":d};return{updatedLine:o,inject:v,samplerTextureMap:n}}return null}(e,n);if(l){var h=l.updatedLine,v=l.inject;d[t]=h,f=Object(s.b)([f,v]),Object.assign(c,l.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(u.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Object(y.a)(r);var v="".concat(O).concat(i),g={"vs:#decl":"uniform vec2 ".concat(v,";\n"),"vs:#main-start":" vec2 ".concat(P," = transform_getPos(").concat(v,");\n gl_Position = vec4(").concat(P,", 0, 1.);\n")};f=Object(s.b)([f,g])}l=d.join("\n")}return{vs:l,targetTextureType:o,inject:f,samplerTextureMap:c}}n.d(t,"a",function(){return k});var j=(i={},Object(o.a)(i,10241,9728),Object(o.a)(i,10240,9728),Object(o.a)(i,10242,33071),Object(o.a)(i,10243,33071),i),k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,e),Object(y.a)(Object(l.d)(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this.resources={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(a.a)(e,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(a.a)(e,[{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof f.a?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Object(y.a)(!n||n===this.targetTextureVarying);var o=Object(h.e)(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,c=Object(u.d)(this.targetTextureType),l=new s(o.length*c/4),f=0,d=0;d0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,s=this.framebuffers[this.currentIndex],Object(y.a)(s),r.viewport=[0,0,s.width,s.height],o&&s.clear({color:!0})),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){b.a.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Object(y.a)(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Object(y.a)(r[o]instanceof f.a||r[o].buffer instanceof f.a);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(j)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Object(y.a)(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(b.a.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(b.a.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,h=e._swapTexture;for(var v in Object(y.a)(a&&(s||n||c)&&o),t||{})Object(y.a)(t[v]instanceof f.a||t[v].buffer instanceof f.a);for(var g in u||{})Object(y.a)(u[g]instanceof d.a);return Object(y.a)(!c||l),Object(y.a)(!h||u[h]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n,0);Object(y.a)(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e,t){var n;if(e instanceof d.a)return e;var i=this.sourceTextures[0][e];if(!i)return null;this._targetRefTexName=e;var r=Object(v.a)(i,{parameters:(n={},Object(o.a)(n,10241,9728),Object(o.a)(n,10240,9728),Object(o.a)(n,10242,33071),Object(o.a)(n,10243,33071),n),pixelStore:Object(o.a)({},37440,!1)}),a="target-texture-".concat(t);return this.resources[a]&&this.resources[a].delete(),this.resources[a]=r,r}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=this._createNewBuffer(r,{byteLength:o,usage:s,accessor:u});this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new f.a(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=n,n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Object(y.a)(this.feedbackBuffers[t][i]instanceof f.a))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new x.a(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){Object(_.a)(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new g.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new p.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=this._createNewBuffer("elementIDBuffer",{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,l=Object(s.b)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:e._fs||Object(u.b)({version:Object(m.a)(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[c.a].concat(e.modules||[]):e.modules,uniforms:i,inject:l,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return S({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}()},function(e,t,n){"use strict";(function(e){var i=n(34);t.a="undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==Object(i.a)(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(89))},function(e,t,n){var i=n(255);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){e.exports=function(e){var t;if("function"==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(38),a=n.n(r),o=n(121);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(89))},function(e,t,n){var i=n(8);e.exports=function(e){for(var t=1;t80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);g=0!==(g=Math.max(u-i,c-s))?1/g:0}return o(y,b,n,i,s,g),b}function r(e,t,n,i,r){var a,o;if(r===S(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(O(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,f,h){if(e){!h&&f&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,f);for(var v,g,p=e;e.prev!==e.next;)if(v=e.prev,g=e.next,f?u(e,i,r,f):s(e))t.push(v.i/n),t.push(e.i/n),t.push(g.i/n),O(e),e=g.next,p=g.next;else if((e=g)===p){h?1===h?o(e=c(e,t,n),t,n,i,r,f,2):2===h&&l(e,t,n,i,r,f):o(a(e),t,n,i,r,f,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(g(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,f=d(s,u,t,n,i),h=d(c,l,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=f&&p&&p.z<=h;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=f;){if(v!==e.prev&&v!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),O(i),O(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&p(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function f(e,t){return e.x-t.x}function h(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&g(an.x)&&_(i,e)&&(n=i,h=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u2&&void 0!==arguments[2]?arguments[2]:{},i=p.b[t];if(Object(m.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in y)return y[t];var r=i[0],a="#extension GL_".concat(r," : enable\nvoid main(void) {}"),o=e.createShader(35633);e.shaderSource(o,a),e.compileShader(o);var s=e.getShaderParameter(o,35713);return e.deleteShader(o),y[t]=s,s}var _=n(60),x=n(43),w=n(64),O=n(200),P=n(63),S=n(94),j=n(128),k=n(161),C=n(113),E=n(81),T=n(178),A=n(162),M=n(206),L=n(107),I=n(207),R=n(4),F=n(5),D=n(75),N=5126,z=5124,B=5125,U=function(){function e(t){var n;for(var i in Object(R.a)(this,e),this.layout={},this.size=0,t)this._addUniform(i,t[i]);this.size+=(4-this.size%4)%4;var r=new Float32Array(this.size);this.typedArray=(n={},Object(c.a)(n,N,r),Object(c.a)(n,z,new Int32Array(r.buffer)),Object(c.a)(n,B,new Uint32Array(r.buffer)),n)}return Object(F.a)(e,[{key:"getBytes",value:function(){return 4*this.size}},{key:"getData",value:function(){return this.typedArray[N]}},{key:"getSubData",value:function(e){var t,n;if(void 0===e)t=this.data,n=0;else{var i=this.offsets[e],r=i+this.sizes[e];t=this.data.subarray(i,r),n=4*i}return{data:t,offset:n}}},{key:"setUniforms",value:function(e){for(var t in e)this._setValue(t,e[t]);return this}},{key:"_setValue",value:function(e,t){var n=this.layout[e];Object(m.a)(n,"UniformLayoutStd140 illegal argument");var i=this.typedArray[n.type];1===n.size?i[n.offset]=t:i.set(t,n.offset)}},{key:"_addUniform",value:function(e,t){var n=Object(D.a)(t);Object(m.a)(n,"UniformBufferLayout illegal argument");var i=n.type,r=n.components;this.size=this._alignTo(this.size,r);var a=this.size;this.size+=r,this.layout[e]={type:i,size:r,offset:a}}},{key:"_alignTo",value:function(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}}]),e}(),V=n(126),G=n(25),W=n(70),H=n(46);n.d(t,"S",function(){return r.a}),n.d(t,"A",function(){return a.a}),n.d(t,"B",function(){return a.b}),n.d(t,"V",function(){return a.d}),n.d(t,"X",function(){return a.e}),n.d(t,"N",function(){return o.c}),n.d(t,"O",function(){return o.d}),n.d(t,"w",function(){return s.a}),n.d(t,"J",function(){return u.b}),n.d(t,"I",function(){return u.a}),n.d(t,"E",function(){return v}),n.d(t,"H",function(){return d}),n.d(t,"F",function(){return f}),n.d(t,"D",function(){return h.a}),n.d(t,"c",function(){return p.a}),n.d(t,"L",function(){return g.b}),n.d(t,"M",function(){return g.c}),n.d(t,"G",function(){return g.a}),n.d(t,"t",function(){return b}),n.d(t,"a",function(){return _.a}),n.d(t,"b",function(){return x.a}),n.d(t,"i",function(){return w.b}),n.d(t,"q",function(){return w.c}),n.d(t,"d",function(){return w.a}),n.d(t,"f",function(){return O.a}),n.d(t,"e",function(){return P.a}),n.d(t,"h",function(){return S.a}),n.d(t,"j",function(){return j.a}),n.d(t,"l",function(){return k.a}),n.d(t,"u",function(){return C.a}),n.d(t,"v",function(){return C.b}),n.d(t,"T",function(){return E.e}),n.d(t,"U",function(){return E.f}),n.d(t,"x",function(){return E.b}),n.d(t,"y",function(){return E.c}),n.d(t,"z",function(){return E.d}),n.d(t,"s",function(){return E.a}),n.d(t,"g",function(){return T.a}),n.d(t,"k",function(){return A.a}),n.d(t,"m",function(){return M.a}),n.d(t,"p",function(){return L.a}),n.d(t,"o",function(){return I.a}),n.d(t,"n",function(){return U}),n.d(t,"Y",function(){return V.c}),n.d(t,"P",function(){return V.a}),n.d(t,"Q",function(){return V.b}),n.d(t,"R",function(){return G.a}),n.d(t,"r",function(){return m.a}),n.d(t,"Z",function(){return W.c}),n.d(t,"W",function(){return H.c}),n.d(t,"ab",function(){return H.d}),n.d(t,"K",function(){return H.b}),n.d(t,"C",function(){return H.a})},function(e,t,n){"use strict";var i=n(239);t.a=new i.a({id:"deck"}).enable()},function(e,t,n){var i=n(255),r=n(256),a=n(257);e.exports=function(e,t){return i(e)||r(e,t)||a()}},function(e,t,n){"use strict";n.r(t);var i=n(14),r=n(52),a=n(59),o=n(130),s=n(148),u=n(208),c=n(23),l=new Uint8Array([0,0,0]);function h(e){return[e+1&255,e+1>>8&255,e+1>>16&255]}function f(e){var t=Object(c.a)(e,3);return t[0]+256*t[1]+65536*t[2]-1}function d(){return l}var v=n(92),p=n(228),g=n(102),m=n(4),y=n(5),b=n(134),_=n(200),x=function(){function e(t){Object(m.a)(this,e),this.gl=t,this._programCache={},this._getUniforms={},this._registeredModules={},this._moduleInjections={vs:{},fs:{}},this._hookFunctions={vs:{},fs:{}},this._defaultModules=[],this._hashes={},this._hashCounter=0,this._hookStateCounter=0,this._useCounts={}}return Object(y.a)(e,[{key:"addDefaultModule",value:function(e){this._defaultModules.find(function(t){return t.name===e.name})||this._defaultModules.push(e)}},{key:"removeDefaultModule",value:function(e){var t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(function(e){return e.name!==t})}},{key:"addModuleInjection",value:function(e,t){var n="string"==typeof e?e:e.name,i=t.hook,r=t.injection,a=t.order,o=void 0===a?0:a,s=i.slice(0,2),u=this._moduleInjections[s];u[n]=u[n]||{},u[n][i]={injection:r,order:o},this._hookStateCounter++}},{key:"addShaderHook",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),i=Object(c.a)(n,2),r=i[0],a=i[1],o=e.replace(/\(.+/,"");this._hookFunctions[r][o]=Object.assign(t,{signature:a}),this._hookStateCounter++}},{key:"get",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.vs,i=void 0===n?"":n,r=t.fs,a=void 0===r?"":r,o=t.defines,s=void 0===o?{}:o,u=t.inject,c=void 0===u?{}:u,l=t.varyings,h=void 0===l?[]:l,f=t.bufferMode,d=void 0===f?35981:f,v=t.program,p=void 0===v?null:v,g=p?p.hash:"",m=this._getModuleList(t.modules),y=this._getHash(i),x=this._getHash(a),w=m.map(function(t){return e._getHash("string"==typeof t?t:t.name)}).sort(),O=h.map(function(t){return e._getHash(t)}),P=Object.keys(s).sort(),S=Object.keys(c).sort(),j=[],k=!0,C=!1,E=void 0;try{for(var T,A=P[Symbol.iterator]();!(k=(T=A.next()).done);k=!0){var M=T.value;j.push(this._getHash(M)),j.push(this._getHash(s[M]))}}catch(e){C=!0,E=e}finally{try{k||null==A.return||A.return()}finally{if(C)throw E}}var L=!0,I=!1,R=void 0;try{for(var F,D=S[Symbol.iterator]();!(L=(F=D.next()).done);L=!0){var N=F.value;j.push(this._getHash(N)),j.push(this._getHash(c[N]))}}catch(e){I=!0,R=e}finally{try{L||null==D.return||D.return()}finally{if(I)throw R}}var z="".concat(y,"/").concat(x,"D").concat(j.join("/"),"M").concat(w.join("/"),"I").concat([].join("/"),"V").concat(O.join("/"),"H").concat(this._hookStateCounter,"B").concat(d);if(g===z)return p;if(!this._programCache[z]){var B=Object(b.a)(this.gl,{vs:i,fs:a,modules:m,inject:c,defines:s,hookFunctions:this._hookFunctions,moduleInjections:this._moduleInjections});this._programCache[z]=new _.a(this.gl,{hash:z,vs:B.vs,fs:B.fs,varyings:h,bufferMode:d}),this._getUniforms[z]=B.getUniforms||function(e){},this._useCounts[z]=0}return this._useCounts[z]++,p&&this.release(p),this._programCache[z]}},{key:"getUniforms",value:function(e){return this._getUniforms[e.hash]||null}},{key:"release",value:function(e){var t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}},{key:"_getHash",value:function(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}},{key:"_getModuleList",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new Array(this._defaultModules.length+e.length),n={},i=0,r=0,a=this._defaultModules.length;r1&&void 0!==arguments[1]?arguments[1]:{};Object(m.a)(this,e);var i=n.onInitialize,r=void 0===i?function(){}:i,a=n.onFinalize,o=void 0===a?function(){}:a,s=n.useDevicePixels,u=void 0===s||s,c=n.autoResizeDrawingBuffer,l=void 0===c||c;this.props={onInitialize:r,onFinalize:o},this.setProps({autoResizeDrawingBuffer:l,useDevicePixels:u}),Object(j.a)(t instanceof Worker),this.worker=t,this.canvas=null,this.width=null,this.height=null,this._running=!1,this._animationFrameId=null,this._onMessage=this._onMessage.bind(this),this._onEvent=this._onEvent.bind(this),this._updateFrame=this._updateFrame.bind(this)}return Object(y.a)(e,null,[{key:"createWorker",value:function(e){return function(t){e.setProps({useDevicePixels:!1,autoResizeDrawingBuffer:!1}),t.canvas=null,t.onmessage=function(n){var i,r,a,o=n.data;switch(o.command){case"start":i=t,r=o.opts.canvas,a=new Map,r.addEventListener=function(e,t){i.postMessage({command:"addEventListener",type:e}),a.has(e)||a.set(e,[]),a.get(e).push(t)},r.removeEventListener=function(e,t){i.postMessage({command:"removeEventListener",type:e});var n=a.get(e);n&&n.splice(n.indexOf(t),1)},r.dispatchEvent=function(e,t){var n=a.get(e);n&&n.forEach(function(e){return e(t)})},i.canvas=r,e.start(o.opts);break;case"stop":e.stop();break;case"resize":t.canvas.width=o.width,t.canvas.height=o.height;break;case"event":t.canvas.dispatchEvent(o.type,o.event)}}}}}]),Object(y.a)(e,[{key:"setProps",value:function(e){return"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,this.worker.onmessage=this._onMessage,Object(P.b)().then(function(){return e._running?(e._createAndTransferCanvas(t),e.props.onInitialize(e)):null}).then(function(){e._running&&(e._animationFrameId=Object(S.b)(e._updateFrame))}),this)}},{key:"stop",value:function(){return this._running&&(Object(S.a)(this._animationFrameId),this._animationFrameId=null,this._running=!1,this.props.onFinalize(this)),this.worker.postMessage({command:"stop"}),this}},{key:"_onMessage",value:function(e){switch(e.data.command){case"addEventListener":this.canvas.addEventListener(e.data.type,this._onEvent);break;case"removeEventListener":this.canvas.removeEventListener(e.data.type,this._onEvent)}}},{key:"_onEvent",value:function(e){var t=this.useDevicePixels&&window.devicePixelRatio||1,n=e.type,i={};for(var r in e){var a=e[r],o=Object(O.a)(a);"offsetX"!==r&&"offsetY"!==r||(a*=t),"number"!==o&&"boolean"!==o&&"string"!==o||(i[r]=a)}this.worker.postMessage({command:"event",type:n,event:i})}},{key:"_updateFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._animationFrameId=Object(S.b)(this._updateFrame)}},{key:"_createAndTransferCanvas",value:function(e){var t=Object(P.a)(e);t.transferControlToOffscreen||k.a.error("OffscreenCanvas is not available in your browser.")();var n=t.transferControlToOffscreen();this.worker.postMessage({command:"start",opts:Object.assign({},e,{canvas:n})},[n]),this.canvas=t}},{key:"_resizeCanvasDrawingBuffer",value:function(){if(this.autoResizeDrawingBuffer){var e=this.useDevicePixels&&window.devicePixelRatio||1,t=this.canvas.clientWidth*e,n=this.canvas.clientHeight*e;this.width===t&&this.height===n||(this.width=t,this.height=n,this.worker.postMessage({command:"resize",width:t,height:n}))}}}]),e}(),E=n(10),T=n(9),A=n(47),M=n(11),L=n(63),I=n(73),R=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(m.a)(this,e);var i=n.id,r=void 0===i?"pass":i;this.id=r,this.gl=t,this.props={enabled:!0,screen:!1,swap:!1},Object.assign(this.props,n)}return Object(y.a)(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e,t){var n=this;if(this.props.enabled){var i=this.gl,r={gl:i,outputBuffer:e.writeBuffer,inputBuffer:e.readBuffer,animationProps:t,swapBuffers:function(){return e._swapFramebuffers()}};this.props.screen?(r.inputBuffer=r.outputBuffer,r.outputBuffer=L.a.getDefaultFramebuffer(i)):this.props.swap&&(r.inputBuffer=e.writeBuffer,r.outputBuffer=e.readBuffer),Object(I.a)(i,{framebuffer:r.outputBuffer},function(){return n._renderPass(r)}),this.props.debug&&r.outputBuffer.log(1,this.id),this.props.swap&&e._swapFramebuffers()}}},{key:"delete",value:function(){}},{key:"_renderPass",value:function(e){e.gl,e.inputBuffer,e.outputBuffer,e.animationProps}}]),e}(),F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(m.a)(this,t),n=Array.isArray(n)?{passes:n}:n,Object(E.a)(this,Object(T.a)(t).call(this,e,Object.assign({id:"composite-pass"},n)))}return Object(M.a)(t,e),Object(y.a)(t,[{key:"render",value:function(){var e=this.props.passes,t=void 0===e?[]:e,n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.render.apply(s,arguments)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"delete",value:function(){}}]),t}(R),D=function(){function e(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(m.a)(this,e),this.gl=t,this.framebuffer1=new L.a(t,{id:"multi-pass-1",stencil:!0}),this.framebuffer2=new L.a(t,{id:"multi-pass-2",stencil:!0}),this.reset()}return Object(y.a)(e,[{key:"reset",value:function(){this.framebuffer1.resize(),this.framebuffer2.resize(),this.writeBuffer=this.framebuffer1,this.readBuffer=this.framebuffer2,this.maskActive=!1}},{key:"delete",value:function(){this.framebuffer1.delete(),this.framebuffer2.delete()}},{key:"_swapFramebuffers",value:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}}]),e}(),N=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(m.a)(this,t),i=Array.isArray(i)?{passes:i}:i,(n=Object(E.a)(this,Object(T.a)(t).call(this,e,Object.assign({id:"multi-pass"},i)))).renderState=new D(e,i),n}return Object(M.a)(t,e),Object(y.a)(t,[{key:"render",value:function(e){this.renderState.reset();var t=this.props.passes,n=void 0===t?[]:t,i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){o.value.render(this.renderState,e)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this}},{key:"delete",value:function(){this.renderState.delete(),Object(A.a)(Object(T.a)(t.prototype),"delete",this).call(this)}}]),t}(F),z=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(m.a)(this,t),Object(E.a)(this,Object(T.a)(t).call(this,e,Object.assign({id:"clear-pass"},n)))}return Object(M.a)(t,e),Object(y.a)(t,[{key:"_renderPass",value:function(){var e=this.gl,t=this.props.clearBits,n=void 0===t?16640:t;e.clear(n)}}]),t}(R),B=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(m.a)(this,t),Object(E.a)(this,Object(T.a)(t).call(this,e,Object.assign({id:"render-pass"},n)))}return Object(M.a)(t,e),Object(y.a)(t,[{key:"_renderPass",value:function(e){var t=e.animationProps,n=this.props,i=n.models,r=void 0===i?[]:i,a=n.drawParams,o=!0,s=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){c.value.draw(Object.assign({},a,{animationProps:t}))}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}}]),t}(R),U="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\n\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",V=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(m.a)(this,t),(n=Object(E.a)(this,Object(T.a)(t).call(this,e,Object.assign({id:"copy-pass",swap:!0},i)))).clipspace=new g.a(e,{id:"copy-pass",fs:U}),n}return Object(M.a)(t,e),Object(y.a)(t,[{key:"delete",value:function(){Object(A.a)(Object(T.a)(t.prototype),"delete",this).call(this),this.clipspace.delete()}},{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=this.props.opacity,i=void 0===n?1:n;this.clipspace.draw({uniforms:{uDiffuseSampler:t,uOpacity:i},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(R),G="uniform sampler2D uDiffuseSampler;\nuniform float uOpacity;\nvarying vec2 uv;\n\nvoid main() {\n vec4 texel = texture2D(uDiffuseSampler, uv);\n gl_FragColor = uOpacity * texel;\n}\n",W=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(m.a)(this,t),n=Object(E.a)(this,Object(T.a)(t).call(this,e,Object.assign({id:"texture-pass"},i)));var r=i.texture,a=i.opacity,o=void 0===a?1:a;return n.clipspace=new g.a(e,{id:"texture-pass",fs:G,uniforms:{uDiffuseSampler:r,uOpacity:o}}),n}return Object(M.a)(t,e),Object(y.a)(t,[{key:"delete",value:function(){this.clipspace.delete(),Object(A.a)(Object(T.a)(t.prototype),"delete",this).call(this)}},{key:"_renderPass",value:function(){this.clipspace.draw({parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(R),H=n(142),X=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(m.a)(this,t),Object(E.a)(this,Object(T.a)(t).call(this,e,Object.assign({swap:!0},n)))}return Object(M.a)(t,e),Object(y.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer;e.swapBuffers;this.props.model.setUniforms(this.props),this.props.model.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(R),q=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(m.a)(this,t);var a="".concat(n.name,"-pass");Object(H.b)(n);var o=function(e,t,n,i){if(t.filter||t.sampler){var r=Q(t),a=new X(e,{id:n,model:Z(e,t,r,n,i),uniforms:null});return[a]}var o=t.passes||[];return o.map(function(r){var a=Q(t,r),s="".concat(n,"-").concat(o.length+1);return new X(e,Object.assign({id:s,model:Z(e,t,a,s,i),uniforms:r.uniforms},i))})}(e,n,a,r);return(i=Object(E.a)(this,Object(T.a)(t).call(this,e,Object.assign({id:a,passes:o},r)))).module=n,i}return Object(M.a)(t,e),Object(y.a)(t,[{key:"_renderPass",value:function(e){var t=e.inputBuffer,n=e.swapBuffers,i=!0,r=!0,a=!1,o=void 0;try{for(var s,u=this.props.passes[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i||n(),i=!1;var l=c.props,h=l.uniforms,f=l.model;h&&f.setUniforms(h),f.draw({uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}}]),t}(F);function Z(e,t,n,i,r){var a=new g.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}var Y=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n")},K=function(e){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n")};function Q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return Y(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return K(i)}return null}var J=n(36),$=n(70),ee={x:[2,0,1],y:[0,1,2],z:[1,2,0]},te=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(m.a)(this,t);var n=e.id,i=void 0===n?Object($.c)("truncated-code-geometry"):n,r=function(e){for(var t=e.bottomRadius,n=void 0===t?0:t,i=e.topRadius,r=void 0===i?0:i,a=e.height,o=void 0===a?1:a,s=e.nradial,u=void 0===s?10:s,c=e.nvertical,l=void 0===c?10:c,h=e.verticalAxis,f=void 0===h?"y":h,d=e.topCap,v=void 0!==d&&d,p=e.bottomCap,g=void 0!==p&&p,m=(v?2:0)+(g?2:0),y=(u+1)*(l+1+m),b=Math.atan2(n-r,o),_=Math.sin,x=Math.cos,w=Math.PI,O=x(b),P=_(b),S=v?-2:0,j=l+(g?2:0),k=u+1,C=new Uint16Array(u*(l+m)*6),E=ee[f],T=new Float32Array(3*y),A=new Float32Array(3*y),M=new Float32Array(2*y),L=0,I=0,R=S;R<=j;R++){var F=R/l,D=o*F,N=void 0;R<0?(D=0,F=1,N=n):R>l?(D=o,F=1,N=r):N=n+R/l*(r-n),-2!==R&&R!==l+2||(N=0,F=0),D-=o/2;for(var z=0;zl?0:B*O,A[L+E[1]]=R<0?-1:R>l?1:P,A[L+E[2]]=R<0||R>l?0:U*O,M[I+0]=z/u,M[I+1]=F,I+=2,L+=3}}for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};Object(m.a)(this,t);var n=e.id,i=void 0===n?Object($.c)("cone-geometry"):n,r=e.radius,a=void 0===r?1:r,o=e.cap,s=void 0===o||o;return Object(E.a)(this,Object(T.a)(t).call(this,Object(J.a)({},e,{id:i,topRadius:0,topCap:Boolean(s),bottomCap:Boolean(s),bottomRadius:a})))}return Object(M.a)(t,e),t}(te),ie=n(194),re=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(m.a)(this,t);var n=e.id,i=void 0===n?Object($.c)("cylinder-geometry"):n,r=e.radius,a=void 0===r?1:r;return Object(E.a)(this,Object(T.a)(t).call(this,Object(J.a)({},e,{id:i,bottomRadius:a,topRadius:a})))}return Object(M.a)(t,e),t}(te),ae=n(29),oe=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],se=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],ue=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(m.a)(this,t);var n=e.id,i=void 0===n?Object($.c)("ico-sphere-geometry"):n,r=function(e){var t=e.iterations,n=void 0===t?0:t,i=Math.PI,r=2*i,a=[].concat(oe),o=[].concat(se);a.push(),o.push();for(var s=function(){var e={};return function(t,n){var i=(t*=3)<(n*=3)?t:n,r=t>n?t:n,o="".concat(i,"|").concat(r);if(o in e)return e[o];var s=a[t],u=a[t+1],c=a[t+2],l=a[n],h=a[n+1],f=a[n+2],d=(s+l)/2,v=(u+h)/2,p=(c+f)/2,g=Math.sqrt(d*d+v*v+p*p);return d/=g,v/=g,p/=g,a.push(d,v,p),e[o]=a.length/3-1}}(),u=0;u=0;g-=3){var m=o[g+0],y=o[g+1],b=o[g+2],_=3*m,x=3*y,w=3*b,O=2*m,P=2*y,S=2*b,j=a[_+0],k=a[_+1],C=a[_+2],E=Math.acos(C/Math.sqrt(j*j+k*k+C*C)),T=Math.atan2(k,j)+i,A=E/i,M=1-T/r,L=a[x+0],I=a[x+1],R=a[x+2],F=Math.acos(R/Math.sqrt(L*L+I*I+R*R)),D=Math.atan2(I,L)+i,N=F/i,z=1-D/r,B=a[w+0],U=a[w+1],V=a[w+2],G=Math.acos(V/Math.sqrt(B*B+U*U+V*V)),W=Math.atan2(U,B)+i,H=G/i,X=1-W/r,q=[B-L,U-I,V-R],Z=[j-L,k-I,C-R],Y=new ae.a(q).cross(Z).normalize(),K=void 0;(0===M||0===z||0===X)&&(0===M||M>.5)&&(0===z||z>.5)&&(0===X||X>.5)&&(a.push(a[_+0],a[_+1],a[_+2]),K=a.length/3-1,o.push(K),p[2*K+0]=1,p[2*K+1]=A,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[x+0],a[x+1],a[x+2]),K=a.length/3-1,o.push(K),p[2*K+0]=1,p[2*K+1]=N,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z,a.push(a[w+0],a[w+1],a[w+2]),K=a.length/3-1,o.push(K),p[2*K+0]=1,p[2*K+1]=H,v[3*K+0]=Y.x,v[3*K+1]=Y.y,v[3*K+2]=Y.z),v[_+0]=v[x+0]=v[w+0]=Y.x,v[_+1]=v[x+1]=v[w+1]=Y.y,v[_+2]=v[x+2]=v[w+2]=Y.z,p[O+0]=M,p[O+1]=A,p[P+0]=z,p[P+1]=N,p[S+0]=X,p[S+1]=H}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(p)}}}}(e),a=r.indices,o=r.attributes;return Object(E.a)(this,Object(T.a)(t).call(this,Object(J.a)({},e,{id:i,indices:a,attributes:Object(J.a)({},o,e.attributes)})))}return Object(M.a)(t,e),t}(a.a);var ce=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(m.a)(this,t);var n=e.id,i=void 0===n?Object($.c)("plane-geometry"):n,r=function(e){var t=e.type,n=void 0===t?"x,y":t,i=e.offset,r=void 0===i?0:i,a=e.flipCull,o=void 0!==a&&a,s=e.unpack,u=void 0!==s&&s,c=n.split(","),l=e["".concat(c[0],"len")]||1,h=e["".concat(c[1],"len")]||1,f=e["n".concat(c[0])]||1,d=e["n".concat(c[1])]||1,v=(f+1)*(d+1),p=new Float32Array(3*v),g=new Float32Array(3*v),m=new Float32Array(2*v);o&&(l=-l);for(var y=0,b=0,_=0;_<=d;_++)for(var x=0;x<=f;x++){var w=x/f,O=_/d;switch(m[y+0]=o?1-w:w,m[y+1]=O,n){case"x,y":p[b+0]=l*w-.5*l,p[b+1]=h*O-.5*h,p[b+2]=r,g[b+0]=0,g[b+1]=0,g[b+2]=o?1:-1;break;case"x,z":p[b+0]=l*w-.5*l,p[b+1]=r,p[b+2]=h*O-.5*h,g[b+0]=0,g[b+1]=o?1:-1,g[b+2]=0;break;case"y,z":p[b+0]=r,p[b+1]=l*w-.5*l,p[b+2]=h*O-.5*h,g[b+0]=o?1:-1,g[b+1]=0,g[b+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}y+=2,b+=3}for(var P=f+1,S=new Uint16Array(f*d*6),j=0;j0&&void 0!==arguments[0]?arguments[0]:{};Object(m.a)(this,t);var n=e.id,i=void 0===n?Object($.c)("sphere-geometry"):n,r=function(e){var t=e.nlat,n=void 0===t?10:t,i=e.nlong,r=void 0===i?10:i,a=e.radius,o=void 0===a?1:a,s=Math.PI-0,u=2*Math.PI-0,c=(n+1)*(r+1);if("number"==typeof o){var l=o;o=function(e,t,n,i,r){return l}}for(var h=new Float32Array(3*c),f=new Float32Array(3*c),d=new Float32Array(2*c),v=new Uint16Array(n*r*6),p=0;p<=n;p++)for(var g=0;g<=r;g++){var m=g/r,y=p/n,b=g+p*(r+1),_=2*b,x=3*b,w=u*m,O=s*y,P=Math.sin(w),S=Math.cos(w),j=Math.sin(O),k=Math.cos(O),C=S*j,E=k,T=P*j,A=o(C,E,T,m,y);h[x+0]=A*C,h[x+1]=A*E,h[x+2]=A*T,f[x+0]=C,f[x+1]=E,f[x+2]=T,d[_+0]=m,d[_+1]=1-y}for(var M=n+1,L=0;L0&&void 0!==arguments[0]?arguments[0]:{};return Object(m.a)(this,t),(e=Object(E.a)(this,Object(T.a)(t).call(this,n))).projectionMatrix=n.projectionMatrix,e}return Object(M.a)(t,e),t}(de.a),me=n(28);n.d(t,"isWebGL",function(){return i.N}),n.d(t,"isWebGL2",function(){return i.O}),n.d(t,"lumaStats",function(){return i.S}),n.d(t,"createGLContext",function(){return i.A}),n.d(t,"destroyGLContext",function(){return i.B}),n.d(t,"resizeGLContext",function(){return i.V}),n.d(t,"setGLContextDefaults",function(){return i.X}),n.d(t,"getContextInfo",function(){return i.E}),n.d(t,"getGLContextInfo",function(){return i.H}),n.d(t,"getContextLimits",function(){return i.F}),n.d(t,"FEATURES",function(){return i.c}),n.d(t,"hasFeature",function(){return i.L}),n.d(t,"hasFeatures",function(){return i.M}),n.d(t,"getFeatures",function(){return i.G}),n.d(t,"canCompileGLGSExtension",function(){return i.t}),n.d(t,"cloneTextureFrom",function(){return i.w}),n.d(t,"getKeyValue",function(){return i.J}),n.d(t,"getKey",function(){return i.I}),n.d(t,"setContextDefaults",function(){return i.X}),n.d(t,"glGetDebugInfo",function(){return i.D}),n.d(t,"trackContextState",function(){return r.g}),n.d(t,"resetParameters",function(){return r.d}),n.d(t,"getParameter",function(){return r.b}),n.d(t,"getParameters",function(){return r.c}),n.d(t,"setParameter",function(){return r.e}),n.d(t,"setParameters",function(){return r.f}),n.d(t,"withParameters",function(){return r.h}),n.d(t,"getModifiedParameters",function(){return r.a}),n.d(t,"Buffer",function(){return i.b}),n.d(t,"Shader",function(){return i.i}),n.d(t,"VertexShader",function(){return i.q}),n.d(t,"FragmentShader",function(){return i.d}),n.d(t,"Program",function(){return i.f}),n.d(t,"Framebuffer",function(){return i.e}),n.d(t,"Renderbuffer",function(){return i.h}),n.d(t,"Texture2D",function(){return i.j}),n.d(t,"TextureCube",function(){return i.l}),n.d(t,"clear",function(){return i.u}),n.d(t,"clearBuffer",function(){return i.v}),n.d(t,"readPixelsToArray",function(){return i.T}),n.d(t,"readPixelsToBuffer",function(){return i.U}),n.d(t,"copyToDataUrl",function(){return i.x}),n.d(t,"copyToImage",function(){return i.y}),n.d(t,"copyToTexture",function(){return i.z}),n.d(t,"blit",function(){return i.s}),n.d(t,"Query",function(){return i.g}),n.d(t,"Texture3D",function(){return i.k}),n.d(t,"TransformFeedback",function(){return i.m}),n.d(t,"VertexArrayObject",function(){return i.p}),n.d(t,"VertexArray",function(){return i.o}),n.d(t,"UniformBufferLayout",function(){return i.n}),n.d(t,"setPathPrefix",function(){return i.Y}),n.d(t,"loadFile",function(){return i.P}),n.d(t,"loadImage",function(){return i.Q}),n.d(t,"_Accessor",function(){return i.a}),n.d(t,"_clearBuffer",function(){return i.v}),n.d(t,"Geometry",function(){return a.a}),n.d(t,"Material",function(){return o.a}),n.d(t,"AmbientLight",function(){return s.a}),n.d(t,"DirectionalLight",function(){return s.b}),n.d(t,"PointLight",function(){return s.c}),n.d(t,"AnimationLoop",function(){return u.a}),n.d(t,"encodePickingColor",function(){return h}),n.d(t,"decodePickingColor",function(){return f}),n.d(t,"getNullPickingColor",function(){return d}),n.d(t,"Model",function(){return v.a}),n.d(t,"Transform",function(){return p.a}),n.d(t,"ClipSpace",function(){return g.a}),n.d(t,"ProgramManager",function(){return x}),n.d(t,"_ShaderCache",function(){return w.a}),n.d(t,"_AnimationLoopProxy",function(){return C}),n.d(t,"_MultiPassRenderer",function(){return N}),n.d(t,"_RenderState",function(){return D}),n.d(t,"_Pass",function(){return R}),n.d(t,"_CompositePass",function(){return F}),n.d(t,"_ClearPass",function(){return z}),n.d(t,"_RenderPass",function(){return B}),n.d(t,"_CopyPass",function(){return V}),n.d(t,"_TexturePass",function(){return W}),n.d(t,"_ShaderModulePass",function(){return q}),n.d(t,"ConeGeometry",function(){return ne}),n.d(t,"CubeGeometry",function(){return ie.a}),n.d(t,"CylinderGeometry",function(){return re}),n.d(t,"IcoSphereGeometry",function(){return ue}),n.d(t,"PlaneGeometry",function(){return ce}),n.d(t,"SphereGeometry",function(){return le}),n.d(t,"TruncatedConeGeometry",function(){return te}),n.d(t,"PhongMaterial",function(){return he.a}),n.d(t,"PBRMaterial",function(){return fe}),n.d(t,"ScenegraphNode",function(){return de.a}),n.d(t,"GroupNode",function(){return ve.a}),n.d(t,"ModelNode",function(){return pe.a}),n.d(t,"CameraNode",function(){return ge}),n.d(t,"registerShaderModules",function(){return me.v}),n.d(t,"setDefaultShaderModules",function(){return me.w}),n.d(t,"getDefaultShaderModules",function(){return me.l}),n.d(t,"assembleShaders",function(){return me.c}),n.d(t,"createShaderHook",function(){return me.g}),n.d(t,"createModuleInjection",function(){return me.f}),n.d(t,"combineInjects",function(){return me.d}),n.d(t,"normalizeShaderModule",function(){return me.q}),n.d(t,"fp32",function(){return me.j}),n.d(t,"fp64",function(){return me.k}),n.d(t,"project",function(){return me.u}),n.d(t,"lights",function(){return me.p}),n.d(t,"dirlight",function(){return me.i}),n.d(t,"picking",function(){return me.t}),n.d(t,"diffuse",function(){return me.h}),n.d(t,"gouraudlighting",function(){return me.o}),n.d(t,"phonglighting",function(){return me.s}),n.d(t,"pbr",function(){return me.r}),n.d(t,"_transform",function(){return me.b}),n.d(t,"MODULAR_SHADERS",function(){return me.a}),n.d(t,"getQualifierDetails",function(){return me.n}),n.d(t,"getPassthroughFS",function(){return me.m}),n.d(t,"typeToChannelSuffix",function(){return me.y}),n.d(t,"typeToChannelCount",function(){return me.x}),n.d(t,"convertToVec4",function(){return me.e}),n.d(t,"log",function(){return i.R}),n.d(t,"assert",function(){return i.r}),n.d(t,"uid",function(){return i.Z}),n.d(t,"self",function(){return i.W}),n.d(t,"window",function(){return i.ab}),n.d(t,"global",function(){return i.K}),n.d(t,"document",function(){return i.C})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"deck.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.r(t);var i=n(32),r=n(152),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),h=n(3),f=n.n(h),d=n(7),v=n.n(d),p=n(148),g=n(153),m=function(e){function t(e){var n;return o()(this,t),(n=l()(this,f()(t).call(this,e))).projectedLight=new p.c(e),n}return v()(t,e),u()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,r=t.props,a=r.coordinateSystem,o=r.coordinateOrigin,s=Object(g.b)(this.position,{viewport:n,coordinateSystem:a,coordinateOrigin:o,fromCoordinateSystem:n.isGeospatial?i.a.LNGLAT:i.a.IDENTITY,fromCoordinateOrigin:[0,0,0]});return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=s,this.projectedLight}}]),t}(p.c),y=n(114),b=n(138),_=function(e){function t(){return o()(this,t),l()(this,f()(t).apply(this,arguments))}return v()(t,e),u()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer,n=t.context.viewport,i=t.props,r=i.coordinateSystem,a=i.coordinateOrigin,o=i.modelMatrix,s=Object(b.b)({viewport:n,modelMatrix:o,coordinateSystem:r,coordinateOrigin:a}).project_uCameraPosition;return this.projectedLight.color=this.color,this.projectedLight.intensity=this.intensity,this.projectedLight.position=s,this.projectedLight}}]),t}(m),x=n(230),w=n.n(x),O=Math.PI/180,P=864e5,S=2440588,j=2451545,k=23.4397*O,C=357.5291,E=.98560028,T=280.147,A=360.9856235;function M(e,t,n){var i,r,a,o,s,u,c=O*-n,l=O*t,h=function(e){return function(e){return e/P-.5+S}(e)-j}(e),f=(i=O*(C+E*h),r=O*(1.9148*Math.sin(i)+.02*Math.sin(2*i)+3e-4*Math.sin(3*i)),a=i+r+102.9372*O+Math.PI,{declination:(o=a,s=0,u=o,Math.asin(Math.sin(s)*Math.cos(k)+Math.cos(s)*Math.sin(k)*Math.sin(u))),rightAscension:L(a,0)}),d=function(e,t){return O*(T+A*e)-t}(h,c)-f.rightAscension;return{azimuth:I(d,l,f.declination),altitude:R(d,l,f.declination)}}function L(e,t){var n=e;return Math.atan2(Math.sin(n)*Math.cos(k)-Math.tan(t)*Math.sin(k),Math.cos(n))}function I(e,t,n){var i=e,r=t,a=n;return Math.atan2(Math.sin(i),Math.cos(i)*Math.sin(r)-Math.tan(a)*Math.cos(r))}function R(e,t,n){var i=e,r=t,a=n;return Math.asin(Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos(i))}var F=function(e){function t(e){var n,i=e.timestamp,r=w()(e,["timestamp"]);return o()(this,t),(n=l()(this,f()(t).call(this,r))).timestamp=i,n}return v()(t,e),u()(t,[{key:"getProjectedLight",value:function(e){var t=e.layer.context.viewport,n=t.latitude,i=t.longitude;return this.direction=function(e,t,n){var i=M(e,t,n),r=i.azimuth,a=i.altitude,o=r+Math.PI;return[-Math.sin(o),Math.cos(o),-Math.sin(a)]}(this.timestamp,n,i),this}}]),t}(y.a),D=n(151),N=n(103),z=n(197),B=n(167),U=n(170),V=n(132),G=n(196),W=n(174),H=n(44),X=n(166),q=n(85),Z=n(159),Y=n(54),K=n(165),Q=n(218),J=n(204),$=n(29),ee=n(68);var te=function(e){function t(){return o()(this,t),l()(this,f()(t).apply(this,arguments))}return v()(t,e),u()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.bearing,i=t.pitch,r=t.position,a=t.up,o=50*t.zoom,s=function(e){var t=e.bearing,n=e.pitch;return new J.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:n,pitch:i}).scale(-o).multiply(new $.a(1,1,-1)),u=(new ee.a).multiplyRight((new ee.a).lookAt({eye:s,center:r,up:a}));return new H.a(Object.assign({},e,{id:this.id,zoom:null,viewMatrix:u}))}}]),t}(Y.a);te.displayName="ThirdPersonView";var ne=n(219),ie=n(21),re=Math.PI/180,ae=function(e){function t(){return o()(this,t),l()(this,f()(t).apply(this,arguments))}return v()(t,e),u()(t,[{key:"_getViewport",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.viewState,o=a.eye,s=a.lookAt,u=void 0===s?[0,0,0]:s,c=a.up,l=void 0===c?[0,1,0]:c,h=e.fovy||a.fovy||75,f=e.near||a.near||1,d=e.far||a.far||100,v=Number.isFinite(a.aspect)?a.aspect:i/r,p=h*re;return new H.a({id:this.id,x:t,y:n,width:i,height:r,viewMatrix:ie.f([],o,u,l),projectionMatrix:ie.i([],p,v,f,d)})}}]),t}(Y.a);ae.displayName="PerspectiveView";var oe=n(220),se=n(84),ue=n(173),ce=n(168),le=n(131),he=n(169),fe=n(104),de=n(83),ve=n(82),pe=n(180),ge=n(22),me=n(56),ye=n(27),be=n(48),_e=.01,xe=["longitude","latitude","zoom"];var we=["bearing","pitch"],Oe=function(e){function t(){return o()(this,t),l()(this,f()(t).call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]}))}return v()(t,e),u()(t,[{key:"interpolateProps",value:function(e,t,n){for(var i=function(e,t,n){var i={},r=e.zoom,a=[e.longitude,e.latitude],o=Object(ye.l)(r),s=t.zoom,u=[t.longitude,t.latitude],c=Object(ye.l)(s-r),l=Object(ye.g)(a,o),h=Object(ye.g)(u,o),f=be.g([],h,l),d=Math.max(e.width,e.height),v=d/c,p=be.c(f);if(Math.abs(p)<_e){for(var g=0;g0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.attributes,i=void 0===n?{}:n;this.typedArrayManager=Ce.a,this.indexLayout=null,this.bufferLayout=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=i,this.updateGeometry(t),Object.seal(this)}return u()(e,[{key:"updateGeometry",value:function(e){var t=e.data,n=e.getGeometry,i=e.positionFormat,r=e.dataChanged;if(this.data=t,this.getGeometry=n,this.positionSize="XY"===i?2:3,Array.isArray(r)){var a=!0,o=!1,s=void 0;try{for(var u,c=r[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;this._rebuildGeometry(l)}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var t=e.startRow,n=e.endRow;this._rebuildGeometry({startRow:t,endRow:n})}},{key:"updateGeometryAttributes",value:function(e,t,n){throw new Error("Not implemented")}},{key:"getGeometrySize",value:function(e){throw new Error("Not implemented")}},{key:"_forEachGeometry",value:function(e,t,n){var i=this.data,r=this.getGeometry,a=Object(je.a)(i,t,n),o=a.iterable,s=a.objectInfo,u=!0,c=!1,l=void 0;try{for(var h,f=o[Symbol.iterator]();!(u=(h=f.next()).done);u=!0){var d=h.value;s.index++,e(r(d,s),s.index)}}catch(e){c=!0,l=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw l}}}},{key:"_rebuildGeometry",value:function(e){var t=this;if(this.data&&this.getGeometry){var n=this.indexLayout,i=this.bufferLayout;e||(n=[],i=[]);var r=e||{},a=r.startRow,o=void 0===a?0:a,s=r.endRow,u=void 0===s?1/0:s;this._forEachGeometry(function(e,n){i[n]=t.getGeometrySize(e)},o,u);var c=0,l=!0,h=!1,f=void 0;try{for(var d,v=i[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){c+=d.value}}catch(e){h=!0,f=e}finally{try{l||null==v.return||v.return()}finally{if(h)throw f}}var p=this.attributes,g=this._attributeDefs,m=this.typedArrayManager,y=this.fp64;for(var b in g){var _=g[b];_.copy=Boolean(e),_.fp64Only&&!y||(p[b]=m.allocate(p[b],c,_))}this.indexLayout=n,this.bufferLayout=i,this.instanceCount=c;for(var x={vertexStart:0,indexStart:0},w=0;w0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.opts=t}return u()(e,[{key:"equals",value:function(e){return this===e||this.constructor===e.constructor&&Object(Le.a)(this.opts,e.opts)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var t=e.constructor.defaultProps,n=void 0===t?{}:t,i={updateTriggers:{}};for(var r in n)if(r in this.props){var a=n[r],o=this.props[r];i[r]=o,a&&"accessor"===a.type&&(i.updateTriggers[r]=this.props.updateTriggers[r],"function"==typeof o&&(i[r]=this.getSubLayerAccessor(o,!0)))}return i}},{key:"initializeState",value:function(e,t){}},{key:"updateState",value:function(e,t){}},{key:"finalizeState",value:function(e){}}]),e}();n.d(t,"experimental",function(){return Re}),n.d(t,"COORDINATE_SYSTEM",function(){return i.a}),n.d(t,"LightingEffect",function(){return r.a}),n.d(t,"PointLight",function(){return m}),n.d(t,"DirectionalLight",function(){return y.a}),n.d(t,"_CameraLight",function(){return _}),n.d(t,"_SunLight",function(){return F}),n.d(t,"PostProcessEffect",function(){return D.a}),n.d(t,"_LayersPass",function(){return N.a}),n.d(t,"Deck",function(){return z.a}),n.d(t,"LayerManager",function(){return B.a}),n.d(t,"AttributeManager",function(){return U.a}),n.d(t,"Layer",function(){return V.a}),n.d(t,"CompositeLayer",function(){return G.a}),n.d(t,"DeckRenderer",function(){return W.a}),n.d(t,"Viewport",function(){return H.a}),n.d(t,"WebMercatorViewport",function(){return X.a}),n.d(t,"project",function(){return q.a}),n.d(t,"project64",function(){return Z.a}),n.d(t,"View",function(){return Y.a}),n.d(t,"MapView",function(){return K.a}),n.d(t,"FirstPersonView",function(){return Q.a}),n.d(t,"ThirdPersonView",function(){return te}),n.d(t,"OrbitView",function(){return ne.a}),n.d(t,"PerspectiveView",function(){return ae}),n.d(t,"OrthographicView",function(){return oe.a}),n.d(t,"Controller",function(){return se.a}),n.d(t,"MapController",function(){return ue.a}),n.d(t,"_FirstPersonController",function(){return ce.a}),n.d(t,"_OrbitController",function(){return le.b}),n.d(t,"_OrthographicController",function(){return he.a}),n.d(t,"Effect",function(){return fe.a}),n.d(t,"TRANSITION_EVENTS",function(){return de.a}),n.d(t,"LinearInterpolator",function(){return ve.a}),n.d(t,"FlyToInterpolator",function(){return Oe}),n.d(t,"log",function(){return Pe.a}),n.d(t,"createIterable",function(){return je.a}),n.d(t,"fp64LowPart",function(){return ke.c}),n.d(t,"AmbientLight",function(){return Me.AmbientLight}),n.d(t,"LayerExtension",function(){return Ie});var Re={Tesselator:Ee,flattenVertices:Se.c,fillArray:Se.a,count:Te.a,memoize:Ae.a}},function(e,t,n){"use strict";n.d(t,"p",function(){return r}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"n",function(){return c}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return h}),n.d(t,"l",function(){return f}),n.d(t,"m",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"d",function(){return p}),n.d(t,"i",function(){return g}),n.d(t,"h",function(){return m}),n.d(t,"f",function(){return y}),n.d(t,"b",function(){return b});var i=n(12);function r(e,t){if(e===t){var n=t[1],i=t[2],r=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=r,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function a(e,t){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],f=t[10],d=t[11],v=t[12],p=t[13],g=t[14],m=t[15],y=n*s-i*o,b=n*u-r*o,_=n*c-a*o,x=i*u-r*s,w=i*c-a*s,O=r*c-a*u,P=l*p-h*v,S=l*g-f*v,j=l*m-d*v,k=h*g-f*p,C=h*m-d*p,E=f*m-d*g,T=y*E-b*C+_*k+x*j-w*S+O*P;return T?(T=1/T,e[0]=(s*E-u*C+c*k)*T,e[1]=(r*C-i*E-a*k)*T,e[2]=(p*O-g*w+m*x)*T,e[3]=(f*w-h*O-d*x)*T,e[4]=(u*j-o*E-c*S)*T,e[5]=(n*E-r*j+a*S)*T,e[6]=(g*_-v*O-m*b)*T,e[7]=(l*O-f*_+d*b)*T,e[8]=(o*C-s*j+c*P)*T,e[9]=(i*j-n*C-a*P)*T,e[10]=(v*w-p*_+m*y)*T,e[11]=(h*_-l*w-d*y)*T,e[12]=(s*S-o*k-u*P)*T,e[13]=(n*k-i*S+r*P)*T,e[14]=(p*b-v*x-g*y)*T,e[15]=(l*x-h*b+f*y)*T,e):null}function o(e){var t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11],d=e[12],v=e[13],p=e[14],g=e[15];return(t*o-n*a)*(h*g-f*p)-(t*s-i*a)*(l*g-f*v)+(t*u-r*a)*(l*p-h*v)+(n*s-i*o)*(c*g-f*d)-(n*u-r*o)*(c*p-h*d)+(i*u-r*s)*(c*v-l*d)}function s(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],v=t[11],p=t[12],g=t[13],m=t[14],y=t[15],b=n[0],_=n[1],x=n[2],w=n[3];return e[0]=b*i+_*s+x*h+w*p,e[1]=b*r+_*u+x*f+w*g,e[2]=b*a+_*c+x*d+w*m,e[3]=b*o+_*l+x*v+w*y,b=n[4],_=n[5],x=n[6],w=n[7],e[4]=b*i+_*s+x*h+w*p,e[5]=b*r+_*u+x*f+w*g,e[6]=b*a+_*c+x*d+w*m,e[7]=b*o+_*l+x*v+w*y,b=n[8],_=n[9],x=n[10],w=n[11],e[8]=b*i+_*s+x*h+w*p,e[9]=b*r+_*u+x*f+w*g,e[10]=b*a+_*c+x*d+w*m,e[11]=b*o+_*l+x*v+w*y,b=n[12],_=n[13],x=n[14],w=n[15],e[12]=b*i+_*s+x*h+w*p,e[13]=b*r+_*u+x*f+w*g,e[14]=b*a+_*c+x*d+w*m,e[15]=b*o+_*l+x*v+w*y,e}function u(e,t,n){var i,r,a,o,s,u,c,l,h,f,d,v,p=n[0],g=n[1],m=n[2];return t===e?(e[12]=t[0]*p+t[4]*g+t[8]*m+t[12],e[13]=t[1]*p+t[5]*g+t[9]*m+t[13],e[14]=t[2]*p+t[6]*g+t[10]*m+t[14],e[15]=t[3]*p+t[7]*g+t[11]*m+t[15]):(i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],v=t[11],e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=h,e[9]=f,e[10]=d,e[11]=v,e[12]=i*p+s*g+h*m+t[12],e[13]=r*p+u*g+f*m+t[13],e[14]=a*p+c*g+d*m+t[14],e[15]=o*p+l*g+v*m+t[15]),e}function c(e,t,n){var i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function l(e,t,n,r){var a,o,s,u,c,l,h,f,d,v,p,g,m,y,b,_,x,w,O,P,S,j,k,C,E=r[0],T=r[1],A=r[2],M=Math.sqrt(E*E+T*T+A*A);return M1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===t?i.precision||4:t;return e=a(e),parseFloat(e.toPrecision(n))}function s(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&void 0!==e.length}function u(e,t){if(s(e)){for(var n=(r=e).clone?r.clone():new Array(r),i=0;i=-90&&a<=90,"invalid latitude");var o=a*h;return[(t*=d)*(r*h+c)/(2*c),t*(c-Math.log(Math.tan(l+.5*o)))/(2*c)]}function b(e,t){var n=Object(i.a)(e,2),r=n[0],a=n[1],o=r/(t*=d)*(2*c)-c,s=2*(Math.atan(Math.exp(c-a/t*(2*c)))-l);return[o*f,s*f]}function _(e){var t=e.latitude;Object(u.a)(Number.isFinite(t));var n=Math.cos(t*h);return m(v*n)-9}function x(e){var t=e.latitude,n=e.longitude,i=e.zoom,r=e.scale,a=e.highPrecision,o=void 0!==a&&a;r=void 0!==r?r:g(i),Object(u.a)(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(r));var s={},c=d*r,l=Math.cos(t*h),f=c/360,p=f/l,m=c/v/l;if(s.pixelsPerMeter=[m,-m,m],s.metersPerPixel=[1/m,-1/m,1/m],s.pixelsPerDegree=[f,-p,m],s.degreesPerPixel=[1/f,-1/p,1/m],o){var y=h*Math.tan(t*h)/l,b=f*y/2,_=c/v*y,x=_/p*m;s.pixelsPerDegree2=[0,-b,_],s.pixelsPerMeter2=[x,0,x]}return s}function w(e,t){var n=Object(i.a)(e,3),r=n[0],a=n[1],o=n[2],s=Object(i.a)(t,3),u=s[0],c=s[1],l=s[2],h=x({longitude:r,latitude:a,scale:1,highPrecision:!0}),f=h.pixelsPerMeter,d=h.pixelsPerMeter2,v=y(e,1);v[0]+=u*(f[0]+d[0]*c),v[1]+=c*(f[1]+d[1]*c);var p=b(v,1),g=(o||0)+(l||0);return Number.isFinite(o)||Number.isFinite(l)?[p[0],p[1],g]:p}function O(e){var t=e.height,n=e.pitch,i=e.bearing,o=e.altitude,u=e.center,c=void 0===u?null:u,l=e.flipY,f=void 0!==l&&l,d=Object(r.a)();return a.o(d,d,[0,0,-o]),a.n(d,d,[1,1,1/t]),a.k(d,d,-n*h),a.m(d,d,i*h),f&&a.n(d,d,[1,-1,1]),c&&a.o(d,d,s.h([],c)),d}function P(e){var t=e.width,n=e.height,i=e.altitude,r=void 0===i?p:i,a=e.pitch,o=void 0===a?0:a,s=e.nearZMultiplier,u=void 0===s?1:s,c=e.farZMultiplier,l=void 0===c?1:c,f=o*h,d=Math.atan(.5/r),v=Math.sin(d)*r/Math.sin(Math.PI/2-f-d),g=Math.cos(Math.PI/2-f)*v+r;return{fov:2*Math.atan(n/2/r),aspect:t/n,focalDistance:r,near:u,far:g*l}}function S(e){var t=e.width,n=e.height,i=e.pitch,r=P({width:t,height:n,altitude:e.altitude,pitch:i,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=r.fov,s=r.aspect,u=r.near,c=r.far;return a.i([],o,s,u,c)}function j(e,t){var n=Object(i.a)(e,3),a=n[0],o=n[1],s=n[2],c=void 0===s?0:s;return Object(u.a)(Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(c)),Object(r.d)(t,[a,o,c,1])}function k(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Object(i.a)(e,3),s=a[0],c=a[1],l=a[2];if(Object(u.a)(Number.isFinite(s)&&Number.isFinite(c),"invalid pixel coordinate"),Number.isFinite(l))return Object(r.d)(t,[s,c,l,1]);var h=Object(r.d)(t,[s,c,0,1]),f=Object(r.d)(t,[s,c,1,1]),d=h[2],v=f[2],p=d===v?0:((n||0)-d)/(v-d);return o.d([],h,f,p)}},function(e,t,n){"use strict";var i=n(110),r=n(134),a=n(149),o=n(142),s=n(125),u=n(209),c=n(224),l=n(68),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f={modelMatrix:h,viewMatrix:h,projectionMatrix:h,cameraPositionWorld:[0,0,0]};var d="varying vec4 project_vPositionWorld;\nvarying vec3 project_vNormalWorld;\n\nvec4 project_getPosition_World() {\n return project_vPositionWorld;\n}\n\nvec3 project_getNormal_World() {\n return project_vNormalWorld;\n}\n",v={name:"project",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],{});return void 0!==e.modelMatrix&&(t.modelMatrix=e.modelMatrix),void 0!==e.viewMatrix&&(t.viewMatrix=e.viewMatrix),void 0!==e.projectionMatrix&&(t.projectionMatrix=e.projectionMatrix),void 0!==e.cameraPositionWorld&&(t.cameraPositionWorld=e.cameraPositionWorld),void 0===e.projectionMatrix&&void 0===e.viewMatrix||(t.viewProjectionMatrix=new l.a(e.projectionMatrix).multiplyRight(e.viewMatrix)),t},vs:"".concat(d,"\nuniform mat4 modelMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewProjectionMatrix;\nuniform vec3 cameraPositionWorld;\n\nstruct World {\n vec3 position;\n vec3 normal;\n};\n\nWorld world;\n\nvoid project_setPosition(vec4 position) {\n project_vPositionWorld = position;\n}\n\nvoid project_setNormal(vec3 normal) {\n project_vNormalWorld = normal;\n}\n\nvoid project_setPositionAndNormal_World(vec3 position, vec3 normal) {\n world.position = position;\n world.normal = normal;\n}\n\nvoid project_setPositionAndNormal_Model(vec3 position, vec3 normal) {\n world.position = (modelMatrix * vec4(position, 1.)).xyz;\n world.normal = mat3(modelMatrix) * normal;\n}\n\nvec4 project_model_to_clipspace(vec4 position) {\n return viewProjectionMatrix * modelMatrix * position;\n}\n\nvec4 project_model_to_clipspace(vec3 position) {\n return viewProjectionMatrix * modelMatrix * vec4(position, 1.);\n}\n\nvec4 project_world_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_view_to_clipspace(vec3 position) {\n return projectionMatrix * vec4(position, 1.);\n}\n\nvec4 project_to_clipspace(vec3 position) {\n return viewProjectionMatrix * vec4(position, 1.);\n}\n"),fs:"\n".concat(d)},p=n(116),g={lightDirection:new Float32Array([1,1,2])};var m={name:"dirlight",vs:null,fs:"uniform vec3 dirlight_uLightDirection;\nvec4 dirlight_filterColor(vec4 color) {\n vec3 normal = project_getNormal_World();\n float d = abs(dot(normalize(normal), normalize(dirlight_uLightDirection)));\n return vec4(color.rgb * d, color.a);\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t={};return e.lightDirection&&(t.dirlight_uLightDirection=e.lightDirection),t},dependencies:[v]},y=n(210),b={diffuseTexture:null,diffuseColor:[.5,.5,.5,1]};var _={name:"diffuse",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t={};return void 0!==e.diffuseTexture&&(t.diffuse_uHasTexture=Boolean(e.diffuseTexture),t.diffuse_uTexture=e.diffuseTexture),void 0!==e.diffuseColor&&(t.diffuse_uColor=e.diffuseColor),t},vs:"out vec2 diffuse_vTexCoord;\nvoid diffuse_setTextureCoordinate(vec2 uv) {\n diffuse_vTexCoord = uv;\n}\n",fs:"uniform vec4 diffuse_uColor;\nuniform bool diffuse_uHasTexture;\nuniform sampler2D diffuse_uTexture;\n\nin vec2 diffuse_vTexCoord;\n\n\n\nvec4 diffuse_getColor() {\n vec2 texCoord = diffuse_vTexCoord;\n return diffuse_uHasTexture ?\n texture2D(diffuse_uTexture, vec2(texCoord.s, texCoord.t)) :\n diffuse_uColor;\n}\n\nvec4 diffuse_filterColor(vec4 color) {\n return diffuse_getColor();\n}\n"},x=n(192),w=n(223),O=n(211);n.d(t,"a",function(){return P}),n.d(t,"v",function(){return i.c}),n.d(t,"w",function(){return i.e}),n.d(t,"l",function(){return i.a}),n.d(t,"c",function(){return r.a}),n.d(t,"g",function(){return r.c}),n.d(t,"f",function(){return r.b}),n.d(t,"d",function(){return a.b}),n.d(t,"q",function(){return o.b}),n.d(t,"n",function(){return s.c}),n.d(t,"m",function(){return s.b}),n.d(t,"y",function(){return s.e}),n.d(t,"x",function(){return s.d}),n.d(t,"e",function(){return s.a}),n.d(t,"j",function(){return u.a}),n.d(t,"k",function(){return c.a}),n.d(t,"u",function(){return v}),n.d(t,"p",function(){return p.a}),n.d(t,"i",function(){return m}),n.d(t,"t",function(){return y.a}),n.d(t,"h",function(){return _}),n.d(t,"o",function(){return x.a}),n.d(t,"s",function(){return x.b}),n.d(t,"r",function(){return w.a}),n.d(t,"b",function(){return O.a});var P={vs:"#define SHADER_NAME luma_modular_vertex\n\n// object attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec4 colors;\nattribute vec2 texCoords;\nattribute vec3 pickingColors;\n\nvoid main(void) {\n\n // Set up position\n#ifdef MODULE_GEOMETRY\n geometry_setPosition(positions);\n geometry_setNormal(normals);\n#endif\n\n#ifdef MODULE_PROJECT\n project_setPositionAndNormal_Model(positions, normals);\n gl_Position = project_model_to_clipspace(positions);\n#endif\n\n // Set up depth\n#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n\n#ifdef MODULE_DIFFUSE\n diffuse_setTextureCoordinate(texCoords);\n#endif\n\n // Set up color calculations\n#ifdef MODULE_MATERIAL\n material_setDiffuseColor(colors);\n material_setDiffuseTextureCoordinates(texCoords);\n#endif\n\n#ifdef MODULE_LIGHTING\n lighting_setPositionAndNormal(positions, normals);\n lighting_apply_light(positions);\n lighting_apply_reflection(positions);\n#endif\n\n#ifdef MODULE_PICKING\n picking_setPickingColor(pickingColors);\n#endif\n\n}\n",fs:"#define SHADER_NAME luma-modular-fragment\n\nprecision highp float;\n\n// varyings\nvarying vec4 vColor;\n\nvoid main(){\n gl_FragColor = vec4(1., 0., 1., 1.);\n\n#ifdef MODULE_DIFFUSE\n gl_FragColor = diffuse_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth(gl_Position);\n#endif\n}\n",uniforms:{}}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(135),c=n(22),l=n(40),h=[0,0,0],f=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r,s),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"angle",value:function(e){return l.a(this,e)}},{key:"cross",value:function(e){return l.c(this,this,e),this.check()}},{key:"rotateX",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?h:n;return l.j(this,this,i,t),this.check()}},{key:"rotateY",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?h:n;return l.k(this,this,i,t),this.check()}},{key:"rotateZ",value:function(e){var t=e.radians,n=e.origin,i=void 0===n?h:n;return l.l(this,this,i,t),this.check()}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function d(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function v(e,t,n,i){var r=t[0],a=t[1],o=t[2],s=t[3];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e[3]=s+i*(n[3]-s),e}function p(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,e[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,e[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,e[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,e}function g(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function m(e,t){var n=e[0],r=e[1],a=e[2],o=e[3],s=t[0],u=t[1],c=t[2],l=t[3];return Math.abs(n-s)<=i.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-u)<=i.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(a-c)<=i.b*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var y,b;y=new i.a(4),i.a!=Float32Array&&(y[0]=0,y[1]=0,y[2]=0,y[3]=0),b=y},function(e,t,n){e.exports=n(262)()},,function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"g",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"n",function(){return h}),n.d(t,"j",function(){return f}),n.d(t,"k",function(){return d}),n.d(t,"l",function(){return v}),n.d(t,"a",function(){return p}),n.d(t,"m",function(){return m}),n.d(t,"f",function(){return y});var i=n(12);function r(){var e=new i.a(3);return i.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function a(e){var t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t,n){var r=new i.a(3);return r[0]=e,r[1]=t,r[2]=n,r}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function l(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[0],s=n[1],u=n[2];return e[0]=r*u-a*s,e[1]=a*o-i*u,e[2]=i*s-r*o,e}function h(e,t,n){var i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function f(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function d(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function v(e,t,n,i){var r=[],a=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function p(e,t){var n=o(e[0],e[1],e[2]),i=o(t[0],t[1],t[2]);u(n,n),u(i,i);var r=c(n,i);return r>1?0:r<-1?Math.PI:Math.acos(r)}var g,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},y=a;g=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="undefined"!=typeof window&&window.addEventListener,a=new Map,o=function(){return r&&window.__SEER_INITIALIZED__},s=function(e,t){var n=a.get(e),i=Date.now();return!!(n&&i-n1&&void 0!==arguments[1]?arguments[1]:{};if(r&&o()){var n=new Set,a=JSON.stringify(t,function(e){return function(t,n){if(!n||"object"!==(void 0===n?"undefined":i(n))||!e.has(n))return e.add(n),Object.prototype.toString.call(n).slice(8,-1).includes("Array")?Array.prototype.slice.call(n,0,20):n}}(n));try{window.postMessage({type:e,payload:a,source:"seer-agent"},"*")}catch(e){if(s("seer-log",2e3))return;console.log(e)}}},c=new Map,l=function(e){if(e&&e.data&&"seer-core"===e.data.source){var t=e.data,n=t.type,i=t.payload,r=c.get(n);r&&r.forEach(function(e){return e(i)})}},h=function(){r&&!window.__SEER_LISTENER__&&(window.addEventListener("message",l),window.__SEER_LISTENER__=!0)};t.default={send:u,throttle:s,isReady:o,list:function(e,t){return u("LIST",{key:e,data:t})},listItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u("LIST_ITEM",{key:e,itemKey:t,data:n})},updateItem:function(e,t,n,i){return u("UPDATE_ITEM",{key:e,itemKey:t,path:n,data:i})},multiUpdate:function(e,t,n){return u("MULTI_UPDATE_ITEM",{key:e,itemKey:t,array:n})},deleteItem:function(e,t){return u("DELETE_ITEM",{key:e,itemKey:t})},addLog:function(e,t,n){return u("ADD_LOG",{key:e,itemKey:t,msg:n})},listeners:c,listenFor:function(e,t){if(r){if(!e||!t)throw new Error("Please provide a type and callback");c.has(e)||c.set(e,[]),window.__SEER_LISTENER__||h(),c.get(e).push(t)}},removeListener:function(e){c.forEach(function(t,n){c.set(n,t.filter(function(t){return t!==e}))})},init:h,clean:function(){r&&window.__SEER_LISTENER__&&(window.removeEventListener("message",l),delete window.__SEER_LISTENER__)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i={LNG_LAT:1,LNGLAT_AUTO_OFFSET:4,METER_OFFSETS:2,LNGLAT_OFFSETS:3,IDENTITY:0}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(33),u=n(11),c=n(53),l=n(60),h=n(30),f=n(120),d=n(237),v=n(19),p=n(25),g={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"},m={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:g},y={removedProps:g},b=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,r))).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),n.target=r.target||(n.gl.webgl2?36662:34962),n.initialize(r),Object.seal(Object(s.a)(n)),n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"getElementCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerElement(e))}},{key:"getVertexCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.a.getBytesPerVertex(e))}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=Object(d.a)("Buffer",e,m),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data):this._setByteLength(e.byteLength||0),this}},{key:"setProps",value:function(e){return"accessor"in(e=Object(d.a)("Buffer",e,y))&&this.setAccessor(e.accessor),this}},{key:"setAccessor",value:function(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new l.a(e),this}},{key:"reallocate",value:function(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}},{key:"setData",value:function(e){return this.initialize(e)}},{key:"subData",value:function(e){ArrayBuffer.isView(e)&&(e={data:e});var t=e,n=t.data,i=t.offset,r=void 0===i?0:i,a=t.srcOffset,o=void 0===a?0:a,s=e.byteLength||e.length;Object(v.a)(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==o||void 0!==s?(Object(h.a)(this.gl),this.gl.bufferSubData(this.target,r,n,o,s)):this.gl.bufferSubData(u,r,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(e){var t=e.sourceBuffer,n=e.readOffset,i=void 0===n?0:n,r=e.writeOffset,a=void 0===r?0:r,o=e.size,s=this.gl;return Object(h.a)(s),s.bindBuffer(36662,t.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,i,a,o),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dstData,n=void 0===t?null:t,i=e.srcByteOffset,r=void 0===i?0:i,a=e.dstOffset,o=void 0===a?0:a,s=e.length,u=void 0===s?0:s;Object(h.a)(this.gl);var c,l,d=Object(f.c)(this.accessor.type||5126,{clamped:!1}),p=this._getAvailableElementCount(r),g=o;n?c=(l=n.length)-g:l=g+(c=Math.min(p,u||p));var m=Math.min(p,c);return u=u||m,Object(v.a)(u<=m),n=n||new d(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,r,n,o,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i,a=e.offset,o=void 0===a?0:a,s=e.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,r,this.handle,o,s):(Object(v.a)(0===o),this.gl.bindBufferBase(n,r,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target,n=void 0===t?this.target:t,i=e.index,r=void 0===i?this.accessor&&this.accessor.index:i;return 35345===n||35982===n?this.gl.bindBufferBase(n,r,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,e,t),this.gl.bindBuffer(n,null),this.usage=t,this.debugData=e.slice(0,10),this.bytesUsed=e.byteLength,this._trackAllocatedMemory(e.byteLength);var i=Object(f.b)(e);return Object(v.a)(i),this.setAccessor(new l.a(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(v.a)(e>=0),this._trackDeallocatedMemory();var n=e;0===e&&(n=new Float32Array(0));var i=this._getTarget();return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,t),this.gl.bindBuffer(i,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(e){var t=e/Object(f.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-t}},{key:"_inferType",value:function(e){this.accessor.type||this.setAccessor(new l.a(this.accessor,{type:Object(f.b)(e)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(e){this.gl.bindBuffer(this.target,this.handle);var t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}},{key:"setByteLength",value:function(e){return p.a.deprecated("setByteLength","reallocate")(),this.reallocate(e)}},{key:"updateAccessor",value:function(e){return p.a.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new l.a(this.accessor,e),this}},{key:"type",get:function(){return p.a.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return p.a.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(15),l=n(61),h=n(22),f=n(68),d=n(29),v=n(21),p=n(27),g=n(18),m=Math.PI/180,y=Object(l.a)(),b=[0,0,0],_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,c=t.width,l=void 0===c?1:c,h=t.height,f=void 0===h?1:h;this.id=i||this.constructor.displayName||"viewport",this.x=a,this.y=u,this.width=l||1,this.height=f||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),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),this.getMatrices=this.getMatrices.bind(this)}return u()(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&t.scale===this.scale&&Object(h.e)(t.projectionMatrix,this.projectionMatrix)&&Object(h.e)(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),a=Object(p.k)(i,this.pixelProjectionMatrix),o=r()(a,2),s=o[0],u=o[1],c=n?u:this.height-u;return 2===e.length?[s,c]:[s,c,a[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,a=t.targetZ,o=r()(e,3),s=o[0],u=o[1],c=o[2],l=i?u:this.height-u,h=a&&a*this.distanceScales.pixelsPerMeter[2],f=Object(p.h)([s,l,c],this.pixelUnprojectionMatrix,h),d=this.unprojectPosition(f),v=r()(d,3),g=v[0],m=v[1],y=v[2];return Number.isFinite(c)?[g,m,y]:Number.isFinite(a)?[g,m,a]:[g,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.pixelsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=r()(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerPixel[2]]}},{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(p.g)(e,t);var n=this.distanceScales.pixelsPerMeter;return[e[0]*n[0],e[1]*n[1]]}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;if(this.isGeospatial)return Object(p.j)(e,t);var n=this.distanceScales.metersPerPixel;return[e[0]*n[0],e[1]*n[1]]}},{key:"getDistanceScales",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?Object(p.b)({longitude:e[0],latitude:e[1],scale:this.scale,highPrecision:!0}):this.distanceScales}},{key:"getMatrices",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modelMatrix,t=void 0===e?null:e,n=this.viewProjectionMatrix,i=this.pixelProjectionMatrix,r=this.pixelUnprojectionMatrix;return t&&(n=v.g([],this.viewProjectionMatrix,t),i=v.g([],this.pixelProjectionMatrix,t),r=v.e([],i)),Object.assign({modelViewProjectionMatrix:n,viewProjectionMatrix:this.viewProjectionMatrix,viewMatrix:this.viewMatrix,projectionMatrix:this.projectionMatrix,pixelProjectionMatrix:i,pixelUnprojectionMatrix:r,width:this.width,height:this.height,scale:this.scale})}},{key:"containsPixel",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a;return t1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),Object(o.b)(t);var r=n.id,a=n.userData,s=void 0===a?{}:a;this.gl=t,this.id=r||Object(u.c)(this.constructor.name),this.userData=s,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return Object(r.a)(e,[{key:"toString",value:function(){return"".concat(this.constructor.name,"(").concat(this.id,")")}},{key:"delete",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,t=void 0!==e&&e,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&t&&n.filter(Boolean).forEach(function(e){e.delete()}),this}},{key:"bind",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof t?(this._bindHandle(t),this):(this._bound?e=t():(this._bindHandle(this.handle),this._bound=!0,e=t(),this._bound=!1,this._bindHandle(null)),e)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var r=n.webgl1,a="webgl2"in n?n.webgl2:n.webgl1;return i?a:r}}return this._getParameter(e,t)}},{key:"getParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=t.parameters,i=t.keys,r=this.constructor.PARAMETERS||{},a=Object(o.d)(this.gl),u={},c=n||Object.keys(r),l=!0,h=!1,f=void 0;try{for(var d,v=c[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var p=d.value,g=r[p];if(g&&(!("webgl2"in g)||a)&&(!("extension"in g)||this.gl.getExtension(g.extension))){var m=i?Object(s.a)(this.gl,p):p;u[m]=this.getParameter(p,e),i&&"GLenum"===g.type&&(u[m]=Object(s.a)(this.gl,u[m]))}}}catch(e){h=!0,f=e}finally{try{l||null==v.return||v.return()}finally{if(h)throw f}}return u}},{key:"setParameter",value:function(e,t){e=Object(s.b)(this.gl,e),Object(c.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var i=Object(o.d)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Object(s.b)(t))}return this._setParameter(e,t),this}},{key:"setParameters",value:function(e){for(var t in e)this.setParameter(t,e[t]);return this}},{key:"stubRemovedMethods",value:function(e,t,n){return Object(l.a)(this,e,t,n)}},{key:"initialize",value:function(e){}},{key:"_createHandle",value:function(){throw new Error(h)}},{key:"_deleteHandle",value:function(){throw new Error(h)}},{key:"_bindHandle",value:function(){throw new Error(h)}},{key:"_getOptsFromHandle",value:function(){throw new Error(h)}},{key:"_getParameter",value:function(e,t){throw new Error(h)}},{key:"_setParameter",value:function(e,t){throw new Error(h)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var e=this.constructor.name,t=a.a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get("".concat(e,"s Created")).incrementCount(),t.get("".concat(e,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var e=this.constructor.name;a.a.get("Resource Counts").get("".concat(e,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.name,n=a.a.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get("".concat(t," Memory")).addCount(e),this.byteLength=e}},{key:"_trackDeallocatedMemory",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.constructor.name,t=a.a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get("".concat(e," Memory")).subtractCount(this.byteLength),this.byteLength=0}},{key:"handle",get:function(){return this._handle}}]),e}()},function(e,t,n){"use strict";var i=n(31),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(44),l=/([0-9]+\.?[0-9]*)(%|px)/;function h(e){switch(r()(e)){case"number":return{position:e,relative:!1};case"string":var t=e.match(l);if(t&&t.length>=3){var n="%"===t[2],i=parseFloat(t[1]);return{position:n?i/100:i,relative:n}}default:throw new Error("Could not parse position string ".concat(e))}}function f(e,t){return e.relative?Math.round(e.position*t):e.position}var d=n(106),v=n(18);n.d(t,"a",function(){return p});var p=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e);var n=t.id,i=void 0===n?null:n,r=t.x,a=void 0===r?0:r,s=t.y,u=void 0===s?0:s,l=t.width,h=void 0===l?"100%":l,f=t.height,d=void 0===f?"100%":f,p=t.projectionMatrix,g=void 0===p?null:p,m=t.fovy,y=void 0===m?50:m,b=t.near,_=void 0===b?.1:b,x=t.far,w=void 0===x?1e3:x,O=t.modelMatrix,P=void 0===O?null:O,S=t.viewportInstance,j=void 0===S?null:S,k=t.type,C=void 0===k?c.a:k;Object(v.a)(!j||j instanceof c.a),this.viewportInstance=j,this.id=i||this.constructor.displayName||"view",this.type=C,this.props=Object.assign({},t,{id:this.id,projectionMatrix:g,fovy:y,near:_,far:w,modelMatrix:P}),this._parseDimensions({x:a,y:u,width:h,height:d}),this.equals=this.equals.bind(this),Object.seal(this)}return u()(e,[{key:"equals",value:function(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(d.a)(this.props,e.props))}},{key:"makeViewport",value:function(e){var t=e.width,n=e.height,i=e.viewState;if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);var r=this.getDimensions({width:t,height:n}),a=Object.assign({viewState:i},i,this.props,r);return this._getViewport(a)}},{key:"getViewStateId",value:function(){switch(r()(this.props.viewState)){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}},{key:"filterViewState",value:function(e){if(this.props.viewState&&"object"===r()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var t=Object.assign({},e);for(var n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}},{key:"getDimensions",value:function(e){var t=e.width,n=e.height;return{x:f(this._x,t),y:f(this._y,n),width:f(this._width,t),height:f(this._height,n)}}},{key:"_getControllerProps",value:function(e){var t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),Object.assign({},e,t)):null}},{key:"_getViewport",value:function(e){return new(0,this.type)(e)}},{key:"_parseDimensions",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._x=h(t),this._y=h(n),this._width=h(i),this._height=h(r)}}]),e}()},function(e,t,n){"use strict";(function(e,i){n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var r=n(35),a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===i?"undefined":Object(r.a)(i))&&i},o=a.window||a.self||a.global,s=a.process||{};console}).call(this,n(79),n(88))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"b",function(){return s});var i=n(37);function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(e,t){var n=i.n([],t,e);return i.k(n,n,1/n[3]),n}function o(e,t){var n=e%t;return n<0?t+n:n}function s(e,t,n){return n*t+(1-n)*e}},function(e,t,n){"use strict";n.d(t,"a",function(){return b});var i=n(0),r=n(4),a=n(10),o=n(9),s=n(5),u=n(11),c=n(53),l=n(43),h=n(98),f=n(73),d=n(30),v=n(50),p=n(70),g=n(25),m=n(19),y=[9729,9728],b=function(e){function t(e,n){var i;Object(r.a)(this,t);var s=n.id,u=void 0===s?Object(p.c)("texture"):s,c=n.handle,l=n.target;return(i=Object(a.a)(this,Object(o.a)(t).call(this,e,{id:u,handle:c}))).target=l,i.textureUnit=void 0,i.loaded=!1,i.width=void 0,i.height=void 0,i.depth=void 0,i.format=void 0,i.type=void 0,i.dataFormat=void 0,i.border=void 0,i.textureUnit=void 0,i.mipmaps=void 0,i}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.format,i=t.linearFiltering,r=!0;return n&&(r=(r=r&&Object(h.d)(e,n))&&(!i||Object(h.e)(e,n))),r}}]),Object(s.a)(t,[{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data;if(n instanceof Promise)return n.then(function(n){return e.initialize(Object.assign({},t,{pixels:n,data:n}))}),this;var r=t.pixels,a=void 0===r?null:r,o=t.format,s=void 0===o?6408:o,u=t.border,c=void 0===u?0:u,l=t.recreate,h=void 0!==l&&l,f=t.parameters,d=void 0===f?{}:f,v=t.pixelStore,p=void 0===v?{}:v,m=t.textureUnit,y=void 0===m?void 0:m,b=t.unpackFlipY,_=void 0===b||b,x=t.mipmaps,w=void 0===x||x;n||(n=a);var O=t.width,P=t.height,S=t.dataFormat,j=t.type,k=t.depth,C=void 0===k?0:k,E=this._deduceParameters({format:s,type:j,dataFormat:S,compressed:!1,data:n,width:O,height:P});O=E.width,P=E.height,S=E.dataFormat,j=E.type,this.width=O,this.height=P,this.depth=C,this.format=s,this.type=j,this.dataFormat=S,this.border=c,this.textureUnit=y,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle));var T=Object(i.a)({},37440,_),A=Object.assign({},T,p);return w&&this._isNPOT()&&(g.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),w=!1,this._updateForNPOT(d)),this.mipmaps=w,this.setImageData({data:n,width:O,height:P,depth:C,format:s,type:j,dataFormat:S,border:c,mipmaps:w,parameters:A}),w&&this.generateMipmap(),this.setParameters(d),h&&(this.data=n),this}},{key:"resize",value:function(e){var t=e.height,n=e.width,i=e.mipmaps,r=void 0!==i&&i;return n!==this.width||t!==this.height?this.initialize({width:n,height:t,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}},{key:"generateMipmap",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(g.a.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(f.a)(this.gl,t,function(){e.gl.generateMipmap(e.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(e){this._trackDeallocatedMemory("Texture");var t=e.target,n=void 0===t?this.target:t,i=e.pixels,r=void 0===i?null:i,a=e.level,o=void 0===a?0:a,s=e.format,u=void 0===s?this.format:s,c=e.border,l=void 0===c?this.border:c,v=e.offset,p=void 0===v?0:v,g=e.parameters,y=void 0===g?{}:g,b=e.data,_=void 0===b?null:b,x=e.type,w=void 0===x?this.type:x,O=e.width,P=void 0===O?this.width:O,S=e.height,j=void 0===S?this.height:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,T=void 0!==E&&E;_||(_=r);var A=this._deduceParameters({format:u,type:w,dataFormat:C,compressed:T,data:_,width:P,height:j});w=A.type,C=A.dataFormat,T=A.compressed,P=A.width,j=A.height;var M=this.gl;M.bindTexture(this.target,this.handle);var L,I=this._getDataType({data:_,compressed:T});if(_=I.data,L=I.dataType,Object(f.a)(this.gl,y,function(){switch(L){case"null":M.texImage2D(n,o,u,P,j,l,C,w,_);break;case"typed-array":M.texImage2D(n,o,u,P,j,l,C,w,_,p);break;case"buffer":Object(d.a)(M),M.bindBuffer(35052,_.handle||_),M.texImage2D(n,o,u,P,j,l,C,w,p),M.bindBuffer(35052,null);break;case"browser-object":Object(d.d)(M)?M.texImage2D(n,o,u,P,j,l,C,w,_):M.texImage2D(n,o,u,C,w,_);break;case"compressed":M.compressedTexImage2D(n,o,u,P,j,l,_);break;default:Object(m.a)(!1,"Unknown image data type")}}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var R=h.a[this.dataFormat]||4,F=h.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*F,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(e){var t=this,n=e.target,i=void 0===n?this.target:n,r=e.pixels,a=void 0===r?null:r,o=e.data,s=void 0===o?null:o,u=e.x,c=void 0===u?0:u,h=e.y,p=void 0===h?0:h,g=e.width,y=void 0===g?this.width:g,b=e.height,_=void 0===b?this.height:b,x=e.level,w=void 0===x?0:x,O=e.format,P=void 0===O?this.format:O,S=e.type,j=void 0===S?this.type:S,k=e.dataFormat,C=void 0===k?this.dataFormat:k,E=e.compressed,T=void 0!==E&&E,A=e.offset,M=void 0===A?0:A,L=e.border,I=(void 0===L&&this.border,e.parameters),R=void 0===I?{}:I,F=this._deduceParameters({format:P,type:j,dataFormat:C,compressed:T,data:s,width:y,height:_});if(j=F.type,C=F.dataFormat,T=F.compressed,y=F.width,_=F.height,Object(m.a)(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=a),s&&s.data){var D=s;s=D.data,y=D.shape[0],_=D.shape[1]}s instanceof l.a&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),Object(f.a)(this.gl,R,function(){T?t.gl.compressedTexSubImage2D(i,w,c,p,y,_,P,s):null===s?t.gl.texSubImage2D(i,w,c,p,y,_,C,j,null):ArrayBuffer.isView(s)?t.gl.texSubImage2D(i,w,c,p,y,_,C,j,s,M):s instanceof v.b?(Object(d.a)(t.gl),t.gl.bindBuffer(35052,s),t.gl.texSubImage2D(i,w,c,p,y,_,C,j,M),t.gl.bindBuffer(35052,null)):Object(d.d)(t.gl)?t.gl.texSubImage2D(i,w,c,p,y,_,C,j,s):t.gl.texSubImage2D(i,w,c,p,C,j,s)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return g.a.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}},{key:"unbind",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,t=this.gl;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}},{key:"_getDataType",value:function(e){var t=e.data,n=e.compressed;return void 0!==n&&n?{data:t,dataType:"compressed"}:null===t?{data:t,dataType:"null"}:ArrayBuffer.isView(t)?{data:t,dataType:"typed-array"}:t instanceof l.a?{data:t.handle,dataType:"buffer"}:t instanceof v.b?{data:t,dataType:"buffer"}:{data:t,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(e){var t=e.format,n=e.data,i=e.width,r=e.height,a=e.dataFormat,o=e.type,s=e.compressed,u=h.b[t];a=a||u&&u.dataFormat,o=o||u&&u.types[0],s=s||u&&u.compressed;var c=this._deduceImageSize(n,i,r);return{dataFormat:a,type:o,compressed:s,width:i=c.width,height:r=c.height,format:t,data:n}}},{key:"_deduceImageSize",value:function(e,t,n){var i;return i="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement?{width:e.width,height:e.height}:"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:n}:{width:t>=0?t:1,height:n>=0?n:1},Object(m.a)(i,"Could not deduced texture size"),Object(m.a)(void 0===t||i.width===t,"Deduced texture width does not match supplied width"),Object(m.a)(void 0===n||i.height===n,"Deduced texture height does not match supplied height"),i}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}},{key:"_setParameter",value:function(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Object(m.a)(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!Object(d.d)(this.gl)&&(!(!this.width||!this.height)&&(!Object(p.b)(this.width)||!Object(p.b)(this.height)))}},{key:"_updateForNPOT",value:function(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(e,t){if(this._isNPOT())switch(e){case 10241:-1===y.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}]),t}(c.a)},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(78);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function o(e){for(var t=1;t0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}n.d(t,"a",function(){return s}),n.d(t,"b",function(){return u})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(36),r=n(4),a=n(5),o=n(70),s=n(19),u={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,e);var n=t.id,i=void 0===n?Object(o.c)("geometry"):n,a=t.drawMode,s=void 0===a?u.TRIANGLES:a,c=t.attributes,l=void 0===c?{}:c,h=t.indices,f=void 0===h?null:h,d=t.vertexCount,v=void 0===d?null:d;this.id=i,this.drawMode=0|s,this.attributes={},this.userData={},this._setAttributes(l,f),this.vertexCount=v||this._calculateVertexCount(this.attributes,this.indices)}return Object(a.a)(e,null,[{key:"DRAW_MODE",get:function(){return u}}]),Object(a.a)(e,[{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?Object(i.a)({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,t){for(var n in t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t),e){var i=e[n];i=ArrayBuffer.isView(i)?{value:i}:i,Object(s.a)(ArrayBuffer.isView(i.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||i.size||(i.size=3),"indices"===n?(Object(s.a)(!this.indices),this.indices=i):this.attributes[n]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,t){if(t)return t.value.length;var n=1/0;for(var i in e){var r=e[i],a=r.value,o=r.size;!r.constant&&a&&o>=1&&(n=Math.min(n,a.length/o))}return Object(s.a)(Number.isFinite(n)),n}},{key:"mode",get:function(){return this.drawMode}}]),e}()},function(e,t,n){"use strict";var i=n(177);function r(e,t,n){return(r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Object(i.a)(a,n.prototype),a}).apply(null,arguments)}var a=n(4),o=n(5),s=n(120),u=n(19),c=n(237);n.d(t,"a",function(){return f});var l={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},h={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},f=function(){function e(){var t=this;Object(a.a)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(e=Object(c.a)("Accessor",e,h)).type&&(this.type=e.type,5124!==e.type&&5125!==e.type||(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&("boolean"==typeof index?this.index=e.index?1:0:this.index=e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}},{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"d",function(){return p}),n.d(t,"c",function(){return g}),n.d(t,"e",function(){return m});var i=n(118),r=n(29);function a(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o(e){var t=e.viewMatrix,n=e.viewMatrixInverse;return{eye:[n[12],n[13],n[14]],direction:[-t[2],-t[6],-t[10]],up:[t[1],t[5],t[9]],right:[t[0],t[4],t[8]]}}var s,u=new r.a,c=new r.a,l=new r.a,h=new r.a,f=new r.a,d=new r.a,v=new r.a;function p(e){var t=e.aspect,n=e.near,i=e.far,a=e.fovyRadians,o=e.position,s=e.direction,p=e.up,g=e.right;c.copy(s);var m=1/c.len();c.normalize(),u.copy(o),l.copy(p).normalize(),h.copy(g).normalize();var y=2*Math.tan(a/2)*n,b=y*t;f.copy(c).scale(n*m).add(u),d.copy(c).scale(i*m).add(u);var _=c.clone().negate(),x=_.dot(f),w={near:{distance:x,normal:_},far:{distance:c.dot(d),normal:c.clone()}};return v.copy(h).scale(.5*b).add(f).subtract(u).normalize(),_=new r.a(l).cross(v),x=u.dot(_),w.right={normal:_,distance:x},v.copy(h).scale(.5*-b).add(f).subtract(u).normalize(),_=new r.a(v).cross(l),x=u.dot(_),w.left={normal:_,distance:x},v.copy(l).scale(.5*y).add(f).subtract(u).normalize(),_=new r.a(v).cross(h),x=u.dot(_),w.top={normal:_,distance:x},v.copy(l).scale(.5*-y).add(f).subtract(u).normalize(),_=new r.a(h).cross(v),x=u.dot(_),w.bottom={normal:_,distance:x},w}function g(e){return e-Math.fround(e)}function m(e,t){var n=t.size,r=void 0===n?1:n,a=t.startIndex,o=void 0===a?0:a,u=t.endIndex;Number.isFinite(u)||(u=e.length);var c=(u-o)/r;s=i.a.allocate(s,c,{type:Float32Array,size:2*r});for(var l=o,h=0;l1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(this,t),(n=Object(o.a)(this,Object(u.a)(t).call(this,e,i))).width=null,n.height=null,n.attachments={},n.readBuffer=36064,n.drawBuffers=[36064],n.ownResources=[],n.initialize(i),Object.seal(Object(s.a)(n)),n}return Object(h.a)(t,e),Object(l.a)(t,[{key:"MAX_COLOR_ATTACHMENTS",get:function(){return this.gl.getParameter(this.gl.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){return this.gl.getParameter(this.gl.MAX_DRAW_BUFFERS)}}],[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.colorBufferFloat,i=t.colorBufferHalfFloat;return n&&e.getExtension(Object(y.d)(e)?"EXT_color_buffer_float":"WEBGL.color_buffer_float"),i&&e.getExtension(Object(y.d)(e)?"EXT_color_buffer_float":"EXT_color_buffer_half_float")}},{key:"getDefaultFramebuffer",value:function(e){return e.luma=e.luma||{},e.luma.defaultFramebuffer=e.luma.defaultFramebuffer||new t(e,{id:"default-framebuffer",handle:null,attachments:{}}),e.luma.defaultFramebuffer}}]),Object(l.a)(t,[{key:"initialize",value:function(e){var t=e.width,n=void 0===t?1:t,i=e.height,r=void 0===i?1:i,a=e.attachments,o=void 0===a?null:a,s=e.color,u=void 0===s||s,c=e.depth,l=void 0===c||c,h=e.stencil,f=void 0!==h&&h,d=e.check,v=void 0===d||d,p=e.readBuffer,g=e.drawBuffers;if(Object(_.a)(n>=0&&r>=0,"Width and height need to be integers"),this.width=n,this.height=r,o)for(var m in o){var y=o[m];(Array.isArray(y)?y[0]:y).resize({width:n,height:r})}else o=this._createDefaultAttachments(u,l,f,n,r);this.update({clearAttachments:!0,attachments:o,readBuffer:p,drawBuffers:g}),o&&v&&this.checkStatus()}},{key:"delete",value:function(){var e=!0,n=!1,i=void 0;try{for(var r,a=this.ownResources[Symbol.iterator]();!(e=(r=a.next()).done);e=!0){r.value.delete()}}catch(e){n=!0,i=e}finally{try{e||null==a.return||a.return()}finally{if(n)throw i}}Object(c.a)(Object(u.a)(t.prototype),"delete",this).call(this)}},{key:"update",value:function(e){var t=e.attachments,n=void 0===t?{}:t,i=e.readBuffer,r=e.drawBuffers,a=e.clearAttachments,o=void 0!==a&&a,s=e.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:o,resizeAttachments:u});var c=this.gl,l=c.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),r&&this._setDrawBuffers(r),c.bindFramebuffer(36160,l||null),this}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height;if(null===this.handle)return Object(_.a)(void 0===t&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var i in void 0===t&&(t=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),t!==this.width&&n!==this.height&&x.a.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(t,"x").concat(n))(),this.attachments)this.attachments[i].resize({width:t,height:n});return this.width=t,this.height=n,this}},{key:"attach",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.clearAttachments,a=void 0!==i&&i,o=n.resizeAttachments,s=void 0===o||o,u={};a&&Object.keys(this.attachments).forEach(function(e){u[e]=null}),Object.assign(u,e);var c=this.gl.bindFramebuffer(36160,this.handle);for(var l in u){Object(_.a)(void 0!==l,"Misspelled framebuffer binding point?");var h=Number(l),f=u[h],d=f;if(d)if(d instanceof v.a)this._attachRenderbuffer({attachment:h,renderbuffer:d});else if(Array.isArray(f)){var p=Object(r.a)(f,3),g=p[0],m=p[1],y=void 0===m?0:m,b=p[2],x=void 0===b?0:b;d=g,this._attachTexture({attachment:h,texture:g,layer:y,level:x})}else this._attachTexture({attachment:h,texture:d,layer:0,level:0});else this._unattach(h);s&&d&&d.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,c||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(function(e){return!t.attachments[e]}).forEach(function(e){delete t.attachments[e]})}},{key:"checkStatus",value:function(){var e=this.gl,t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);if(e.bindFramebuffer(36160,t||null),36053!==n)throw new Error(O(n));return this}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=e.depth,i=e.stencil,r=e.drawBuffers,a=void 0===r?[]:r,o=this.gl.bindFramebuffer(36160,this.handle);return(t||n||i)&&Object(p.a)(this.gl,{color:t,depth:n,stencil:i}),a.forEach(function(e,t){Object(p.b)({drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,o||null),this}},{key:"readPixels",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return x.a.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return x.a.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return x.a.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return x.a.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return x.a.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return x.a.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(e){var t=e.attachments,n=void 0===t?[]:t,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.width,u=e.height,c=this.gl;Object(y.a)(c);var l=c.bindFramebuffer(36008,this.handle);return 0===r&&0===o&&void 0===s&&void 0===u?c.invalidateFramebuffer(36008,n):c.invalidateFramebuffer(36008,n,r,o,s,u),c.bindFramebuffer(36008,l),this}},{key:"getAttachmentParameter",value:function(e,t,n){var i=this._getAttachmentParameterFallback(t);return null===i&&(this.gl.bindFramebuffer(36160,this.handle),i=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),n&&i>1e3&&(i=Object(b.a)(this.gl,i)),i}},{key:"getAttachmentParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[t?Object(b.a)(this.gl,c):c]=this.getAttachmentParameter(e,c,t)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}},{key:"getParameters",value:function(){for(var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={},n=0,i=Object.keys(this.attachments);n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e>x.a.priority||"undefined"==typeof window)return this;t=t||"Framebuffer ".concat(this.id);var n=Object(g.b)(this,{maxHeight:100});return x.a.image({priority:e,message:t,image:n},t)(),this}},{key:"bind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,this.handle),this}},{key:"unbind",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,t=void 0===e?36160:e;return this.gl.bindFramebuffer(t,null),this}},{key:"_createDefaultAttachments",value:function(e,t,n,r,a){var o,s=null;e&&((s=s||{})[36064]=new d.a(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:r,height:a,mipmaps:!1,parameters:(o={},Object(i.a)(o,10241,9729),Object(i.a)(o,10240,9729),Object(i.a)(o,10242,33071),Object(i.a)(o,10243,33071),o)}),this.ownResources.push(s[36064]));return t&&n?((s=s||{})[33306]=new v.a(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:r,height:111}),this.ownResources.push(s[33306])):t?((s=s||{})[36096]=new v.a(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:r,height:a}),this.ownResources.push(s[36096])):n&&Object(_.a)(!1),s}},{key:"_unattach",value:function(e){var t=this.attachments[e];t&&(t instanceof v.a?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}},{key:"_attachRenderbuffer",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,i.handle),this.attachments[n]=i}},{key:"_attachTexture",value:function(e){var t=e.attachment,n=void 0===t?36064:t,i=e.texture,r=e.layer,a=e.level,o=this.gl;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:o.framebufferTextureLayer(36160,n,i.target,a,r);break;case 34067:var s=function(e){return e<34069?e+34069:e}(r);o.framebufferTexture2D(36160,n,s,i.handle,a);break;case 3553:o.framebufferTexture2D(36160,n,3553,i.handle,a);break;default:Object(_.a)(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[n]=i}},{key:"_setReadBuffer",value:function(e){var t=this.gl;Object(y.d)(t)?t.readBuffer(e):Object(_.a)(36064===e||1029===e,"Multiple render targets not supported"),this.readBuffer=e}},{key:"_setDrawBuffers",value:function(e){var t=this.gl;if(Object(y.d)(t))t.drawBuffers(e);else{var n=t.getExtension("WEBGL.draw_buffers");n?n.drawBuffersWEBGL(e):Object(_.a)(1===e.length&&(36064===e[0]||1029===e[0]),"Multiple render targets not supported")}this.drawBuffers=e}},{key:"_getAttachmentParameterFallback",value:function(e){var t=Object(m.a)(this.gl);switch(e){case 36052:return t.webgl2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.webgl2?null:8;case 33297:return t.webgl2?null:5125;case 33296:return t.webgl2||t.EXT_sRGB?null:9729;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(e){return this.gl.bindFramebuffer(36160,e)}},{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}}]),t}(f.a);function O(e){return(w.STATUS||{})[e]||"Framebuffer error ".concat(e)}w.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(9),o=n(5),s=n(11),u=n(163),c=35632,l=35633;function h(e,t,n,i){for(var r=e.split(/\r?\n/),a={},o={},s=i||Object(u.a)(t)||"(unnamed)",h="".concat(function(e){switch(e){case c:return"fragment";case l:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),v=0;v1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",i=e.split(/\r?\n/),r=String(i.length+t-1).length;return i.map(function(e,i){var a=i+t,o=String(a).length,s=d(a,r-o);return s+n+e})}(t);return{shaderName:h,errors:f(a,b),warnings:f(o,b)}}function f(e,t){for(var n="",i=0;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.a)(this,t),e=Object(s.a)(this,Object(u.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,o),e}return Object(c.a)(t,e),Object(o.a)(t,[{key:"applyMatrix4",value:function(e){return e.transformVector(this,this),this}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(h.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(h.a)(e)}}]),t}(n(135).a),g=n(21),m=n(48),y=n(40),b=n(37);n.d(t,"a",function(){return x});var _=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var x=function(e){function t(){for(var e,n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,h=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,f=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,p=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=r,this[2]=u,this[3]=f,this[4]=t,this[5]=a,this[6]=c,this[7]=d,this[8]=n,this[9]=o,this[10]=l,this[11]=v,this[12]=i,this[13]=s,this[14]=h,this[15]=p,this.check()}},{key:"setColumnMajor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,l=arguments.length>10&&void 0!==arguments[10]?arguments[10]:1,h=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,f=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,v=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,p=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1;return this[0]=e,this[1]=t,this[2]=n,this[3]=i,this[4]=r,this[5]=a,this[6]=o,this[7]=s,this[8]=u,this[9]=c,this[10]=l,this[11]=h,this[12]=f,this[13]=d,this[14]=v,this[15]=p,this.check()}},{key:"copy",value:function(e){return this.setColumnMajor.apply(this,Object(r.a)(e))}},{key:"set",value:function(){return this.setColumnMajor.apply(this,arguments)}},{key:"getElement",value:function(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this[e][t]:this[t][e]}},{key:"setElement",value:function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?this[e][t]=Object(h.a)(n):this[t][e]=Object(h.a)(n),this}},{key:"determinant",value:function(){return g.a(this)}},{key:"identity",value:function(){return this.copy(_)}},{key:"fromQuaternion",value:function(e){return g.c(this,e),this.check()}},{key:"frustum",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=e.far;return g.d(this,t,n,i,r,a,o),this.check()}},{key:"lookAt",value:function(e){var t=e.eye,n=e.center,i=void 0===n?[0,0,0]:n,r=e.up,a=void 0===r?[0,1,0]:r;return g.f(this,t,i,a),this.check()}},{key:"ortho",value:function(e){var t=e.left,n=e.right,i=e.bottom,r=e.top,a=e.near,o=void 0===a?.1:a,s=e.far,u=void 0===s?500:s;return g.h(this,t,n,i,r,o,u),this.check()}},{key:"orthographic",value:function(e){var n=e.fovy,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.focalDistance,s=void 0===o?1:o,u=e.near,c=void 0===u?.1:u,l=e.far,h=void 0===l?500:l;if(i>2*Math.PI)throw Error("radians");var f=i/2,d=s*Math.tan(f),v=d*a;return(new t).ortho({left:-v,right:v,bottom:-d,top:d,near:c,far:h})}},{key:"perspective",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fovy,n=e.fov,i=void 0===n?45*Math.PI/180:n,r=e.aspect,a=void 0===r?1:r,o=e.near,s=void 0===o?.1:o,u=e.far,c=void 0===u?500:u;if((t=t||i)>2*Math.PI)throw Error("radians");return g.i(this,t,a,s,c),this.check()}},{key:"transpose",value:function(){return g.p(this,this),this.check()}},{key:"invert",value:function(){return g.e(this,this),this.check()}},{key:"multiplyLeft",value:function(e){return g.g(this,e,this),this.check()}},{key:"multiplyRight",value:function(e){return g.g(this,this,e),this.check()}},{key:"rotateX",value:function(e){return g.k(this,this,e),this.check()}},{key:"rotateY",value:function(e){return g.l(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return g.m(this,this,e),this.check()}},{key:"rotateXYZ",value:function(e){var t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];return this.rotateX(n).rotateY(r).rotateZ(a)}},{key:"rotateAxis",value:function(e,t){return g.j(this,this,e,t),this.check()}},{key:"scale",value:function(e){return Array.isArray(e)?g.n(this,this,e):g.n(this,this,[e,e,e]),this.check()}},{key:"translate",value:function(e){return g.o(this,this,e),this.check()}},{key:"transformVector2",value:function(e,t){return t=t||new d.a,m.h(t,e,this),f(t,2),t}},{key:"transformVector3",value:function(e,t){return t=t||new v.a,y.n(t,e,this),f(t,3),t}},{key:"transformVector4",value:function(e,t){return t=t||new p,b.n(t,e,this),f(t,4),t.check()}},{key:"transformVector",value:function(e,t){switch(e.length){case 2:return this.transformVector2(e,t);case 3:return this.transformVector3(e,t);case 4:return this.transformVector4(e,t);default:throw new Error("Illegal vector")}}},{key:"transformDirection",value:function(e,t){return this._transformVector(e,t,0)}},{key:"transformPoint",value:function(e,t){return this._transformVector(e,t,1)}},{key:"_transformVector",value:function(e,t,n){switch(e.length){case 2:t=t||new d.a,b.n(t,[e[0],e[1],0,n],this),t.length=2,f(t,2);break;case 3:t=t||new v.a,b.n(t,[e[0],e[1],e[2],n],this),t.length=3,f(t,3);break;case 4:if(Boolean(n)!==Boolean(e[3]))throw new Error("math.gl: Matrix4.transformPoint - invalid vector");t=t||new p,b.n(t,e,this),f(t,4);break;default:throw new Error("Illegal vector")}return t}},{key:"makeRotationX",value:function(e){return this.identity().rotateX(e)}},{key:"makeTranslation",value:function(e,t,n){return this.identity().translate([e,t,n])}},{key:"ELEMENTS",get:function(){return 16}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"e",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return h});var i=n(66),r=n(201),a=n(146);function o(e,t,n){var r=i.c[t],o=r?r(e,Number(t)):e.getParameter(Number(t)),s=i.d[t];return Object(a.a)("function"==typeof s),s(e,n,Number(t)),o}function s(e,t){var n={};for(var r in t){var a=Number(r),o=i.d[r];o&&("string"==typeof o?n[o]=!0:o(e,t[r],a))}var s=e.state&&e.state.cache;if(s){var u=Object.assign({},s,t);for(var c in n){(0,i.a[c])(e,u)}}}function u(e,t){var n=i.c[t];return n?n(e,Number(t)):e.getParameter(Number(t))}function c(e,t){t=t||i.b;var n=Array.isArray(t)?t:Object.keys(t),r={},a=!0,o=!1,s=void 0;try{for(var c,l=n[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var h=c.value;r[h]=u(e,h)}}catch(e){o=!0,s=e}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return r}function l(e){s(e,Object.assign({},i.b,{}))}function h(e){var t=c(e,Object.keys(i.b)),n={};for(var a in i.b)Object(r.a)(t[a],i.b[a])||(n[a]=t[a]);return n}},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i=n(19),r={};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";r[e]=r[e]||1;var t=r[e]++;return"".concat(e,"-").concat(t)}function o(e){return Object(i.a)("number"==typeof e,"Input must be a number"),e&&0==(e&e-1)}function s(e){var t=!0;for(var n in e){t=!1;break}return t}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var i=n(19);function r(e,t){if("string"!=typeof t)return t;var n=Number(t);if(!isNaN(n))return n;var r=e[t=t.replace(/^.*\./,"")];return Object(i.a)(void 0!==r,"Accessing undefined constant GL.".concat(t)),r}function a(e,t){for(var n in t=Number(t),e)if(e[n]===t)return"GL.".concat(n);return String(t)}},function(e,t,n){"use strict";n.d(t,"f",function(){return u}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return h}),n.d(t,"b",function(){return f}),n.d(t,"g",function(){return d}),n.d(t,"d",function(){return v});var i=n(99),r=n.n(i),a=n(41),o=n.n(a),s=new Map,u=function(e,t,n){o.a.isReady()&&(s.has(e)||s.set(e,new Map),s.get(e).set(t,n))},c=function(e){if(o.a.isReady()&&e.id){var t=s.get(e.id);t&&t.forEach(function(t,n){!function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)}(e,n,t),"data"===n[0]&&(e.data=r()(e.data))})}},l=function(e){o.a.isReady()&&o.a.listenFor("deck.gl",e)},h=function(e){o.a.isReady()&&o.a.listenFor("init",e)},f=function(e){if(o.a.isReady()&&e){var t=[e.constructor.layerName];o.a.listItem("deck.gl",e.id,{badges:t,links:e.state&&e.state.model?["luma.gl:".concat(e.state.model.id)]:void 0,parent:e.parent?e.parent.id:void 0})}},d=function(e){if(o.a.isReady()&&!o.a.throttle("deck.gl:".concat(e.id),1e3)){var t=function(e){var t=[{path:"objects.props",data:e.props}],n=[e.constructor.layerName];if(e.state){if(e.getAttributeManager()){var i=e.getAttributeManager().getAttributes();t.push({path:"objects.attributes",data:i})}if(e.state.model){e.state.model.setProps({timerQueryEnabled:!0});var r=e.state.model.stats.lastFrameTime;r&&n.push("".concat((1e3*r).toFixed(0),"μs"))}}return t.push({path:"badges",data:n}),t}(e);o.a.multiUpdate("deck.gl",e.id,t)}},v=function(e){o.a.isReady()&&e&&o.a.deleteItem("deck.gl",e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(89),r=n(150),a=n(236),o=n(146);function s(e,t,n){if(Object(a.a)(t))return n(e);var s,u=t.nocatch,c=void 0===u||u;if(Object(o.a)(!t.frameBuffer),Object(i.c)(e),Object(r.a)(e,t),c)s=n(e),Object(i.b)(e);else try{s=n(e)}finally{Object(i.b)(e)}return s}},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var i=[],r=[];function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,a=i,o={index:-1,data:e,target:[]};return e?"function"==typeof e[Symbol.iterator]?a=e:e.length>0&&(r.length=e.length,a=r):a=i,(t>0||Number.isFinite(n))&&(a=(Array.isArray(a)?a:Array.from(a)).slice(t,n),o.index=t-1),{iterable:a,objectInfo:o}}function o(e){return e&&e[Symbol.asyncIterator]}},function(e,t,n){"use strict";n.d(t,"c",function(){return _}),n.d(t,"a",function(){return x}),n.d(t,"b",function(){return w});var i,r=n(23),a=n(0),o=n(19),s=5120,u=5121,c=5122,l=5123,h=0,f=1,d=2,v=3,p=4,g=5,m=6,y=5126,b=(i={},Object(a.a)(i,y,[y,1,"float"]),Object(a.a)(i,35664,[y,2,"vec2"]),Object(a.a)(i,35665,[y,3,"vec3"]),Object(a.a)(i,35666,[y,4,"vec4"]),Object(a.a)(i,5124,[5124,1,"int"]),Object(a.a)(i,35667,[5124,2,"ivec2"]),Object(a.a)(i,35668,[5124,3,"ivec3"]),Object(a.a)(i,35669,[5124,4,"ivec4"]),Object(a.a)(i,5125,[5125,1,"uint"]),Object(a.a)(i,36294,[5125,2,"uvec2"]),Object(a.a)(i,36295,[5125,3,"uvec3"]),Object(a.a)(i,36296,[5125,4,"uvec4"]),Object(a.a)(i,35670,[y,1,"bool"]),Object(a.a)(i,35671,[y,2,"bvec2"]),Object(a.a)(i,35672,[y,3,"bvec3"]),Object(a.a)(i,35673,[y,4,"bvec4"]),Object(a.a)(i,35674,[y,8,"mat2"]),Object(a.a)(i,35685,[y,8,"mat2x3"]),Object(a.a)(i,35686,[y,8,"mat2x4"]),Object(a.a)(i,35675,[y,12,"mat3"]),Object(a.a)(i,35687,[y,12,"mat3x2"]),Object(a.a)(i,35688,[y,12,"mat3x4"]),Object(a.a)(i,35676,[y,16,"mat4"]),Object(a.a)(i,35689,[y,16,"mat4x2"]),Object(a.a)(i,35690,[y,16,"mat4x3"]),i);function _(e){switch(e){case h:return h;case f:case v:case d:return f;case p:case g:case m:return p;default:return Object(o.a)(!1),0}}function x(e){var t=b[e];if(!t)return null;var n=Object(r.a)(t,2);return{type:n[0],components:n[1]}}function w(e,t){switch(e){case s:case u:case c:case l:e=y}for(var n in b){var i=Object(r.a)(b[n],3),a=i[0],o=i[1],h=i[2];if(a===e&&o===t)return{glType:n,name:h}}return null}},function(e,t,n){"use strict";n.d(t,"e",function(){return y}),n.d(t,"d",function(){return b}),n.d(t,"b",function(){return _}),n.d(t,"a",function(){return w}),n.d(t,"c",function(){return O});var i,r=n(0),a=n(63),o=n(94),s=n(57),u=n(25),c=(i={},Object(r.a)(i,5126,function(e,t,n){return e.uniform1fv(t,p(n,1))}),Object(r.a)(i,35664,function(e,t,n){return e.uniform2fv(t,p(n,2))}),Object(r.a)(i,35665,function(e,t,n){return e.uniform3fv(t,p(n,3))}),Object(r.a)(i,35666,function(e,t,n){return e.uniform4fv(t,p(n,4))}),Object(r.a)(i,5124,function(e,t,n){return e.uniform1iv(t,g(n,1))}),Object(r.a)(i,35667,function(e,t,n){return e.uniform2iv(t,g(n,2))}),Object(r.a)(i,35668,function(e,t,n){return e.uniform3iv(t,g(n,3))}),Object(r.a)(i,35669,function(e,t,n){return e.uniform4iv(t,g(n,4))}),Object(r.a)(i,35670,function(e,t,n){return e.uniform1iv(t,g(n,1))}),Object(r.a)(i,35671,function(e,t,n){return e.uniform2iv(t,g(n,2))}),Object(r.a)(i,35672,function(e,t,n){return e.uniform3iv(t,g(n,3))}),Object(r.a)(i,35673,function(e,t,n){return e.uniform4iv(t,g(n,4))}),Object(r.a)(i,35674,function(e,t,n){return e.uniformMatrix2fv(t,!1,p(n,4))}),Object(r.a)(i,35675,function(e,t,n){return e.uniformMatrix3fv(t,!1,p(n,9))}),Object(r.a)(i,35676,function(e,t,n){return e.uniformMatrix4fv(t,!1,p(n,16))}),Object(r.a)(i,35678,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35680,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,5125,function(e,t,n){return e.uniform1uiv(t,m(n,1))}),Object(r.a)(i,36294,function(e,t,n){return e.uniform2uiv(t,m(n,2))}),Object(r.a)(i,36295,function(e,t,n){return e.uniform3uiv(t,m(n,3))}),Object(r.a)(i,36296,function(e,t,n){return e.uniform4uiv(t,m(n,4))}),Object(r.a)(i,35685,function(e,t,n){return e.uniformMatrix2x3fv(t,!1,p(n,6))}),Object(r.a)(i,35686,function(e,t,n){return e.uniformMatrix2x4fv(t,!1,p(n,8))}),Object(r.a)(i,35687,function(e,t,n){return e.uniformMatrix3x2fv(t,!1,p(n,6))}),Object(r.a)(i,35688,function(e,t,n){return e.uniformMatrix3x4fv(t,!1,p(n,12))}),Object(r.a)(i,35689,function(e,t,n){return e.uniformMatrix4x2fv(t,!1,p(n,8))}),Object(r.a)(i,35690,function(e,t,n){return e.uniformMatrix4x3fv(t,!1,p(n,12))}),Object(r.a)(i,35679,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,35682,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36289,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36292,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36293,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36298,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36299,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36300,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36303,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36306,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36307,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36308,function(e,t,n){return e.uniform1i(t,n)}),Object(r.a)(i,36311,function(e,t,n){return e.uniform1i(t,n)}),i),l={},h={},f={},d=[0];function v(e,t,n,i){1===t&&"boolean"==typeof e&&(e=e?1:0),Number.isFinite(e)&&(d[0]=e,e=d);var r=e.length;if(r%t&&u.a.warn("Uniform size should be multiples of ".concat(t),e)(),e instanceof n)return e;var a=i[r];a||(a=new n(r),i[r]=a);for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=t.filter,i=void 0===n?function(){return!0}:n,r=t.map,a=void 0===r?function(e){return e}:r,o=t.result,s=void 0===o?[]:o;return Array.isArray(e)?function e(t,n,i,r){var a=-1;for(;++a1&&void 0!==arguments[1]?arguments[1]:{},n=t.result,i=void 0===n?[]:n,a=t.dimensions,o=void 0===a?3:a,s=-1,u=0;++s0&&uHTMLVideoElement.HAVE_METADATA&&(i.width!==o.videoWidth||i.height!==o.videoHeight?(i.resize({width:o.videoWidth,height:o.videoHeight,mipmaps:!0}),i.setSubImageData({data:o,paramters:O})):i.setSubImageData({data:o}),i.generateMipmap());i&&r&&r.setUniforms(Object.assign({},t,{bitmapTexture:i,desaturate:s,transparentColor:u.map(function(e){return e/255}),tintColor:c.slice(0,3).map(function(e){return e/255})})).draw()}},{key:"loadTexture",value:function(e){var t=this.context.gl;this.state.bitmapTexture&&this.state.bitmapTexture.delete(),e instanceof w.a?this.setState({bitmapTexture:e}):e instanceof HTMLVideoElement?this.setState({bitmapTexture:new w.a(t,{width:1,height:1,parameters:O,mipmaps:!1})}):e&&this.setState({bitmapTexture:new w.a(t,{data:e,parameters:O})})}}]),t}(b.a);P.layerName="BitmapLayer",P.defaultProps={image:{type:"object",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};var S,j=n(81),k=n(124),C=n(74),E=1024,T=4,A=function(){},M=(S={},y()(S,10241,9987),y()(S,10240,9729),S);function L(e){return e&&(e.id||e.url)}function I(e,t,n){for(var i=0;i0){var u=function(e){for(var t,n=e.icons,i=e.buffer,r=e.mapping,a=void 0===r?{}:r,o=e.xOffset,s=void 0===o?0:o,u=e.yOffset,c=void 0===u?0:u,l=e.canvasWidth,h=0,f=[],d=0;dl&&(I(a,f,c),s=0,c=h+c+i,h=0,f=[]),f.push({icon:v,xOffset:s}),s=s+g+i,h=Math.max(h,p)}}return f.length>0&&I(a,f,c),{mapping:a,xOffset:s,yOffset:c,canvasWidth:l,canvasHeight:(t=h+c+i,Math.pow(2,Math.ceil(Math.log2(t))))}}({icons:s,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,xOffset:this._xOffset,yOffset:this._yOffset}),c=u.mapping,l=u.xOffset,h=u.yOffset,f=u.canvasHeight;this._mapping=c,this._xOffset=l,this._yOffset=h,this._canvasHeight=f,this._texture||(this._texture=new w.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:M})),this._texture.height!==this._canvasHeight&&(t=this._texture,n=this._canvasWidth,i=this._canvasHeight,r=t.width,a=t.height,o=Object(j.f)(t,{}),t.resize({width:n,height:i}),t.setSubImageData({data:o,x:0,y:i-a,width:r,height:a,parameters:M}),t.generateMipmap(),o.delete()),this.onUpdate(),this._loadIcons(s)}}},{key:"_loadIcons",value:function(e){var t=this,n=this._canvas.getContext("2d"),i=this._texture.height,r=!0,a=!1,o=void 0;try{for(var s,u=function(){var e=s.value;Object(k.b)(e.url).then(function(r){var a=L(e),o=t._mapping[a],s=o.x,u=o.y,c=o.width,l=o.height,h=function(e,t,n,i){var r=t.naturalWidth,a=t.naturalHeight;return n===r&&i===a?t:(e.canvas.height=i,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,r,a,0,0,n,i),e.canvas)}(n,r,c,l);t._texture.setSubImageData({data:h,x:s,y:i-u-l,width:c,height:l,parameters:Object.assign({},M,y()({},37440,!0))}),t._texture.generateMipmap(),t.onUpdate()})},c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}}]),e}(),F=[0,0,0,255],D={iconAtlas:{type:"object",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},getPosition:{type:"accessor",value:function(e){return e.position}},getIcon:{type:"accessor",value:function(e){return e.icon}},getColor:{type:"accessor",value:F},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0}},N=function(e){function t(){return o()(this,t),l()(this,f()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"getShaders",value:function(){return v()(f()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n\n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.state={iconManager:new R(this.context.gl,{onUpdate:function(){return e._onUpdate()}})},this.getAttributeManager().addInstanced({instancePositions:{size:3,type:this.use64bitPositions()?5130:5126,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:F},instanceAngles:{size:1,transition:!0,accessor:"getAngle",defaultValue:0}})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;v()(f()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager(),o=this.state.iconManager,s=i.iconAtlas,u=i.iconMapping,c=i.data,l=i.getIcon,h=!1;if(s||this.props._asyncPropOriginalValues.iconAtlas?(n.iconAtlas!==i.iconAtlas&&o.setProps({iconAtlas:s,autoPacking:!1}),n.iconMapping!==i.iconMapping&&(o.setProps({iconMapping:u}),h=!0)):o.setProps({autoPacking:!0}),(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getIcon))&&(o.setProps({data:c,getIcon:l}),h=!0),h&&(a.invalidate("instanceOffsets"),a.invalidate("instanceIconFrames"),a.invalidate("instanceColorModes")),r.extensionsChanged){var d=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(d)}),a.invalidateAll()}}},{key:"finalizeState",value:function(){v()(f()(t.prototype),"finalizeState",this).call(this),this.state.iconManager.finalize()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.sizeScale,r=n.sizeMinPixels,a=n.sizeMaxPixels,o=n.sizeUnits,s=n.billboard,u=this.state.iconManager,c=this.context.viewport,l=u.getTexture();l&&l.loaded&&this.state.model.setUniforms(Object.assign({},t,{iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:i*("pixels"===o?c.distanceScales.metersPerPixel[2]:1),sizeMinPixels:r,sizeMaxPixels:a,billboard:s})).draw()}},{key:"_getModel",value:function(e){return new _.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new x.a({drawMode:6,attributes:{positions:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"getInstanceOffset",value:function(e){var t=this.state.iconManager.getIconMapping(e);return[t.width/2-t.anchorX||0,t.height/2-t.anchorY||0]}},{key:"getInstanceColorMode",value:function(e){return this.state.iconManager.getIconMapping(e).mask?1:0}},{key:"getInstanceIconFrame",value:function(e){var t=this.state.iconManager.getIconMapping(e);return[t.x||0,t.y||0,t.width||0,t.height||0]}}]),t}(b.a);N.layerName="IconLayer",N.defaultProps=D;var z=n(226),B=n(195),U=[0,0,0,255],V=[0,0,1],G=new B.a,W={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(e){return e.position}},getNormal:{type:"accessor",value:V},getColor:{type:"accessor",value:U},material:G,radiusPixels:{deprecatedFor:"pointSize"}};var H=function(e){function t(){return o()(this,t),l()(this,f()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"getShaders",value:function(e){return v()(f()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:this.use64bitPositions()?5130:5126,transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:V},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:U}})}},{key:"updateState",value:function(e){var n,i,r,a=e.props,o=e.oldProps,s=e.changeFlags;if(v()(f()(t.prototype),"updateState",this).call(this,{props:a,oldProps:o,changeFlags:s}),s.extensionsChanged){var u=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(u)}),this.getAttributeManager().invalidateAll()}s.dataChanged&&(n=a.data,i=n.header,r=n.attributes,i&&r&&(n.length=i.vertexCount,r.POSITION&&(r.instancePositions=r.POSITION),r.NORMAL&&(r.instanceNormals=r.NORMAL),r.COLOR_0&&(r.instanceColors=r.COLOR_0)))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.pointSize,a="meters"===i.sizeUnits?n.distanceScales.pixelsPerMeter[2]:1;this.state.model.setUniforms(Object.assign({},t,{radiusPixels:r*a})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<3;n++){var i=n/3*Math.PI*2;t.push(2*Math.cos(i),2*Math.sin(i),0)}return new _.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new x.a({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}}]),t}(b.a);H.layerName="PointCloudLayer",H.defaultProps=W;var X=n(172),q=n(171),Z=n(221),Y=n(115),K=n(222),Q=n(227),J=n(196),$=n(16),ee=n.n($),te=function(e){function t(){return o()(this,t),l()(this,f()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"getShaders",value:function(){return Object.assign({},v()(f()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME multi-icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec2 iconsTextureDim;\nuniform float gamma;\nuniform float opacity;\nuniform bool billboard;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n \n if (billboard) {\n pixelOffset.y *= -1.0;\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, vec3(0.0), geometry.position); \n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n\n vGamma = gamma / (sizeScale * iconSize.y);\n}\n",fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D iconsTexture;\nuniform float buffer;\nuniform bool sdf;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying float vGamma;\nvarying vec2 uv;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n \n float alpha = texColor.a;\n if (sdf) {\n float distance = texture2D(iconsTexture, vTextureCoords).a;\n alpha = smoothstep(buffer - vGamma, buffer + vGamma, distance);\n }\n float a = alpha * vColor.a;\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(vColor.rgb, a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}},{key:"initializeState",value:function(){v()(f()(t.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIcon",update:this.calculateInstanceOffsets},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(e){v()(f()(t.prototype),"updateState",this).call(this,e);var n=e.changeFlags;n.updateTriggersChanged&&(n.updateTriggersChanged.getAnchorX||n.updateTriggersChanged.getAnchorY)&&this.getAttributeManager().invalidate("instanceOffsets")}},{key:"draw",value:function(e){var n=e.uniforms,i=this.props.sdf;v()(f()(t.prototype),"draw",this).call(this,{uniforms:Object.assign({},n,{buffer:.75,gamma:.2,sdf:Boolean(i)})})}},{key:"calculateInstanceOffsets",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.iconMapping,s=r.getIcon,u=r.getAnchorX,c=r.getAnchorY,l=r.getParagraphSize,h=r.getRowSize,f=r.getOffsets,d=e.value,v=n*e.size,p=Object(C.a)(a,n,i).iterable,g=!0,m=!1,y=void 0;try{for(var b,_=p[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){var x=b.value,w=o[s(x)]||{},O=l(x),P=ee()(O,2),S=P[0],j=P[1],k=h(x),E=ee()(k,1)[0],T=f(x),A=ee()(T,2),M=A[0],L=A[1],I=u(x),R=c(x),F=(1-I)*(S-E)/2;d[v++]=(I-1)*S/2+F+w.width/2+M||0,d[v++]=(R-1)*j/2+w.height/2+L||0}}catch(e){m=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(m)throw y}}}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getPickingIndex,s=e.value,u=n*e.size,c=[],l=Object(C.a)(a,n,i).iterable,h=!0,f=!1,d=void 0;try{for(var v,p=l[Symbol.iterator]();!(h=(v=p.next()).done);h=!0){var g=o(v.value);this.encodePickingColor(g,c),s[u++]=c[0],s[u++]=c[1],s[u++]=c[2]}}catch(e){f=!0,d=e}finally{try{h||null==p.return||p.return()}finally{if(f)throw d}}}}]),t}(N);te.layerName="MultiIconLayer",te.defaultProps={getRowSize:{type:"accessor",value:function(e){return e.rowSize||[0,0]}},getOffsets:{type:"accessor",value:function(e){return e.offsets||[0,0]}},getParagraphSize:{type:"accessor",value:function(e){return e.size||[1,1]}},getAnchorX:{type:"accessor",value:function(e){return e.anchorX||0}},getAnchorY:{type:"accessor",value:function(e){return e.anchorY||0}},getPixelOffset:{type:"accessor",value:[0,0]},getPickingIndex:{type:"accessor",value:function(e){return e.objectIndex}}};var ne=n(234),ie=n.n(ne),re=n(15),ae=32;function oe(e,t,n,i,r){var a=e.split("\n"),o=[0,0],s=0;a.forEach(function(e){var a=function(e,t,n){var i=0,r=0,a=Array.from(e);return{characters:a=a.map(function(e,a){var o={text:e,offsetLeft:i},s=t[e];return s?(i+=s.width,r||(r=s.height*n)):(re.a.warn("Missing character: ".concat(e))(),i+=ae),o}),rowWidth:i,rowHeight:r}}(e,n,t),u=a.characters,c=a.rowWidth,l=a.rowHeight,h=[c,l];u.forEach(function(e){e.offsetTop=s,e.size=o,e.rowSize=h,r.push(i(e))}),s+=l,o[0]=Math.max(o[0],c)}),o[1]=s}var se=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;o()(this,e),this.limit=t,this.clear()}return u()(e,[{key:"clear",value:function(){this._cache={},this._order=[]}},{key:"get",value:function(e){var t=this._cache[e];return t&&(this._deleteOrder(e),this._appendOrder(e)),t}},{key:"set",value:function(e,t){this._cache[e]?(this.delete(e),this._cache[e]=t,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=t,this._appendOrder(e))}},{key:"delete",value:function(e){this._cache[e]&&(this._deleteCache(e),this._deleteOrder(e))}},{key:"_deleteCache",value:function(e){delete this._cache[e]}},{key:"_deleteOrder",value:function(e){var t=this._order.findIndex(function(t){return t===e});t>=0&&this._order.splice(t,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),e}();var ue=function(){for(var e=[],t=32;t<128;t++)e.push(String.fromCharCode(t));return e}(),ce="Monaco, monospace",le="normal",he=64,fe=2,de=.25,ve=3,pe=new se(3),ge=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function me(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};ge.forEach(function(n){n in t&&(e.props[n]=t[n])});var n=this._key;this._key=this._getKey();var i=function(e,t){var n=pe.get(e);if(!n)return t;var i=[],r=n.mapping,a=Object.keys(r);a=new Set(a);var o=t;return o instanceof Array&&(o=new Set(o)),o.forEach(function(e){a.has(e)||i.push(e)}),i}(this._key,this.props.characterSet),r=pe.get(this._key);if(r&&0===i.length)this._key!==n&&this._updateTexture(r);else{var a=this._generateFontAtlas(this._key,i,r);this._updateTexture(a),pe.set(this._key,a)}}},{key:"_updateTexture",value:function(e){var t,n=e.data,i=e.width,r=e.height;this._texture.width===i&&this._texture.height===r||this._texture.resize({width:i,height:r}),this._texture.setImageData({data:n,width:i,height:r,parameters:(t={},y()(t,10242,33071),y()(t,10243,33071),y()(t,37440,!0),t)}),this._texture.generateMipmap()}},{key:"_generateFontAtlas",value:function(e,t,n){var i=this.props,r=i.fontFamily,a=i.fontWeight,o=i.fontSize,s=i.buffer,u=i.sdf,c=i.radius,l=i.cutoff,h=n&&n.data;h||((h=document.createElement("canvas")).width=1024);var f=h.getContext("2d");ye(f,r,o,a);var d=function(e){var t=e.characterSet,n=e.getFontWidth,i=e.fontHeight,r=e.buffer,a=e.maxCanvasWidth,o=e.mapping,s=void 0===o?{}:o,u=e.xOffset,c=void 0===u?0:u,l=e.yOffset,h=void 0===l?0:l,f=0,d=c;Array.from(t).forEach(function(e,t){if(!s[e]){var o=n(e,t);d+o+2*r>a&&(d=0,f++),s[e]={x:d+r,y:h+f*(i+2*r)+r,width:o,height:i,mask:!0},d+=o+2*r}});var v,p=i+2*r;return{mapping:s,xOffset:d,yOffset:h+f*p,canvasHeight:(v=h+(f+1)*p,Math.pow(2,Math.ceil(Math.log2(v))))}}(Object.assign({getFontWidth:function(e){return f.measureText(e).width},fontHeight:1.2*o,buffer:s,characterSet:t,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),v=d.mapping,p=d.canvasHeight,g=d.xOffset,m=d.yOffset;if(h.height!==p){var y=f.getImageData(0,0,h.width,h.height);h.height=p,f.putImageData(y,0,0)}if(ye(f,r,o,a),u){var b=new ie.a(o,s,c,l,r,a),_=f.getImageData(0,0,b.size,b.size),x=!0,w=!1,O=void 0;try{for(var P,S=t[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;me(b.draw(j),_),f.putImageData(_,v[j].x-s,v[j].y-s)}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}}else{var k=!0,C=!1,E=void 0;try{for(var T,A=t[Symbol.iterator]();!(k=(T=A.next()).done);k=!0){var M=T.value;f.fillText(M,v[M].x,v[M].y+.9*o)}}catch(e){C=!0,E=e}finally{try{k||null==A.return||A.return()}finally{if(C)throw E}}}return{xOffset:g,yOffset:m,mapping:v,data:h,width:h.width,height:h.height}}},{key:"_getKey",value:function(){var e=this.props,t=e.gl,n=e.fontFamily,i=e.fontWeight,r=e.fontSize,a=e.buffer,o=e.sdf,s=e.radius,u=e.cutoff;return o?"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a," ").concat(s," ").concat(u):"".concat(t," ").concat(n," ").concat(i," ").concat(r," ").concat(a)}},{key:"texture",get:function(){return this._texture}},{key:"mapping",get:function(){var e=pe.get(this._key);return e&&e.mapping}},{key:"scale",get:function(){return 1.2}}]),e}(),_e=n(141),xe={fontSize:he,buffer:fe,sdf:!1,radius:ve,cutoff:de},we={start:1,middle:0,end:-1},Oe={top:1,center:0,bottom:-1},Pe=["fontSize","buffer","sdf","radius","cutoff"],Se={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,characterSet:ue,fontFamily:ce,fontWeight:le,lineHeight:1,fontSettings:{},getText:{type:"accessor",value:function(e){return e.text}},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},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]}},je=function(e){function t(){return o()(this,t),l()(this,f()(t).apply(this,arguments))}return g()(t,e),u()(t,[{key:"initializeState",value:function(){this.state={fontAtlasManager:new be(this.context.gl)}}},{key:"updateState",value:function(e){var t=this,n=e.props,i=e.oldProps,r=e.changeFlags,a=this.fontChanged(i,n);a&&this.updateFontAtlas({oldProps:i,props:n});var o=r.dataChanged||a||n.lineHeight!==i.lineHeight||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getText);if(o&&Array.isArray(r.dataChanged)){var s=this.state.data.slice(),u=r.dataChanged.map(function(e){return Object(_e.a)({data:s,getIndex:function(e){return e.__source.index},dataRange:e,replace:t.transformStringToLetters(e)})});this.setState({data:s,dataDiff:u})}else o&&this.setState({data:this.transformStringToLetters(),dataDiff:null})}},{key:"finalizeState",value:function(){v()(f()(t.prototype),"finalizeState",this).call(this),this.state.fontAtlasManager.finalize()}},{key:"updateFontAtlas",value:function(e){e.oldProps;var t=e.props,n=t.characterSet,i=t.fontSettings,r=t.fontFamily,a=t.fontWeight,o=this.state.fontAtlasManager;o.setProps(Object.assign({},xe,i,{characterSet:n,fontFamily:r,fontWeight:a}));var s=o.scale,u=o.texture,c=o.mapping;this.setState({scale:s,iconAtlas:u,iconMapping:c}),this.setNeedsRedraw(!0)}},{key:"fontChanged",value:function(e,t){if(e.fontFamily!==t.fontFamily||e.characterSet!==t.characterSet||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;var n=e.fontSettings||{},i=t.fontSettings||{};return Pe.some(function(e){return n[e]!==i[e]})}},{key:"getPickingInfo",value:function(e){var t=e.info;return Object.assign(t,{object:t.index>=0?this.props.data[t.index]:null})}},{key:"transformStringToLetters",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,r=n.lineHeight,a=n.getText,o=this.state.iconMapping,s=t.startRow,u=t.endRow,c=Object(C.a)(i,s,u),l=c.iterable,h=c.objectInfo,f=[],d=!0,v=!1,p=void 0;try{for(var g,m=function(){var t=g.value;h.index++;var n=a(t,h);n&&oe(n,r,o,function(n){return e.getSubLayerRow(n,t,h.index)},f)},y=l[Symbol.iterator]();!(d=(g=y.next()).done);d=!0)m()}catch(e){v=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}return f}},{key:"getAnchorXFromTextAnchor",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return we[e(t)]||0}):function(){return we[e]||0}}},{key:"getAnchorYFromAlignmentBaseline",value:function(e){return"function"==typeof e?(e=this.getSubLayerAccessor(e),function(t){return we[e(t)]||0}):function(){return Oe[e]||0}}},{key:"renderLayers",value:function(){var e=this.state,t=e.data,n=e.dataDiff,i=e.scale,r=e.iconAtlas,a=e.iconMapping,o=this.props,s=o.getPosition,u=o.getColor,c=o.getSize,l=o.getAngle,h=o.getTextAnchor,f=o.getAlignmentBaseline,d=o.getPixelOffset,v=o.billboard,p=o.sdf,g=o.sizeScale,m=o.sizeUnits,y=o.sizeMinPixels,b=o.sizeMaxPixels,_=o.transitions,x=o.updateTriggers;return new(this.getSubLayerClass("characters",te))({sdf:p,iconAtlas:r,iconMapping:a,_dataDiff:n&&function(){return n},getPosition:this.getSubLayerAccessor(s),getColor:this.getSubLayerAccessor(u),getSize:this.getSubLayerAccessor(c),getAngle:this.getSubLayerAccessor(l),getAnchorX:this.getAnchorXFromTextAnchor(h),getAnchorY:this.getAnchorYFromAlignmentBaseline(f),getPixelOffset:this.getSubLayerAccessor(d),getPickingIndex:function(e){return e.__source.index},billboard:v,sizeScale:g*i,sizeUnits:m,sizeMinPixels:y*i,sizeMaxPixels:b*i,transitions:_&&{getPosition:_.getPosition,getAngle:_.getAngle,getColor:_.getColor,getSize:_.getSize,getPixelOffset:x.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getPosition:x.getPosition,getAngle:x.getAngle,getColor:x.getColor,getSize:x.getSize,getPixelOffset:x.getPixelOffset,getAnchorX:x.getTextAnchor,getAnchorY:x.getAlignmentBaseline}}),{data:t,getIcon:function(e){return e.text},getRowSize:function(e){return e.rowSize},getOffsets:function(e){return[e.offsetLeft,e.offsetTop]},getParagraphSize:function(e){return e.size}})}}]),t}(J.a);je.layerName="TextLayer",je.defaultProps=Se;var ke=n(133);n.d(t,"ArcLayer",function(){return r.a}),n.d(t,"BitmapLayer",function(){return P}),n.d(t,"IconLayer",function(){return N}),n.d(t,"LineLayer",function(){return z.a}),n.d(t,"PointCloudLayer",function(){return H}),n.d(t,"ScatterplotLayer",function(){return X.a}),n.d(t,"ColumnLayer",function(){return q.a}),n.d(t,"GridCellLayer",function(){return Z.a}),n.d(t,"PathLayer",function(){return Y.a}),n.d(t,"PolygonLayer",function(){return K.a}),n.d(t,"GeoJsonLayer",function(){return Q.a}),n.d(t,"TextLayer",function(){return je}),n.d(t,"SolidPolygonLayer",function(){return ke.a}),n.d(t,"_MultiIconLayer",function(){return te})},function(e,t,n){"use strict";var i=n(43),r=n(63),a=n(57),o=n(73),s=n(30),u=n(120),c=n(19);function l(e){switch(e){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(c.a)(!1),0}}var h=n(160),f=n(25);function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceX,i=void 0===n?0:n,r=t.sourceY,a=void 0===r?0:r,o=t.sourceFormat,s=void 0===o?6408:o,h=t.sourceAttachment,f=void 0===h?36064:h,d=t.target,v=void 0===d?null:d,p=t.sourceWidth,g=t.sourceHeight,m=t.sourceType,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=_.attachments;p=p||_.width,g=g||_.height,36064===f&&null===O&&(f=1028),Object(c.a)(P[f]),v=function(e,t,n,i,r){if(e)return e;t=t||5121;var a=Object(u.c)(t,{clamped:!1}),o=l(n);return new a(i*r*o)}(v,m=m||P[f].type,s,p,g),m=m||Object(u.b)(v);var S=w.bindFramebuffer(36160,O);return w.readPixels(i,a,p,g,s,m,v),w.bindFramebuffer(36160,S||null),x&&_.delete(),v}function v(e,t){var n=t.sourceX,r=void 0===n?0:n,a=t.sourceY,u=void 0===a?0:a,h=t.sourceFormat,f=void 0===h?6408:h,d=t.target,v=void 0===d?null:d,p=t.targetByteOffset,g=void 0===p?0:p,m=t.sourceWidth,y=t.sourceHeight,_=t.sourceType,x=b(e),w=x.framebuffer,O=x.deleteFramebuffer;Object(c.a)(w);var P=w.gl;if(m=m||w.width,y=y||w.height,Object(s.a)(P),_=_||(v?v.type:5121),!v){var S=l(f),j=function(e){switch(e){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(c.a)(!1),0}}(_),k=g+m*y*S*j;v=new i.a(P,{byteLength:k,accessor:{type:_,size:S}})}return v.bind({target:35051}),Object(o.a)(P,{framebuffer:w},function(){P.readPixels(r,u,m,y,f,_,g)}),v.unbind({target:35051}),O&&w.delete(),v}function p(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetMaxHeight,a=void 0===r?Number.MAX_SAFE_INTEGER:r,o=d(e,{sourceAttachment:i}),s=e.width,c=e.height;c>a;){var l=Object(u.d)({data:o,width:s,height:c});o=l.data,s=l.width,c=l.height}Object(u.a)({data:o,width:s,height:c});var h=document.createElement("canvas");h.width=s,h.height=c;var f=h.getContext("2d"),v=f.createImageData(s,c);return v.data.set(o),f.putImageData(v,0,0),h.toDataURL()}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sourceAttachment,i=void 0===n?36064:n,r=t.targetImage,a=void 0===r?null:r,o=p(e,{sourceAttachment:i});return(a=a||new Image).src=o,a}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceX,r=void 0===i?0:i,o=n.sourceY,s=void 0===o?0:o,u=n.targetX,l=n.targetY,h=n.targetZ,f=n.targetMipmaplevel,d=void 0===f?0:f,v=n.targetInternalFormat,p=void 0===v?6408:v,g=n.width,m=n.height,y=b(e),_=y.framebuffer,x=y.deleteFramebuffer;Object(c.a)(_);var w=_.gl,O=_.handle,P=void 0!==u||void 0!==l||void 0!==h;u=u||0,l=l||0,h=h||0;var S=w.bindFramebuffer(36160,O);Object(c.a)(t);var j=null;if(t instanceof a.a&&(j=t,g=Number.isFinite(g)?g:j.width,m=Number.isFinite(m)?m:j.height,j.bind(0),t=j.target),P)switch(t){case 3553:case 34067:w.copyTexSubImage2D(t,d,u,l,r,s,g,m);break;case 35866:case 32879:w.copyTexSubImage3D(t,d,u,l,h,r,s,g,m)}else w.copyTexImage2D(t,d,p,r,s,g,m,0);return j&&j.unbind(),w.bindFramebuffer(36160,S||null),x&&_.delete(),j}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.sourceAttachment,r=void 0===i?36064:i,a=n.sourceX0,o=void 0===a?0:a,u=n.sourceY0,l=void 0===u?0:u,h=n.sourceX1,d=n.sourceY1,v=n.targetX0,p=void 0===v?0:v,g=n.targetY0,m=void 0===g?0:g,y=n.targetX1,_=n.targetY1,x=n.color,w=void 0===x||x,O=n.depth,P=void 0!==O&&O,S=n.stencil,j=void 0!==S&&S,k=n.mask,C=void 0===k?0:k,E=n.filter,T=void 0===E?9728:E,A=b(e),M=A.framebuffer,L=A.deleteFramebuffer,I=b(t),R=I.framebuffer,F=I.deleteFramebuffer;Object(c.a)(M),Object(c.a)(R);var D=R.gl,N=R.handle,z=R.width,B=R.height,U=R.readBuffer;Object(s.a)(D),M.handle||36064!==r||(r=1028),w&&(C|=16384),P&&(C|=256),j&&(C|=1024),(L||F)&&1280&C&&(C=16384,f.a.warn("Blitting from or into a Texture object, forcing mask to GL.COLOR_BUFFER_BIT")()),Object(c.a)(C),h=void 0===h?M.width:h,d=void 0===d?M.height:d,y=void 0===y?z:y,_=void 0===_?B:_;var V=D.bindFramebuffer(36009,N),G=D.bindFramebuffer(36008,M.handle);return D.readBuffer(r),D.blitFramebuffer(o,l,h,d,p,m,y,_,C,T),D.readBuffer(U),D.bindFramebuffer(36008,G||null),D.bindFramebuffer(36009,V||null),L&&M.delete(),F&&R.delete(),R}function b(e){return e instanceof r.a?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Object(h.b)(e),deleteFramebuffer:!0}}n.d(t,"e",function(){return d}),n.d(t,"f",function(){return v}),n.d(t,"b",function(){return p}),n.d(t,"c",function(){return g}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return y})},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(180),v=n(22),p=["longitude","latitude","zoom","bearing","pitch"],g=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return r()(this,t),u()(this,l()(t).call(this,e))}return f()(t,e),o()(t,[{key:"interpolateProps",value:function(e,t,n){var i={};for(var r in t)i[r]=Object(v.g)(e[r],t[r],n);return i}}]),t}(d.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return h}),n.d(t,"b",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(82),u=n(181),c=n(18),l=function(){},h={BREAK:1,SNAP_TO_END:2,IGNORE:3},f={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new s.a,transitionInterruption:h.BREAK,onTransitionStart:l,onTransitionInterrupt:l,onTransitionEnd:l},d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.props=Object.assign({},f,n),this.propsInTransition=null,this.time=0,this.transition=new u.a,this.onViewStateChange=n.onViewStateChange,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}return o()(e,[{key:"finalize",value:function(){}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var t=!1,n=this.props;if(e=Object.assign({},f,e),this.props=e,this._shouldIgnoreViewportChange(n,e))return t;if(this._isTransitionEnabled(e)){var i=Object.assign({},n,this.transition.interruption===h.SNAP_TO_END?this.transition.endProps:this.propsInTransition||n);this._triggerTransition(i,e),t=!0}else this.transition.cancel();return t}},{key:"updateTransition",value:function(e){this.time=e,this._updateTransition()}},{key:"_isTransitionEnabled",value:function(e){return e.transitionDuration>0&&e.transitionInterpolator}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.transition.inProgress&&this.transition.interpolator.arePropsEqual(e,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return this.transition.inProgress?this.transition.interruption===h.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}},{key:"_triggerTransition",value:function(e,t){Object(c.a)(this._isTransitionEnabled(t),"Transition is not enabled");var n=new this.ControllerState(e),i=new this.ControllerState(t).shortestPathFrom(n),r=t.transitionInterpolator.initializeProps(e,i);this.propsInTransition={},this.transition.start({duration:t.transitionDuration,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:r.start,endProps:r.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this._updateTransition()}},{key:"_updateTransition",value:function(){this.transition.update(this.time)}},{key:"_onTransitionEnd",value:function(e){var t=this;return function(n){t.propsInTransition=null,e(n)}}},{key:"_onTransitionUpdate",value:function(e){var t=e.interpolator,n=e.startProps,i=e.endProps,r=e.time,a=t.interpolateProps(n,i,r);this.propsInTransition=new this.ControllerState(Object.assign({},this.props,a)).getViewportProps(),this.onViewStateChange&&this.onViewStateChange({viewState:this.propsInTransition,interactionState:{inTransition:!0},oldViewState:this.props})}}]),e}();d.defaultProps=f},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(83),u=n(15),c=n(18),l={transitionDuration:0},h=["wheel"],f=["panstart","panmove","panend"],d=["pinchstart","pinchmove","pinchend"],v=["doubletap"],p=["keydown"],g=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),Object(c.a)(t),this.ControllerState=t,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new s.b(t,n),this._events=null,this._state={isDragging:!1},this.events=[],this.onViewStateChange=null,this.onStateChange=null,this.invertPan=!1,this.handleEvent=this.handleEvent.bind(this),this.setProps(n)}return o()(e,[{key:"finalize",value:function(){for(var e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){var t=this.ControllerState;switch(this.controllerState=new t(Object.assign({},this.controllerStateProps,this._state)),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=this.controllerStateProps,n=t.x,i=t.y,r=e.offsetCenter;return[r.x-n,r.y-i]}},{key:"isPointInBounds",value:function(e,t){var n=this.controllerStateProps,i=n.width,r=n.height;if(t&&t.handled)return!1;var a=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return a&&t&&t.stopPropagation(),a}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"isDragging",value:function(){return this._state.isDragging}},{key:"setProps",value:function(e){"onViewportChange"in e&&u.a.removed("onViewportChange")(),"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this.events,!0)),this.transitionManager.processViewStateChange(this.controllerStateProps);var t=e.scrollZoom,n=void 0===t||t,i=e.dragPan,r=void 0===i||i,a=e.dragRotate,o=void 0===a||a,s=e.doubleClickZoom,c=void 0===s||s,l=e.touchZoom,g=void 0===l||l,m=e.touchRotate,y=void 0!==m&&m,b=e.keyboard,_=void 0===b||b,x=Boolean(this.onViewStateChange);this.toggleEvents(h,x&&n),this.toggleEvents(f,x&&(r||o)),this.toggleEvents(d,x&&(g||y)),this.toggleEvents(v,x&&c),this.toggleEvents(p,x&&_),this.scrollZoom=n,this.dragPan=r,this.dragRotate=o,this.doubleClickZoom=c,this.touchZoom=g,this.touchRotate=y,this.keyboard=_}},{key:"updateTransition",value:function(e){this.transitionManager.updateTransition(e)}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach(function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))})}},{key:"setOptions",value:function(e){return this.setProps(e)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Object.assign({},e.getViewportProps(),t);if(this.controllerState!==e){var r=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:n,oldViewState:r})}Object.assign(this._state,e.getInteractiveState(),n),this.onStateChange&&this.onStateChange(this._state)}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){if(!this.isDragging())return!1;var t=this.isFunctionKeyPressed(e)||e.rightButton;return(t=this.invertPan?!t:t)?this._onPanMove(e):this._onPanRotate(e)}},{key:"_onPanEnd",value:function(e){var t=this.controllerState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.controllerState.pan({pos:t});return this.updateViewport(n,l,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.controllerState.getViewportProps(),r=t/i.width,a=n/i.height,o=this.controllerState.rotate({deltaScaleX:r,deltaScaleY:a});return this.updateViewport(o,l,{isDragging:!0,isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=e.delta,i=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==i&&(i=1/i);var r=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(r,l,{isZooming:!0,isPanning:!0}),!0}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,l,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var t=this.controllerState;if(this.touchZoom){var n=e.scale,i=this.getCenter(e);t=t.zoom({pos:i,scale:n})}if(this.touchRotate){var r=e.rotation,a=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(r-a)/180})}return this.updateViewport(t,l,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.controllerState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var n=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(i,this._getTransitionProps(),{isZooming:!0,isPanning:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),i=this.controllerState,r={};switch(e.srcEvent.keyCode){case 189:t=n?i.zoomOut().zoomOut():i.zoomOut(),r.isZooming=!0;break;case 187:t=n?i.zoomIn().zoomIn():i.zoomIn(),r.isZooming=!0;break;case 37:n?(t=i.rotateLeft(),r.isRotating=!0):(t=i.moveLeft(),r.isPanning=!0);break;case 39:n?(t=i.rotateRight(),r.isRotating=!0):(t=i.moveRight(),r.isPanning=!0);break;case 38:n?(t=i.rotateUp(),r.isRotating=!0):(t=i.moveUp(),r.isPanning=!0);break;case 40:n?(t=i.rotateDown(),r.isRotating=!0):(t=i.moveDown(),r.isPanning=!0);break;default:return!1}return this.updateViewport(t,this._getTransitionProps(),r),!0}},{key:"_getTransitionProps",value:function(){return l}}]),e}()},function(e,t,n){"use strict";var i=n(209),r=n(42),a=Object.keys(r.a).map(function(e){return"const float COORDINATE_SYSTEM_".concat(e," = ").concat(r.a[e],".;")}).join(""),o="".concat(a,"\n\nuniform float project_uCoordinateSystem;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform float project_uAntimeridian;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec2 ZERO_64_XY_LOW = vec2(0.0, 0.0);\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n dy = clamp(dy, -1., 1.);\n }\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;\n }\n return vec2(\n radians(x) + PI,\n PI - log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\nvec4 project_position(vec4 position, vec2 position64xyLow) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT) {\n return project_uModelMatrix * vec4(\n project_mercator_(position.xy) * WORLD_SCALE * project_uScale,\n project_size(position.z),\n position.w\n );\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) {\n float X = position.x - project_uCoordinateOrigin.x;\n float Y = position.y - project_uCoordinateOrigin.y;\n return project_offset_(vec4(X + position64xyLow.x, Y + position64xyLow.y, position.z, position.w));\n }\n\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return project_offset_(position);\n }\n vec4 position_world = project_uModelMatrix * position;\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_IDENTITY) {\n position_world.xyz -= project_uCoordinateOrigin;\n position_world += project_uModelMatrix * vec4(position64xyLow, 0.0, 0.0);\n }\n\n return project_offset_(position_world);\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_XY_LOW);\n}\n\nvec3 project_position(vec3 position, vec2 position64xyLow) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64xyLow);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_XY_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_XY_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_METER_OFFSETS ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n position.w *= project_uCommonUnitsPerMeter.z;\n }\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters);\n}\nfloat project_pixel_size(float pixels) {\n return pixels;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels;\n}\nfloat project_scale(float meters) {\n return project_size(meters);\n}\nvec2 project_scale(vec2 meters) {\n return project_size(meters);\n}\nvec3 project_scale(vec3 meters) {\n return project_size(meters);\n}\nvec4 project_scale(vec4 meters) {\n return project_size(meters);\n}\nvec4 project_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position);\n}\nvec4 project_pixel_to_clipspace(vec2 pixels) {\n return vec4(project_pixel_size_to_clipspace(pixels), 0.0, 0.0);\n}\n"),s=n(138),u={};t.a={name:"project",dependencies:[i.a],vs:o,getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return e.viewport?Object(s.b)(e):{}},deprecations:[{type:"function",old:"project_scale",new:"project_size"},{type:"function",old:"project_to_clipspace",new:"project_common_position_to_clipspace"},{type:"function",old:"project_pixel_to_clipspace",new:"project_pixel_size_to_clipspace"}]}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(95),r=n(55);function a(){var e;if(i.b&&r.b.performance)e=r.b.performance.now();else if(r.a.hrtime){var t=r.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"viewport-mercator-project: assertion failed.")}n.d(t,"a",function(){return i})},function(e,t){var n,i,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++h1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,a=void 0!==r&&r,u=n.log,c=void 0===u?function(){}:u;Object(i.a)(this,e),this.gl=t,this.stateStack=[],this.enable=!0,this.cache=a?Object(s.c)(t):Object.assign({},o.b),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return Object(r.a)(e,[{key:"push",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.stateStack.push({})}},{key:"pop",value:function(){Object(u.a)(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];Object(s.f)(this.gl,e,this.cache),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var t,n=!1,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var r in e)Object(u.a)(void 0!==r),Object(c.a)(e[r],this.cache[r])||(n=!0,t=this.cache[r],!i||r in i||(i[r]=this.cache[r]),this.cache[r]=e[r]);return{valueChanged:n,oldValue:t}}}]),e}();function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.enable,r=void 0===i||i,o=n.copyState;if(Object(u.a)(void 0!==o),!t.state){var s=void 0!==e?e:window;for(var c in s.polyfillContext&&s.polyfillContext(t),t.state=new f(t,{copyState:o,enable:r}),a.a){h(t,c,a.a[c])}l(t,"getParameter"),l(t,"isEnabled")}return t.state.enable=r,t}function v(e){e.state||d(e,{copyState:!1}),e.state.push()}function p(e){Object(u.a)(e.state),e.state.pop()}}).call(this,n(79))},function(e,t,n){"use strict";var i=n(36),r=n(89),a=n(50),o="Failed to create WebGL context in Node.js, headless gl not available",s="Failed to create WebGL context in Node.js, headless gl returned null";var u=n(127);var c=n(112),l=(n(19),n(111)),h=n(25),f=n(46);n.d(t,"e",function(){return p}),n.d(t,"a",function(){return g}),n.d(t,"c",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"d",function(){return b});function d(e){return Boolean(e&&2===e._version)}var v={webgl2:!0,webgl1:!0,throwOnFailure:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(v,{width:1,height:1},e)}function g(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t=Object.assign({},v,t),r=n.width,f=n.height;function p(e){if(t.throwOnError)throw new Error(e);return null}if(l.a){var g=t.canvas;e=function(e,t){var n=t.onError,i=void 0===n?function(e){return null}:n,r=function(e){return i("WebGL context: ".concat(e.statusMessage||"error"))};e.addEventListener("webglcontextcreationerror",r,!1);var a=t.webgl1,o=void 0===a||a,s=t.webgl2,u=void 0===s||s,c=null;return u&&(c=(c=c||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t)),o&&(c=(c=c||e.getContext("webgl",t))||e.getContext("experimental-webgl",t)),e.removeEventListener("webglcontextcreationerror",r,!1),c||i("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context"))}(Object(u.a)({canvas:g,width:r,height:f,onError:p}),t)}else e=function(e){var t=e.width,n=e.height,i=e.webgl1,r=e.webgl2,u=e.onError;if(r&&!i)return u("headless-gl does not support WebGL2");if(!a.c)return u(o);var c=Object(a.c)(t,n,e);return c||u(s)}(Object(i.a)({},t,{width:r,height:f,onError:p}));return e?(function(e){var t=d(e)?"WebGL2":"WebGL1",n=Object(c.a)(e),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",r=e.debug?" debug":"";h.a.once(1,"".concat(t).concat(r," context ").concat(i))()}(e=m(e,t)),e):null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e._instrumented)return e;e._version=e._version||function(e){if(void 0!==a.a&&e instanceof a.a)return 2;return 1}(e);var n=t=Object.assign({},v,t),i=n.manageState,o=n.debug;return i&&Object(r.a)(e,{copyState:!1,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e.canvas){var n=t.useDevicePixels&&window.devicePixelRatio||1,i="width"in t?t.width:e.canvas.clientWidth,r="height"in t?t.height:e.canvas.clientHeight;return e.canvas.width=i*n,void(e.canvas.height=r*n)}var a=e.getExtension("STACKGL_resize_drawingbuffer");a&&"width"in t&&"height"in t&&a.resize(t.width,t.height)}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(4),r=n(5),a=n(29),o=n(68),s=n(70),u=n(19),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(i.a)(this,e);var n=t.id;this.id=n||Object(s.c)(this.constructor.name),this.display=!0,this.position=new a.a,this.rotation=new a.a,this.scale=new a.a(1,1,1),this.matrix=new o.a,this.userData={},this.props={},this._setScenegraphNodeProps(t)}return Object(r.a)(e,[{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:"setPosition",value:function(e){return Object(u.a)(3===e.length,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return Object(u.a)(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return Object(u.a)(3===e.length,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var t=e.position,n=e.rotation,i=e.scale,r=e.update,a=void 0===r||r;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),a&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,t=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(n),this}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.position,n=e.rotation,i=e.scale;return t&&this.setPosition(t),n&&this.setRotation(n),i&&this.setScale(i),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,t){Object(u.a)(e),t=t||this.matrix;var n=new o.a(e).multiplyRight(t),i=n.invert(),r=i.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:n,worldInverseMatrix:i,worldInverseTransposeMatrix:r}}},{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)}}]),e}()},function(e,t,n){"use strict";var i=n(0),r=n(36),a=n(4),o=n(5),s=n(10),u=n(9),c=n(47),l=n(11),h=n(43),f=n(206),d=n(19),v={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function p(e,t){var n=(t||{}).attributeMap,i=void 0===n?v:n;return i&&i[e]||e}function g(e,t){var n;switch(e){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":t.size=t.size||3;break;case"uvs":t.size=t.size||2}Object(d.a)(Number.isFinite(t.size),"attribute ".concat(e," needs size"))}var m=n(30),y=n(113),b=n(178),_=n(200),x=n(207),w=n(28),O=n(134),P=n(212),S=n(213),j=n(214),k=n(41),C=n.n(k),E=n(46),T={},A=function e(t,n,i){t&&(n.length>1?e(t[n[0]],n.slice(1),i):t[n[0]]=i)},M=new Map;C.a.listenFor("luma.gl",function(e){var t=T[e.itemKey];if(t&&"edit"===e.type&&"uniforms"===e.valuePath[0]){var n=e.valuePath.slice(1);!function(e,t,n){E.d.__SEER_INITIALIZED__&&(M.has(e)||M.set(e,new Map),M.get(e).set(t,n))}(e.itemKey,n,e.value);var i=t.getUniforms();A(i,n,e.value),t.setUniforms(i)}});var L=n(70),I=n(25),R=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),Object(d.a)(Object(m.c)(t));var i=n.id,r=void 0===i?Object(L.c)("base-model"):i;this.id=r,this.gl=t,this.id=n.id||Object(L.c)("Model"),this.lastLogTime=0,this.initialize(n)}return Object(o.a)(e,[{key:"initialize",value:function(e){this.props={},this.programManager=e.programManager||null;var t=e.program,n=void 0===t?null:t,i=e.vs,r=void 0===i?"":i,a=e.fs,o=void 0===a?"":a,s=e.modules,u=void 0===s?[]:s,c=e.defines,l=void 0===c?{}:c,h=e.inject,f=void 0===h?{}:h,d=e.varyings,v=void 0===d?[]:d,p=e.bufferMode,g=void 0===p?35981:p;this.programProps={program:n,vs:r,fs:o,modules:u,defines:l,inject:f,varyings:v,bufferMode:g},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.animatedUniforms={},this.animated=!1,this.animationLoop=null,this.timerQueryEnabled=!1,this.timeElapsedQuery=void 0,this.lastQueryReturned=!0,this.stats={accumulatedFrameTime:0,averageFrameTime:0,profileFrameCount:0},this.pickable=!0,this._checkProgram(e.shaderCache),this._setBaseModelProps(e),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings)))}},{key:"setProps",value:function(e){this._setBaseModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();var t;this.programManager?this.programManager.release(this.program):this.program.delete(),this.vertexArray.delete(),t=this.id,delete T[t],C.a.deleteItem("luma.gl",t)}},{key:"isAnimated",value:function(){return this.animated}},{key:"getProgram",value:function(){return this.program}},{key:"setProgram",value:function(e){this.programProps=Object.assign({},e),this._programDirty=!0}},{key:"getUniforms",value:function(){return this.uniforms}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),function(e,t){if(E.d.__SEER_INITIALIZED__&&e){var n=M.get(e);n&&n.forEach(function(e,n){A(t,n,e)})}}(this.id,e),e=this._extractAnimatedUniforms(e),Object.assign(this.uniforms,e),this}},{key:"updateModuleSettings",value:function(e){var t=this.getModuleUniforms(e||{});return this.setUniforms(t)}},{key:"clear",value:function(e){return Object(y.a)(this.program.gl,e),this}},{key:"drawGeometry",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();var t,n=e.moduleSettings,i=void 0===n?null:n,r=e.framebuffer,a=e.uniforms,o=void 0===a?{}:a,s=e.attributes,u=void 0===s?{}:s,c=e.transformFeedback,l=void 0===c?this.transformFeedback:c,h=e.parameters,f=void 0===h?{}:h,d=e.vertexArray,v=void 0===d?this.vertexArray:d,p=e.animationProps;T[(t=this).id]||(T[t.id]=t,C.a.listItem("luma.gl",t.id)),this.setAttributes(u),this.updateModuleSettings(i),this.setUniforms(o),this._refreshAnimationProps(p);var g=this._logDrawCallStart(2),m=this.vertexArray.getDrawParams(this.props);m.isInstanced&&!this.isInstanced&&I.a.warn("Found instanced attributes on non-instanced model",this.id)();var y=m.isIndexed,b=m.indexType,_=m.indexOffset,x=this.isInstanced,w=this.instanceCount,O=function(){},P=this.props,S=P.onBeforeRender,j=void 0===S?O:S,k=P.onAfterRender,E=void 0===k?O:k;j(),this._timerQueryStart(),this.program.setUniforms(this.uniforms);var A=this.program.draw(Object.assign({},e,{logPriority:g,uniforms:null,framebuffer:r,parameters:f,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:v,transformFeedback:l,isIndexed:y,indexType:b,isInstanced:x,instanceCount:w,offset:y?_:0}));return this._timerQueryEnd(),E(),this._logDrawCallEnd(g,v,r),A}},{key:"_setBaseModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"timerQueryEnabled"in e&&(this.timerQueryEnabled=e.timerQueryEnabled&&b.a.isSupported(this.gl,["timers"]),e.timerQueryEnabled&&!this.timerQueryEnabled&&I.a.warn("GPU timer not supported")()),"_animationProps"in e&&this._setAnimationProps(e._animationProps),"_animationLoop"in e&&(this.animationLoop=e._animationLoop)}},{key:"_checkProgram",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this._programDirty){var t=this.programProps,n=t.program,i=t.vs,r=t.fs,a=this.programProps,o=a.modules,s=a.inject,u=a.defines,c=a.varyings,l=a.bufferMode;if(n)this.getModuleUniforms=function(){},this._programDirty=!1;else if(this.programManager)n=this.programManager.get({vs:i,fs:r,modules:o,inject:s,defines:u,program:this.program}),this.getModuleUniforms=this.programManager.getUniforms(n);else{var h=this.id;i=i||w.a.vs,r=r||w.a.fs;var f=Object(O.a)(this.gl,{vs:i,fs:r,modules:o,inject:s,defines:u,log:I.a});i=f.vs,r=f.fs,e?(I.a.warn("ShaderCache support will be deprecated in a future luma.gl version")(),n=e.getProgram(this.gl,{id:h,vs:i,fs:r})):n=new _.a(this.gl,{id:h,vs:i,fs:r,varyings:c,bufferMode:l}),this.getModuleUniforms=f.getUniforms||function(e){},this._programDirty=!1}Object(d.a)(n instanceof _.a,"Model needs a program"),n!==this.program&&(this.program&&!this.programManager&&this.program.delete(),this.program=n,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new x.a(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}}},{key:"_refreshAnimationProps",value:function(e){(e=e||this.animationLoop&&this.animationLoop.animationProps)&&this._setAnimationProps(e)}},{key:"_evaluateAnimateUniforms",value:function(e){if(!this.animated)return{};var t={};for(var n in this.animatedUniforms){var i=this.animatedUniforms[n];t[n]=i(e)}return t}},{key:"_extractAnimatedUniforms",value:function(e){var t=!1;for(var n in e){var i=e[n];"function"==typeof i?(this.animatedUniforms[n]=i,t=!0):delete this.animatedUniforms[n]}if(this.animated=!Object(L.a)(this.animatedUniforms),!t)return e;var r={};for(var a in e)this.animatedUniforms[a]||(r[a]=e[a]);return r}},{key:"_timerQueryStart",value:function(){!0===this.timerQueryEnabled&&(this.timeElapsedQuery||(this.timeElapsedQuery=new b.a(this.gl)),this.lastQueryReturned&&(this.lastQueryReturned=!1,this.timeElapsedQuery.beginTimeElapsedQuery()))}},{key:"_timerQueryEnd",value:function(){if(!0===this.timerQueryEnabled&&(this.timeElapsedQuery.end(),this.timeElapsedQuery.isResultAvailable())){this.lastQueryReturned=!0;var e=this.timeElapsedQuery.getTimerMilliseconds();this.stats.lastFrameTime=e,this.stats.accumulatedFrameTime+=e,this.stats.profileFrameCount++,this.stats.averageFrameTime=this.stats.accumulatedFrameTime/this.stats.profileFrameCount,I.a.log(2,"GPU time ".concat(this.program.id,": ").concat(this.stats.lastFrameTime,"ms average ").concat(this.stats.averageFrameTime,"ms accumulated: ").concat(this.stats.accumulatedFrameTime,"ms count: ").concat(this.stats.profileFrameCount))()}}},{key:"_logDrawCallStart",value:function(e){var t=e>3?0:1e4;if(!(I.a.priority>> DRAWING MODEL ".concat(this.id),{collapsed:I.a.priority<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,t,n,i){if(void 0!==e){var r=Object(P.a)({vertexArray:t,header:"".concat(this.id," attributes"),attributes:this._attributes}),a=Object(S.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),o=a.table,s=a.unusedTable,u=a.unusedCount,c=Object(S.a)({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),l=c.table;c.count>0&&I.a.log("MISSING UNIFORMS",Object.keys(l))(),u>0&&I.a.log("UNUSED UNIFORMS",Object.keys(s))();var h=Object(j.a)(this.vertexArray.configuration);I.a.table(e,r)(),I.a.table(e,o)(),I.a.table(e+1,h)(),function(e,t){if(C.a.isReady()&&!C.a.throttle("luma.gl:".concat(e.id),1e3)){var n=e.geometry?Object.assign({},e.geometry.attributes,e.attributes):e.attributes,i=Object.assign({},e.uniforms,t);C.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:i},{path:"objects.attributes",data:n}])}}(this,n),i&&i.log({priority:2,message:"Rendered to ".concat(i.id)}),I.a.groupEnd(2,">>> DRAWING MODEL ".concat(this.id))()}}}]),e}();n.d(t,"a",function(){return F});var F=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,t);var i=n.id,o=void 0===i?Object(L.c)("model"):i;return Object(s.a)(this,Object(u.a)(t).call(this,e,Object(r.a)({},n,{id:o})))}return Object(l.a)(t,e),Object(o.a)(t,[{key:"initialize",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"initialize",this).call(this,e),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced,this._setModelProps(e),this.geometry={},Object(d.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(e){Object(c.a)(Object(u.a)(t.prototype),"setProps",this).call(this,e),this._setModelProps(e)}},{key:"delete",value:function(){Object(c.a)(Object(u.a)(t.prototype),"delete",this).call(this),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:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return Object(d.a)(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return Object(d.a)(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=function(e,t,n){var i={},a=t.indices;for(var o in t.attributes){var s=t.attributes[o],u=p(o,n);if("indices"===o)a=s;else if(s.constant)i[u]=s.value;else{var c=s.value,l=Object(r.a)({},s);delete l.value,i[u]=[new h.a(e,c),l],g(o,l)}}if(a){var f=a.value||a;Object(d.a)(f instanceof Uint16Array||f instanceof Uint32Array,'attribute array for "indices" must be of integer type');var v={size:1,isIndexed:void 0===a.isIndexed||a.isIndexed};i.indices=[new h.a(e,{data:f,target:34963}),v]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(L.a)(e))return this;var t={};for(var n in e){var i=e[n];t[n]=i.getValue?i.getValue():i}return this.vertexArray.setAttributes(t),this}},{key:"draw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.drawGeometry(e)}},{key:"transform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.discard,n=void 0===t||t,r=e.feedbackBuffers,a=e.unbindModels,o=void 0===a?[]:a,s=e.parameters;r&&this._setFeedbackBuffers(r),n&&(s=Object.assign({},s,Object(i.a)({},35977,n))),o.forEach(function(e){return e.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:s}))}finally{o.forEach(function(e){return e.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return I.a.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){"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:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof h.a&&t.delete()}}},{key:"_setAnimationProps",value:function(e){if(this.animated){Object(d.a)(e,"Model.draw(): animated uniforms but no animationProps");var t=this._evaluateAnimateUniforms(e);Object.assign(this.uniforms,t)}}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(L.a)(e))return this;var t=this.program.gl;return this.transformFeedback=this.transformFeedback||new f.a(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}}]),t}(R)},function(e,t,n){"use strict";function i(e,t){if(e===t)return!0;if(Array.isArray(e)){var n=e.length;if(!t||t.length!==n)return!1;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,e,i))).initialize(i),Object.seal(Object(s.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).format;return!t||function(e,t,n){var i=n[t];if(!i)return!1;var r=Object(v.d)(e)&&i.gl2||i.gl1;return"string"==typeof r?e.getExtension(r):r}(e,t,d)}},{key:"getSamplesForFormat",value:function(e,t){var n=t.format;return e.getInternalformatParameter(36161,n,32937)}}]),Object(u.a)(t,[{key:"initialize",value:function(e){var t=e.format,n=e.width,i=void 0===n?1:n,r=e.height,a=void 0===r?1:r,o=e.samples,s=void 0===o?0:o;return Object(p.a)(t,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&Object(v.d)(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,t,i,a):this.gl.renderbufferStorage(36161,t,i,a),this.format=t,this.width=i,this.height=a,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*d[this.format].bpp),this}},{key:"resize",value:function(e){var t=e.width,n=e.height;return t!==this.width||n!==this.height?this.initialize({width:t,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(e){this.gl.bindRenderbuffer(36161,e)}},{key:"_syncHandle",value:function(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}]),t}(l.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var i=n(175),r="7.3.0-alpha.4",a=Object(i.a)()},function(e,t,n){"use strict";var i=n(43);function r(e){var t=e.source,n=e.target,i=e.start,r=void 0===i?0:i,a=e.end,o=e.getData;a=a||n.length;var s=t.length,u=a-r;if(s>u)n.set(t.subarray(0,u),r);else if(n.set(t,r),o)for(var c=s;c=o))&&t instanceof i.a){var f=new Float32Array(o),d=t.getData({}),v=n.size,p=n.constant,g=p?n.getValue():n.getBuffer().getData({}),m=p?function(e,t){return h(g,t)}:function(e,t){return h(g.subarray(e,e+v),t)};!function(e){var t=e.source,n=e.target,i=e.size,a=e.offset,o=void 0===a?0:a,s=e.getData,u=e.sourceLayout,c=e.targetLayout;if(!Array.isArray(c))return r({source:t,target:n,getData:s}),n;for(var l=o,h=o,f=s&&function(e,t){return s(e+h,t)},d=Math.min(u.length,c.length),v=0;v0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e);var n=t.id,i=void 0===n?"effect":n;this.id=i,this.props={},Object.assign(this.props,t)}return o()(e,[{key:"prepare",value:function(){}},{key:"getParameters",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i,r=n(0),a={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"};t.b=(i={},Object(r.a)(i,a.WEBGL2,[!1,!0]),Object(r.a)(i,a.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),Object(r.a)(i,a.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),Object(r.a)(i,a.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),Object(r.a)(i,a.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),Object(r.a)(i,a.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),Object(r.a)(i,a.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),Object(r.a)(i,a.FLOAT_BLEND,["EXT_float_blend"]),Object(r.a)(i,a.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),Object(r.a)(i,a.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),Object(r.a)(i,a.TEXTURE_FLOAT,["OES_texture_float",!0]),Object(r.a)(i,a.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),Object(r.a)(i,a.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),Object(r.a)(i,a.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),Object(r.a)(i,a.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),Object(r.a)(i,a.COLOR_ATTACHMENT_RGBA32F,["WEBGL_color_buffer_float","EXT_color_buffer_float"]),Object(r.a)(i,a.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),Object(r.a)(i,a.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),Object(r.a)(i,a.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),Object(r.a)(i,a.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),Object(r.a)(i,a.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),Object(r.a)(i,a.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),i)},function(e,t,n){"use strict";function i(e,t){return e===t||Object.keys(e).every(function(n){return Array.isArray(e[n])&&Array.isArray(t[n])?i(e[n],t[n]):e[n]===t[n]})}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(4),r=n(10),a=n(33),o=n(9),s=n(47),u=n(5),c=n(11),l=n(53),h=n(43),f=n(30),d=null;function v(e,t){var n;return new e((n=e.BYTES_PER_ELEMENT*t,(!d||d.byteLength1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,t);var u=s.id||s.program&&s.program.id;return(n=Object(r.a)(this,Object(o.a)(t).call(this,e,Object.assign({},s,{id:u})))).hasVertexArrays=t.isSupported(e),n.buffer=null,n.bufferValue=null,n.initialize(s),Object.seal(Object(a.a)(n)),n}return Object(c.a)(t,e),Object(u.a)(t,null,[{key:"isSupported",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero?Object(f.d)(e)||"Chrome"===function(e){if(!e&&!Object(m.a)())return"Node";if(Object(y.a)(e))return"Electron";var t="undefined"!=typeof navigator?navigator:{},n=e||t.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r?"IE":g.b.chrome?"Chrome":g.b.safari?"Safari":g.b.mozInnerScreenX?"Firefox":"Unknown"}():Object(f.d)(e)||e.getExtension("OES_vertex_array_object")}},{key:"getDefaultArray",value:function(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new t(e,{handle:null})),e.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(e){return t.MAX_ATTRIBUTES=t.MAX_ATTRIBUTES||e.getParameter(34921),t.MAX_ATTRIBUTES}},{key:"setConstant",value:function(e,n,i){switch(i.constructor){case Float32Array:t._setConstantFloatArray(e,n,i);break;case Int32Array:t._setConstantIntArray(e,n,i);break;case Uint32Array:t._setConstantUintArray(e,n,i);break;default:Object(p.a)(!1)}}}]),Object(u.a)(t,[{key:"delete",value:function(){Object(s.a)(Object(o.a)(t.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(e)}},{key:"setProps",value:function(e){return this}},{key:"setElementBuffer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(p.a)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(function(){e.gl.bindBuffer(34963,t?t.handle:null)}),this}},{key:"setBuffer",value:function(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);var i=n.size,r=n.type,a=n.stride,o=n.offset,s=n.normalized,u=n.integer,c=n.divisor,l=this.gl;return e=Number(e),this.bind(function(){l.bindBuffer(34962,t.handle),u?(Object(p.a)(Object(f.d)(l)),l.vertexAttribIPointer(e,i,r,a,o)):l.vertexAttribPointer(e,i,r,s,a,o),l.enableVertexAttribArray(e),l.vertexAttribDivisor(e,c||0)}),this}},{key:"enable",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!i&&0===e&&!t.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(function(){return i?n.gl.enableVertexAttribArray(e):n.gl.disableVertexAttribArray(e)})),this}},{key:"getConstantBuffer",value:function(e,t,n){var i=this._normalizeConstantArrayValue(t,n),r=i.byteLength*e,a=i.length*e,o=!this.buffer;if(this.buffer=this.buffer||new h.a(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(i,this.bufferValue)){var s=v(t.constructor,a);!function(e){for(var t=e.target,n=e.source,i=e.start,r=void 0===i?0:i,a=e.count,o=void 0===a?1:a,s=n.length,u=o*s,c=0,l=r;c1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;this._registerShaderModule(u,n)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}},{key:"getShaderModule",value:function(e){if(e instanceof a.a)return e;if("string"!=typeof e)return this._registerShaderModule(e,!0);var t=this.shaderModules[e];return t||Object(o.a)(!1,"Unknown shader module ".concat(e)),t}},{key:"resolveModules",value:function(e){var t=this;return e.map(function(e){return t.getShaderModule(e)})}},{key:"_registerShaderModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof a.a)return e;if(Object(o.a)(e.name,"shader module has no name"),this.shaderModules[e.name]&&!t)throw new Error("shader module ".concat(e.name," already registered"));return(e=new a.a(e)).dependencies=this.resolveModules(e.dependencies),this.shaderModules[e.name]=e,this.shaderModules[e.name]}}]),e}();n.d(t,"e",function(){return c}),n.d(t,"a",function(){return l}),n.d(t,"c",function(){return h}),n.d(t,"d",function(){return f}),n.d(t,"b",function(){return d});var u=new s;function c(e){u.setDefaultShaderModules(e)}function l(){return u.getDefaultShaderModules()}function h(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ignoreMultipleRegistrations,n=void 0!==t&&t;u.registerShaderModules(e,{ignoreMultipleRegistrations:n})}function f(e){return e=e.concat(u.defaultShaderModules),v(e=u.resolveModules(e))}function d(e){return u.getShaderModule(e)}function v(e){var t={},n={};return p({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort(function(e,t){return n[t]-n[e]}).map(function(e){return t[e]})}function p(e){var t=e.modules,n=e.level,i=e.moduleMap,r=e.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l.name]=l,(void 0===r[l.name]||r[l.name]1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,i=void 0===n?null:n,a=t.color,l=void 0===a?null:a,h=t.depth,f=void 0===h?null:h,d=t.stencil,p=void 0===d?null:d,g={};i&&(g.framebuffer=i);var m=0;l&&(m|=c,!0!==l&&(g.clearColor=l)),f&&(m|=s,!0!==f&&(g.clearDepth=f)),p&&(m|=u,!0!==f&&(g.clearStencil=f)),Object(o.a)(0!==m,v),Object(r.a)(e,g,function(){e.clear(m)})}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.framebuffer,s=void 0===n?null:n,u=t.buffer,c=void 0===u?l:u,p=t.drawBuffer,g=void 0===p?0:p,m=t.value,y=void 0===m?[0,0,0,0]:m;Object(a.a)(e),Object(r.a)(e,{framebuffer:s},function(){switch(c){case l:switch(y.constructor){case Int32Array:e.clearBufferiv(c,g,y);break;case Uint32Array:e.clearBufferuiv(c,g,y);break;case Float32Array:default:e.clearBufferfv(c,g,y)}break;case h:e.clearBufferfv(h,0,[y]);break;case f:e.clearBufferiv(f,0,[y]);break;case d:var t=Object(i.a)(y,2),n=t[0],r=t[1];e.clearBufferfi(d,0,n,r);break;default:Object(o.a)(!1,v)}})}},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=function(e){function t(e){var n;r()(this,t),n=u()(this,l()(t).call(this,e));var i=e._shadow,a=void 0!==i&&i;return n.shadow=a,n}return f()(t,e),o()(t,[{key:"getProjectedLight",value:function(){return this}}]),t}(n(148).b)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(13),f=n.n(h),d=n(7),v=n.n(d),p=n(132),g=n(92),m=n(59),y=n(20).experimental.Tesselator,b=function(e){function t(e){var n=e.data,i=e.getGeometry,a=e.positionFormat,o=e.fp64;return r()(this,t),u()(this,l()(t).call(this,{data:n,getGeometry:i,positionFormat:a,attributes:{startPositions:{size:3,padding:3,type:o?Float64Array:Float32Array},endPositions:{size:3,padding:3,type:o?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray},startPositions64XyLow:{size:2,padding:2,fp64Only:!0},endPositions64XyLow:{size:2,padding:2,fp64Only:!0}}}))}return v()(t,e),o()(t,[{key:"get",value:function(e){return this.attributes[e]}},{key:"getGeometrySize",value:function(e){var t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t<3?0:t+1:t-1}},{key:"updateGeometryAttributes",value:function(e,t){var n=this.attributes,i=n.startPositions,r=n.endPositions,a=n.segmentTypes,o=t.geometrySize;if(0!==o)for(var s,u,c=this.isClosed(e),l=t.vertexStart,h=0;h=e.length&&(t+=1-e.length/n),[e[t*n],e[t*n+1],3===n?e[t*n+2]:0]}return t>=e.length&&(t+=1-e.length),e[t]}},{key:"isClosed",value:function(e){var t=this.getPathLength(e),n=this.getPointOnPath(e,0),i=this.getPointOnPath(e,t-1);return n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]}}]),t}(y);n.d(t,"a",function(){return O});var _=[0,0,0,255],x={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},rounded:!1,miterLimit:{type:"number",min:0,value:4},dashJustified:!1,billboard:!1,getPath:{type:"accessor",value:function(e){return e.path}},getColor:{type:"accessor",value:_},getWidth:{type:"accessor",value:1},getDashArray:{type:"accessor",value:[0,0]}},w={enter:function(e,t){return t.length?t.subarray(t.length-e.length):e}},O=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return f()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec2 instanceLeftPositions64xyLow;\nattribute vec2 instanceStartPositions64xyLow;\nattribute vec2 instanceEndPositions64xyLow;\nattribute vec2 instanceRightPositions64xyLow;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec2 instanceDashArrays;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n float relativePosition, bool isEnd, bool isJoint,\n vec2 width, vec2 widthPixels\n) {\n vec2 deltaA = (currPoint.xy - prevPoint.xy) / width;\n vec2 deltaB = (nextPoint.xy - currPoint.xy) / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n lenA = lenA > EPSILON ? lenA : 0.0;\n lenB = lenB > EPSILON ? lenB : 0.0;\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = vec2(dirA + dirB);\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x;\n\n float offsetScale = 1.0 / max(sinHalfA, EPSILON);\n\n float cornerPosition = isJoint ?\n 0.0 :\n flipIfTrue(turnsRight == (relativePosition > 0.0));\n cornerPosition *=\n float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) * cosHalfA);\n if (cornerPosition < 0.0) {\n offsetScale = min(offsetScale, L / max(cosHalfA, EPSILON));\n }\n\n vMiterLength = cornerPosition >= 0.0 ?\n mix(offsetScale, 0.0, cornerPosition) :\n offsetScale * cornerPosition;\n vMiterLength -= sinHalfA * jointType;\n\n float offsetDirection = mix(\n positions.y,\n mix(\n flipIfTrue(turnsRight),\n positions.y * flipIfTrue(turnsRight == (positions.x == 1.)),\n cornerPosition\n ),\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition));\n offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition));\n bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n bool isCap = isStartCap || isEndCap;\n cornerPosition = isCap ? (1.0 - positions.z) : 0.;\n if (isStartCap) {\n offsetVec = mix(dirB, perpB, cornerPosition);\n }\n if (isEndCap) {\n offsetVec = mix(dirA, perpA, cornerPosition);\n }\n if (isCap) {\n offsetScale = mix(4.0 * jointType, 1.0, cornerPosition);\n vMiterLength = 1.0 - cornerPosition;\n offsetDirection = mix(flipIfTrue(isStartCap), positions.y, cornerPosition);\n }\n\n vCornerOffset = offsetVec * offsetDirection * offsetScale;\n vDashArray = instanceDashArrays;\n vPathLength = L;\n vec2 offsetFromStartOfPath = vCornerOffset;\n if (isEnd) {\n offsetFromStartOfPath += deltaA;\n }\n vec2 dir = isEnd ? dirA : dirB;\n vPathPosition = vec2(\n positions.y + positions.z * offsetDirection,\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(vCornerOffset * widthPixels * isValid, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n return currPoint + vec3(offset.xy / widthPixels * width, 0.0);\n}\nvec3 lineJoin(vec3 prevPoint, vec3 currPoint, vec3 nextPoint) {\n\n float relativePosition = positions.y;\n bool isEnd = positions.x > EPSILON;\n bool isJoint = positions.z > EPSILON;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n\n vec2 width = billboard ? project_pixel_size_to_clipspace(widthPixels) : project_pixel_size(widthPixels);\n\n return lineJoin(\n prevPoint, currPoint, nextPoint,\n relativePosition, isEnd, isJoint,\n width, widthPixels\n );\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.worldPosition = instanceStartPositions;\n geometry.worldPositionAlt = instanceEndPositions;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec2 prevPosition64xyLow = mix(instanceLeftPositions64xyLow, instanceStartPositions64xyLow, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec2 currPosition64xyLow = mix(instanceStartPositions64xyLow, instanceEndPositions64xyLow, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec2 nextPosition64xyLow = mix(instanceEndPositions64xyLow, instanceRightPositions64xyLow, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64xyLow, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64xyLow, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64xyLow, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64xyLow);\n currPosition = project_position(currPosition, currPosition64xyLow);\n nextPosition = project_position(nextPosition, nextPosition64xyLow);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float jointType;\nuniform float miterLimit;\nuniform float alignMode;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vDashArray;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nfloat mod2(float a, float b) {\n return a - floor(a / b) * b;\n}\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\nbool dash_isFragInGap() {\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n\n float unitLength = solidLength + gapLength;\n\n if (unitLength == 0.0) {\n return false;\n }\n\n unitLength = mix(\n unitLength,\n vPathLength / round(vPathLength / unitLength),\n alignMode\n );\n\n float offset = alignMode * solidLength / 2.0;\n\n return gapLength > 0.0 &&\n vPathPosition.y >= 0.0 &&\n vPathPosition.y <= vPathLength &&\n mod2(vPathPosition.y + offset, unitLength) > solidLength;\n}\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n if (jointType > 0.0 && vMiterLength > 0.0 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (jointType == 0.0 && vMiterLength > miterLimit) {\n discard;\n }\n if (vColor.a == 0.0 || dash_isFragInGap()) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){var e=this;this.getAttributeManager().addInstanced({startPositions:{size:3,offset:12,type:this.use64bitPositions()?5130:5126,transition:w,accessor:"getPath",update:this.calculateStartPositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{offset:0},instanceStartPositions:{offset:12}}},endPositions:{size:3,type:this.use64bitPositions()?5130:5126,transition:w,accessor:"getPath",update:this.calculateEndPositions,noAlloc:!0,shaderAttributes:{instanceEndPositions:{offset:0},instanceRightPositions:{offset:12}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:w,defaultValue:1},instanceDashArrays:{size:2,accessor:"getDashArray"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:w,defaultValue:_},instancePickingColors:{size:3,type:5121,accessor:function(t,n){var i=n.index,r=n.target;return e.encodePickingColor(i,r)}}}),this.setState({pathTesselator:new b({fp64:this.use64bitPositions()})})}},{key:"updateState",value:function(e){var n=e.oldProps,i=e.props,r=e.changeFlags;f()(l()(t.prototype),"updateState",this).call(this,{props:i,oldProps:n,changeFlags:r});var a=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator;o.updateGeometry({data:i.data,getGeometry:i.getPath,positionFormat:i.positionFormat,dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,bufferLayout:o.bufferLayout}),r.dataChanged||a.invalidateAll()}if(r.extensionsChanged){var s=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(s)}),a.invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.rounded,a=i.billboard,o=i.miterLimit,s=i.widthUnits,u=i.widthScale,c=i.widthMinPixels,l=i.widthMaxPixels,h=i.dashJustified,f="pixels"===s?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{jointType:Number(r),billboard:a,alignMode:Number(h),widthScale:u*f,miterLimit:o,widthMinPixels:c,widthMaxPixels:l})).draw()}},{key:"_getModel",value:function(e){return new g.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.a({drawMode:4,attributes:{indices:new Uint16Array([0,2,1,1,2,4,1,4,3,3,4,5]),positions:new Float32Array([0,0,1,0,-1,0,0,1,0,1,-1,0,1,1,0,1,0,1])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"calculateStartPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("startPositions")}},{key:"calculateEndPositions",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("endPositions")}},{key:"calculateSegmentTypes",value:function(e){var t=this.state.pathTesselator;e.bufferLayout=t.bufferLayout,e.value=t.get("segmentTypes")}},{key:"clearPickingColor",value:function(e){for(var t=this.decodePickingColor(e),n=this.state.pathTesselator.bufferLayout,i=n[t],r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in t){var n=t.lightSources||{},i=n.ambientLight,o=n.pointLights,s=n.directionalLights,u=i||o&&o.length>0||s&&s.length>0;return u?Object.assign({},function(e){var t=e.ambientLight,n=e.pointLights,i=void 0===n?[]:n,r=e.directionalLights,o=void 0===r?[]:r,s={};s["lighting_uAmbientLight.color"]=t?a(t):[0,0,0];return i.forEach(function(e,t){s["lighting_uPointLight[".concat(t,"].color")]=a(e),s["lighting_uPointLight[".concat(t,"].position")]=e.position,s["lighting_uPointLight[".concat(t,"].attenuation")]=e.attenuation}),s.lighting_uPointLightCount=i.length,o.forEach(function(e,t){s["lighting_uDirectionalLight[".concat(t,"].color")]=a(e),s["lighting_uDirectionalLight[".concat(t,"].direction")]=e.direction}),s.lighting_uDirectionalLightCount=o.length,s}({ambientLight:i,pointLights:o,directionalLights:s}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var c={pointLights:[],directionalLights:[]},l=!0,h=!1,f=void 0;try{for(var d,v=(t.lights||[])[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var p=d.value;switch(p.type){case"ambient":c.ambientLight=p;break;case"directional":c.directionalLights.push(p);break;case"point":c.pointLights.push(p)}}}catch(e){h=!0,f=e}finally{try{l||null==v.return||v.return()}finally{if(h)throw f}}return e({lightSources:c})}return{}},defines:{MAX_LIGHTS:3}},{});function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.color,n=void 0===t?[0,0,0]:t,i=e.intensity,r=void 0===i?1:i;return n.map(function(e){return e*r/255})}},function(e,t,n){"use strict";function i(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)})}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.overAlloc,i=void 0===n?2:n,a=t.poolSize,o=void 0===a?100:a;r()(this,e),this.overAlloc=i,this.poolSize=o,this._pool=[]}return o()(e,[{key:"allocate",value:function(e,t,n){var i=n.size,r=void 0===i?1:i,a=n.type,o=n.padding,s=void 0===o?0:o,u=n.copy,c=void 0!==u&&u,l=a||e&&e.constructor||Float32Array,h=t*r+s;if(ArrayBuffer.isView(e)){if(h<=e.length)return e;if(h*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new l(e.buffer,0,h)}var f=this._allocate(l,h);return e&&c?f.set(e):f.fill(0,0,4),this._release(e),f}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,t){t=Math.max(Math.ceil(t*this.overAlloc),1);var n=this._pool,i=e.BYTES_PER_ELEMENT*t,r=n.findIndex(function(e){return e.byteLength>=i});return r>=0?new e(n.splice(r,1)[0],0,t):new e(t)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var t=this._pool,n=e.buffer,i=n.byteLength,r=t.findIndex(function(e){return e.byteLength>=i});r<0?t.push(n):(r>0||t.lengththis.poolSize&&t.shift()}}}]),e}();t.a=new s},function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o});var i=n(58),r={};function a(e){e=Array.isArray(e)?e:[e];var t=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var u=o.value,c=Object(i.b)(u),l=!0,h=!1,f=void 0;try{for(var d,v=c.extensions[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var p=d.value;r[p]=c}}catch(e){h=!0,f=e}finally{try{l||null==v.return||v.return()}finally{if(h)throw f}}}}catch(e){n=!0,a=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}}function o(){return Object.values(r)}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"d",function(){return s});var i="Failed to deduce GL constant from typed array";function r(e){switch(ArrayBuffer.isView(e)?e.constructor:e){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(i)}}function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===t||t;switch(e){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;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o(e){var t=e.data,n=e.width,i=e.height,r=e.bytesPerPixel,a=void 0===r?4:r,o=e.temp,s=n*a;o=o||new Uint8Array(s);for(var u=0;u=24&&2303741511===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint32(16,u),height:e.getUint32(20,u)}}}],["image/jpeg",{test:function(e){return e.byteLength>=2&&65496===e.getUint16(0,u)},getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,u))return null;var t=function(){for(var e=new Set([65499,65476,65484,65501,65534]),t=65504;t<65520;++t)e.add(t);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:n}}(),n=t.tableMarkers,i=t.sofMarkers,r=2;for(;r=10&&1195984440===e.getUint32(0,u)},getSize:function(e){return{width:e.getUint16(6,c),height:e.getUint16(8,c)}}}],["image/bmp",{test:function(e){return e.byteLength>=2&&16973===e.getUint16(0,u)},getSize:function(e){return{width:e.getUint32(18,c),height:e.getUint32(22,c)}}}]]);var h="Invalid MIME type. Supported MIME types are: ".concat(Array.from(l.keys()).join(", "));function f(e){var t=p(e),n=!0,i=!1,r=void 0;try{for(var a,o=l.entries()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=Object(s.a)(a.value,2),c=u[0];if((0,u[1].test)(t))return c}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(0,v(t=t||f(e)).getSize)(p(e));if(!n)throw new Error("invalid image data for type: ".concat(t));return n}(e,t=t||f(e));return n.mimeType=t,n}function v(e){var t=l.get(e);if(!t)throw new Error(h);return t}function p(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return new DataView(e.buffer||e);throw new Error("toDataView")}n.d(t,"a",function(){return g}),n.d(t,"d",function(){return m}),n.d(t,"b",function(){return y}),n.d(t,"e",function(){return _}),n.d(t,"c",function(){return x});var g=o.a._parseImageNode||"undefined"!=typeof ImageBitmap;function m(e,t){if(o.a._parseImageNode){var n=d(e).mimeType;return o.a._parseImageNode(e,n,t)}return _(e,t)}function y(e){return b.apply(this,arguments)}function b(){return(b=Object(a.a)(r.a.mark(function e(t){var n,i,a,o=arguments;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:{},"undefined"!=typeof Image){e.next=9;break}return e.next=4,fetch(t,n);case 4:return i=e.sent,e.next=7,i.arrayBuffer();case 7:return a=e.sent,e.abrupt("return",m(a,n));case 9:return e.next=11,x(t,n);case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _(e,t){if("undefined"==typeof createImageBitmap)throw new Error("parseImage");var n=new Blob([new Uint8Array(e)]);return createImageBitmap(n,{imageOrientation:t.imageOrientation||"none",premultiplyAlpha:t.premultiplyAlpha||"default"})}function x(e,t){return w.apply(this,arguments)}function w(){return(w=Object(a.a)(r.a.mark(function e(t,n){var i,a,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!/\.svg((\?|#).*)?$/.test(t)){e.next=10;break}return e.next=3,fetch(t,n);case 3:return a=e.sent,e.next=6,a.text();case 6:o=e.sent,i="data:image/svg+xml;base64,".concat(btoa(o)),e.next=13;break;case 10:return e.next=12,t;case 12:i=e.sent;case 13:return e.next=15,new Promise(function(e,r){try{var a=new Image;a.onload=function(){return e(a)},a.onerror=function(e){return r(new Error("Could not load image ".concat(t,": ").concat(e)))},a.crossOrigin=n&&n.crossOrigin||"anonymous",a.src=i}catch(e){r(e)}});case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return h});var i=n(23),r=n(121),a="void main() {gl_FragColor = vec4(0);}",o="#version 300 es\nout vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}";function s(e,t){t=Array.isArray(t)?t:[t];var n=e.replace(/^\s+/,"").split(/\s+/),r=Object(i.a)(n,3),a=r[0],o=r[1],s=r[2];return t.includes(a)&&o&&s?{qualifier:a,type:o,name:s.split(";")[0]}:null}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?100:t,i=e.input,r=e.inputType,s=e.output;if(!i)return 300===n?o:a;var u=h(i,r);return 300===n?"#version 300 es\nin ".concat(r," ").concat(i,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(e){switch(e){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}function l(e){switch(e){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}function h(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:return Object(r.a)(!1),null}}},function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return s});var i=n(19),r="";function a(e){r=e}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)("string"==typeof e),e=r+e;var n=t.dataType||"text";return fetch(e,t).then(function(e){return e[n]()})}function s(e,t){return Object(i.a)("string"==typeof e),e=r+e,new Promise(function(n,i){try{var r=new Image;r.onload=function(){return n(r)},r.onerror=function(){return i(new Error("Could not load image ".concat(e,".")))},r.crossOrigin=t&&t.crossOrigin||"anonymous",r.src=e}catch(e){i(e)}})}},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var i,r=n(111).a&&"undefined"!=typeof document,a=r&&"complete"===document.readyState;function o(){return i||(i=r?new Promise(function(e,t){if(r&&"complete"===document.readyState)return a=!0,void e(document);window.onload=function(){a=!0,e(document)}}):Promise.resolve({})),i}function s(e){var t,n=e.canvas,i=e.width,r=e.height,o=e.onError,s=void 0===o?function(){}:o;return"string"==typeof n?(a||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),t=document.getElementById(n)):t=n||function(e){var t=e.width,n=void 0===t?800:t,i=e.height,r=void 0===i?600:i,a=e.id,o=void 0===a?"gl-canvas":a,s=e.insert,u=void 0===s||s,c=document.createElement("canvas");if(c.id=o,c.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",c.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",u){var l=document.body;l.insertBefore(c,l.firstChild)}return c}({id:"lumagl-canvas",width:i,height:r,onError:s}),t}},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n(4),r=n(10),a=n(9),o=n(33),s=n(5),u=n(11),c=n(57),l=n(30),h=n(126),f=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.b)(e),(s instanceof Promise||"string"==typeof s)&&(s={data:s}),"string"==typeof s.data&&(s=Object.assign({},s,{data:Object(h.b)(s.data)})),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,Object.assign({},s,{target:3553})))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e,t){return c.a.isSupported(e,t)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"a",function(){return l});var i=n(105),r=n(30),a=n(19),o=n(25),s=2;function u(e,t){return c(e,t)}function c(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return h(e,t)})}function l(e){if(e.luma=e.luma||{},!e.luma.caps)for(var t in e.luma.caps={},e.luma.caps.webgl2=Object(r.d)(e),i.b)e.luma.caps[t]=h(e,t);return e.luma.caps}function h(e,t){var n=i.b[t];Object(a.a)(n,t);var u,c=Object(r.d)(e)&&n[1]||n[0];if("function"==typeof c)u=c(e);else if(Array.isArray(c)){u=!0;var l=!0,h=!1,f=void 0;try{for(var d,v=c[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){var p=d.value;u=u&&Boolean(e.getExtension(p))}}catch(e){h=!0,f=e}finally{try{l||null==v.return||v.return()}finally{if(h)throw f}}}else"string"==typeof c?u=Boolean(e.getExtension(c)):"boolean"==typeof c?u=c:Object(a.a)(!1);return u||o.a.log(s,"Feature: ".concat(t," not supported"))(),u}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(4),r=function e(){Object(i.a)(this,e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return w}),n.d(t,"b",function(){return O});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(186),v=n(22),p=n(84),g=n(139),m=n(82),y=n(83),b={orbitAxis:"Z",rotationX:0,rotationOrbit:0,fovy:50,zoom:0,target:[0,0,0],minRotationX:-90,maxRotationX:90,minZoom:-1/0,maxZoom:1/0},_={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new m.a(["target","zoom","rotationX","rotationOrbit"]),transitionInterruption:y.a.BREAK},x=function(e){return Math.pow(2,e)},w=function(e){function t(e){var n,i=e.ViewportType,a=e.width,o=e.height,s=e.orbitAxis,c=void 0===s?b.orbitAxis:s,h=e.rotationX,f=void 0===h?b.rotationX:h,d=e.rotationOrbit,v=void 0===d?b.rotationOrbit:d,p=e.target,g=void 0===p?b.target:p,m=e.zoom,y=void 0===m?b.zoom:m,_=e.fovy,x=void 0===_?b.fovy:_,w=e.minRotationX,O=void 0===w?b.minRotationX:w,P=e.maxRotationX,S=void 0===P?b.maxRotationX:P,j=e.minZoom,k=void 0===j?b.minZoom:j,C=e.maxZoom,E=void 0===C?b.maxZoom:C,T=e.startPanPosition,A=e.startTarget,M=e.startRotationX,L=e.startRotationOrbit,I=e.startZoomPosition,R=e.startZoom;return r()(this,t),(n=u()(this,l()(t).call(this,{width:a,height:o,orbitAxis:c,rotationX:f,rotationOrbit:v,target:g,fovy:x,zoom:y,minRotationX:O,maxRotationX:S,minZoom:k,maxZoom:E})))._interactiveState={startPanPosition:T,startTarget:A,startRotationX:M,startRotationOrbit:L,startZoomPosition:I,startZoom:R},n.ViewportType=i,n}return f()(t,e),o()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps.target;return this._getUpdatedState({startPanPosition:t,startTarget:n})}},{key:"pan",value:function(e){var t=e.pos,n=(e.startPos,this._interactiveState),i=n.startPanPosition,r=n.startTarget,a=new d.a(t).subtract(i);return this._getUpdatedState({target:this._calculateNewTarget({startTarget:r,pixelOffset:a})})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startTarget:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,i=this._interactiveState,r=i.startRotationX,a=i.startRotationOrbit;return Number.isFinite(r)&&Number.isFinite(a)?((r<-90||r>90)&&(t*=-1),this._getUpdatedState({rotationX:r+180*n,rotationOrbit:a+180*t,isRotating:!0})):this}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(e){return Object.assign({},this._viewportProps)}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPosition:t,startTarget:this._viewportProps.target,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.width,s=r.height,u=r.target,c=this._interactiveState,l=c.startZoom,h=c.startZoomPosition,f=c.startTarget;Number.isFinite(l)||(l=a,f=u,h=n||t);var d=this._calculateNewZoom({scale:i,startZoom:l}),v=x(l),p=x(d),g=(o/2-h[0])*(p/v-1),m=(s/2-h[1])*(p/v-1);return this._getUpdatedState({zoom:d,target:this._calculateNewTarget({startTarget:f,zoom:d,pixelOffset:[g,m]})})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startTarget:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:2})})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:.5})})}},{key:"moveLeft",value:function(){var e=[-50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveRight",value:function(){var e=[50,0];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveUp",value:function(){var e=[0,-50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"moveDown",value:function(){var e=[0,50];return this._getUpdatedState({target:this._calculateNewTarget({pixelOffset:e})})}},{key:"rotateLeft",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+10})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,i=this._viewportProps,r=i.maxZoom,a=i.minZoom;Number.isFinite(n)||(n=this._viewportProps.zoom);var o=n+Math.log2(t);return Object(v.b)(o,a,r)}},{key:"_calculateNewTarget",value:function(e){var t=e.startTarget,n=e.zoom,i=e.pixelOffset,r=Object.assign({},this._viewportProps);Number.isFinite(n)&&(r.zoom=n),t&&(r.target=t);var a=new this.ViewportType(r),o=a.project(r.target);return a.unproject([o[0]-i[0],o[1]-i[1],o[2]])}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom,r=e.maxRotationX,a=e.minRotationX;return e.zoom=Object(v.b)(i,n,t),e.rotationX=Object(v.b)(e.rotationX,a,r),e}}]),t}(g.a),O=function(e){function t(e){return r()(this,t),u()(this,l()(t).call(this,w,e))}return f()(t,e),o()(t,[{key:"_getTransitionProps",value:function(){return _}}]),t}(p.a)},function(e,t,n){"use strict";var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),h=n(3),f=n.n(h),d=n(7),v=n.n(d),p=n(32),g=n(170),m=n(72),y=n(22),b=n(96),_=function(){function e(t){o()(this,e),this.transitions=new Map,this.timeline=t}return u()(e,[{key:"add",value:function(e,t,n,i){var r=this.transitions;if(r.has(e)){var a=r.get(e);t=this._getValue(a),a.onInterrupt(),this.remove(e)}(i=Object(b.c)(i))&&r.set(e,Object.assign({fromValue:t,toValue:n,handle:null},i))}},{key:"remove",value:function(e){var t=this.transitions;t.has(e)&&(this.timeline.removeChannel(t.get(e).handle),t.delete(e))}},{key:"update",value:function(){var e={},t=this.timeline,n=!0,i=!1,a=void 0;try{for(var o,s=this.transitions[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=r()(o.value,2),c=u[0],l=u[1];null===l.handle&&(l.onStart(),l.handle=t.addChannel({delay:t.getTime(),duration:l.duration})),e[c]=this._getValue(l),t.isFinished(l.handle)&&(l.onEnd(),this.remove(c))}}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return e}},{key:"_getValue",value:function(e){var t=this.timeline.getTime(e.handle),n=e.fromValue,i=e.toValue,r=e.duration,a=e.easing;return Object(y.g)(n,i,a(t/r))}},{key:"clear",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.transitions.keys()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this.remove(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}}},{key:"active",get:function(){return this.transitions.size>0}}]),e}(),x=n(31),w=n.n(x),O=n(18);function P(e,t){var n=j({newProps:e,oldProps:t,propTypes:T(e),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(e,t){if(null===t)return"oldProps is null, initial diff";var n=null,i=e.dataComparator,r=e._dataDiff;i?i(e.data,t.data)||(n="Data comparator detected a change"):e.data!==t.data&&(n="A new data container was supplied");n&&r&&(n=r(e.data,t.data)||n);return n}(e,t),r=!1;return i||(r=function(e,t){if(null===t)return"oldProps is null, initial diff";if("all"in e.updateTriggers){var n=E(e,t,"all");if(n)return{all:!0}}var i={},r=!1;for(var a in e.updateTriggers)if("all"!==a){var o=E(e,t,a);o&&(i[a]=!0,r=i)}return r}(e,t)),{dataChanged:i,propsChanged:n,updateTriggersChanged:r,extensionsChanged:C(e,t),transitionsChanged:S(e,t)}}function S(e,t){if(!e.transitions)return null;var n={},i=T(e);for(var r in e.transitions){var a=i[r],o=a&&a.type;("number"===o||"color"===o||"array"===o)&&k(e[r],t[r],a)&&(n[r]=!0)}return n}function j(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.newProps,n=e.oldProps,i=e.ignoreProps,r=void 0===i?{}:i,a=e.propTypes,o=void 0===a?{}:a,s=e.triggerName,u=void 0===s?"props":s;if(Object(O.a)(void 0!==n&&void 0!==t,"compareProps args"),n===t)return null;if("object"!==w()(t)||null===t)return"".concat(u," changed shallowly");if("object"!==w()(n)||null===n)return"".concat(u," changed shallowly");for(var c=Object.keys(t),l=0;l=0&&n.modules.splice(i,1)}return"inject"in t&&(n.inject=Object.assign({},e.inject,t.inject)),n}var R=n(153),F=n(100),D=n(74),N={boolean:{validate:function(e,t){return!0},equal:function(e,t,n){return Boolean(e)===Boolean(t)}},number:{validate:function(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},color:{validate:function(e,t){return V(e)&&(3===e.length||4===e.length)},equal:function(e,t,n){return z(e,t)}},accessor:{validate:function(e,t){var n=G(e);return"function"===n||n===G(t.value)},equal:function(e,t,n){return"function"==typeof t||z(e,t)}},array:{validate:function(e,t){return t.optional&&!e||V(e)},equal:function(e,t,n){return n.compare?z(e,t):e===t}},function:{validate:function(e,t){return t.optional&&!e||"function"==typeof e},equal:function(e,t,n){return!n.compare||e===t}}};function z(e,t){if(e===t)return!0;if(!V(e)||!V(t))return!1;var n=e.length;if(n!==t.length)return!1;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null;o()(this,e),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=te,this.oldAsyncProps=null}return u()(e,[{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps)for(var e in this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var t=this.asyncProps[e];return t&&t.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){var t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}},{key:"setAsyncProps",value:function(e){var t=e._asyncPropResolvedValues||{},n=e._asyncPropOriginalValues||e,i=e._asyncPropDefaultValues||{};for(var r in t){var a=t[r];this._createAsyncPropData(r,a,i[r]),this._updateAsyncProp(r,a)}for(var o in n){var s=n[o];this._createAsyncPropData(o,s,i[o]),this._updateAsyncProp(o,s)}}},{key:"_updateAsyncProp",value:function(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t)t=(0,this.layer.props.fetch)(t,{propName:e,layer:this.layer});t instanceof Promise?this._watchPromise(e,t):Object(D.b)(t)?this._resolveAsyncIterable(e,t):this._setPropValue(e,t)}}},{key:"_didAsyncInputValueChange",value:function(e,t){var n=this.asyncProps[e];return t!==n.lastValue&&(n.lastValue=t,!0)}},{key:"_setPropValue",value:function(e,t){var n=this.asyncProps[e];n.value=t,n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount}},{key:"_setAsyncPropValue",value:function(e,t,n){var i=this.asyncProps[e];i&&n>=i.resolvedLoadCount&&(Object(O.a)(void 0!==t),this.freezeAsyncOldProps(),i.resolvedValue=t,i.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}},{key:"_watchPromise",value:function(e,t){var n=this,i=this.asyncProps[e];i.pendingLoadCount++;var r=i.pendingLoadCount;t.then(function(t){t=n._postProcessValue(e,t),n._setAsyncPropValue(e,t,r);var i=n.layer.props.onDataLoad;"data"===e&&i&&i(t,{propName:e,layer:n.layer})}).catch(function(e){return M.a.error(e)()})}},{key:"_resolveAsyncIterable",value:function(){var e=J()(K.a.mark(function e(t,n){var i,r,a,o,s,u,c,l,h,f,d,v;return K.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"data"!==t&&this._setPropValue(t,n),(i=this.asyncProps[t]).pendingLoadCount++,r=i.pendingLoadCount,a=[],o=0,s=!0,u=!1,e.prev=8,l=ee()(n);case 10:return e.next=12,l.next();case 12:return h=e.sent,s=h.done,e.next=16,h.value;case 16:if(f=e.sent,s){e.next=26;break}d=f,a=this._postProcessValue(t,d,a),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:o,endRow:a.length}]}),o=a.length,this._setAsyncPropValue(t,a,r);case 23:s=!0,e.next=10;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(8),u=!0,c=e.t0;case 32:if(e.prev=32,e.prev=33,s||null==l.return){e.next=37;break}return e.next=37,l.return();case 37:if(e.prev=37,!u){e.next=40;break}throw c;case 40:return e.finish(37);case 41:return e.finish(32);case 42:(v=this.layer.props.onDataLoad)&&v(a,{propName:t,layer:this.layer});case 44:case"end":return e.stop()}},e,this,[[8,28,32,42],[33,,37,41]])}));return function(t,n){return e.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(e,t,n){var i=(this.component?this.component.props:{}).dataTransform;return"data"!==e?t:i?i(t,n):n?n.concat(t):t}},{key:"_createAsyncPropData",value:function(e,t,n){this.asyncProps[e]||(this.asyncProps[e]={lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0})}}]),e}(),ie=0,re=function(){function e(){o()(this,e),this.props=function(){for(var e=H(this.constructor),t=e.defaultProps,n=Object.create(t,{_component:{enumerable:!1,value:this},_asyncPropOriginalValues:{enumerable:!1,value:{}},_asyncPropResolvedValues:{enumerable:!1,value:{}}}),i=0;i2&&void 0!==arguments[2]?arguments[2]:{}).url,i=null;return i=(i=i||function(e,t){var n=t.match(Ce),i=n&&n[0];return i&&function(e,t){t=t.toLowerCase();var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object(Se.b)(s);var u=!0,c=!1,l=void 0;try{for(var h,f=s.extensions[Symbol.iterator]();!(u=(h=f.next()).done);u=!0){var d=h.value;if(d.toLowerCase()===t)return s}}catch(e){c=!0,l=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw l}}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(e,i)}(t,void 0===n?"":n))||function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if("string"==typeof t){if(Te(t,s))return s}else if(t instanceof ArrayBuffer&&Ae(t,s))return s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return null}(t,e)}function Te(e,t){return t.testText&&t.testText(e)}function Ae(e,t){switch(Array.isArray(t.test)?"array":Object(he.a)(t.test)){case"function":return t.test(e,t);case"string":case"array":return(Array.isArray(t.test)?t.test:[t.test]).some(function(t){return t===function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;if(e.byteLength<=t+n)return"";for(var i=new DataView(e),r="",a=0;a0&&void 0!==arguments[0])||arguments[0];this.internalState&&(this.internalState.needsRedraw=e)}},{key:"setNeedsUpdate",value:function(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}},{key:"hasUniformTransition",value:function(){return this.internalState.uniformTransitions.active}},{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:"getSingleModel",value:function(){return this.state&&this.state.model}},{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:"getFirstObject",value:function(){var e=this.props.data,t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){return r.value}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return null}},{key:"project",value:function(e){var t=this.context.viewport,n=Object(R.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),i=Object(oe.k)(n,t.pixelProjectionMatrix),a=r()(i,3),o=a[0],s=a[1],u=a[2];return 2===e.length?[o,s]:[o,s,u]}},{key:"unproject",value:function(e){var t=this.context.viewport;return Object(O.a)(Array.isArray(e)),t.unproject(e)}},{key:"projectPosition",value:function(e){return Object(O.a)(Array.isArray(e)),Object(R.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}},{key:"projectFlat",value:function(e){M.a.deprecated("layer.projectFlat","layer.projectPosition")();var t=this.context.viewport;return Object(O.a)(Array.isArray(e)),t.projectFlat(e)}},{key:"unprojectFlat",value:function(e){M.a.deprecated("layer.unprojectFlat")();var t=this.context.viewport;return Object(O.a)(Array.isArray(e)),t.unprojectFlat(e)}},{key:"use64bitPositions",value:function(){return this.props.coordinateSystem===p.a.LNGLAT||this.props.coordinateSystem===p.a.IDENTITY}},{key:"screenToDevicePixels",value:function(e){return M.a.deprecated("screenToDevicePixels","DeckGL prop useDevicePixels for conversion")(),e*("undefined"!=typeof window?window.devicePixelRatio:1)}},{key:"onHover",value:function(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}},{key:"onClick",value:function(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object(O.a)(e<16777215,"index out of picking color range"),t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}},{key:"decodePickingColor",value:function(e){Object(O.a)(e instanceof Uint8Array);var t=r()(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer ".concat(this," has not defined initializeState"))}},{key:"getShaders",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.props.extensions[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;e=I(e,o.getShaders.call(this,o))}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}return e}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.context;var t=e.changeFlags,n=this.getAttributeManager();if(t.dataChanged&&n){var i=t.dataChanged;if(Array.isArray(i)){var r=!0,a=!1,o=void 0;try{for(var s,u=i[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;n.invalidateAll(c)}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}}else n.invalidateAll()}}},{key:"finalizeState",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.getModels()[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.delete()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=this.getAttributeManager();a&&a.finalize(),this.internalState.uniformTransitions.clear()}},{key:"draw",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.draw(e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getAttributeManager();n&&("all"===e?(M.a.log(1,"updateTriggers invalidating all attributes: ".concat(t))(),n.invalidateAll()):(M.a.log(1,"updateTriggers invalidating attribute ".concat(e,": ").concat(t))(),n.invalidate(e)))}},{key:"updateAttributes",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,a=this.getModels()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;this._setModelAttributes(o,e)}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"_updateAttributes",value:function(e){var t=this.getAttributeManager();if(t){var n=this.getNumInstances(e),i=this.getBufferLayout(e);t.update({data:e.data,numInstances:n,bufferLayout:i,props:e,transitions:e.transitions,buffers:e,context:this,ignoreUnknownAttributes:!0});var r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}}},{key:"updateTransition",value:function(){var e=this.getAttributeManager();e&&e.updateTransition(this.context.timeline.getTime());var t=this.internalState.uniformTransitions;if(t.active){var n=t.update(),i=Object.create(this.props);for(var r in n)Object.defineProperty(i,r,{value:n[r]});return i}return this.props}},{key:"calculateInstancePickingColors",value:function(e,t){var n=t.numInstances,i=e.value,r=e.size;if(1!==i[0]){var a=Qe.length/r;if(a2?c[h*s+2]:0;a[3*u]=f,a[3*u+1]=d,a[3*u+2]=v,o[u]=1,u++}if(l)for(var p=0;p2&&void 0!==arguments[2]?arguments[2]:{},i=f[t];if(Object(s.a)(i,t),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="undefined"!=typeof window&&window.navigator||{},n=e.userAgent||t.userAgent||"",i=-1!==n.indexOf("MSIE "),r=-1!==n.indexOf("Trident/");return i||r}(n))return!0;if(t in v)return v[t];var r=i[0],a=n.behavior||"enable",o="#extension GL_".concat(r," : ").concat(a,"\nvoid main(void) {}"),u=e.createShader(35633);e.shaderSource(u,o),e.compileShader(u);var c=e.getShaderParameter(u,35713);return e.deleteShader(u),v[t]=c,c}function g(e,t){var n=f[t];Object(s.a)(n,t);var i=function(e){return Boolean(e&&2===e._version)}(e)&&n[1]||n[0],r="string"==typeof i?Boolean(e.getExtension(i)):i;return Object(s.a)(!1===r||!0===r),r}function m(e,t){return(t=Array.isArray(t)?t:[t]).every(function(t){return g(e,t)})}function y(e){switch(function(e){var t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t&&t.UNMASKED_VENDOR_WEBGL||u),i=e.getParameter(t&&t.UNMASKED_RENDERER_WEBGL||c);return{gpuVendor:function(e,t){return e.match(/NVIDIA/i)||t.match(/NVIDIA/i)?"NVIDIA":e.match(/INTEL/i)||t.match(/INTEL/i)?"INTEL":e.match(/AMD/i)||t.match(/AMD/i)||e.match(/ATI/i)||t.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(n,i),vendor:n,renderer:i,version:e.getParameter(l),shadingLanguageVersion:e.getParameter(h)}}(e).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var b,_,x,w=n(149);n.d(t,"c",function(){return C}),n.d(t,"b",function(){return E}),n.d(t,"a",function(){return T});var O="\n\n".concat(w.a,"\n\n"),P=(b={},Object(r.a)(b,a.b,"vertex"),Object(r.a)(b,a.a,"fragment"),b),S=(_={},Object(r.a)(_,a.b,{}),Object(r.a)(_,a.a,{}),_),j=(x={},Object(r.a)(x,a.b,{}),Object(r.a)(x,a.a,{}),x),k="precision highp float;\n\n";function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e=e.trim()).split(":"),r=Object(i.a)(n,2),a=r[0],o=r[1],s=e.replace(/\(.+/,"");S[a][s]=Object.assign(t,{signature:o})}function E(e,t){var n=t.hook,i=t.injection,r=t.order,a=void 0===r?0:r,o=n.slice(0,2),u=j[o];u[e]=u[e]||{},Object(s.a)(!u[e][n],"Module injection already created"),u[e][n]={injection:i,order:a}}function T(e,t){var n=t.vs,i=t.fs,r=Object(o.d)(t.modules||[]);return{gl:e,vs:A(e,Object.assign({},t,{source:n,type:a.b,modules:r})),fs:A(e,Object.assign({},t,{source:i,type:a.a,modules:r})),getUniforms:M(r),modules:L(r)}}function A(e,t){var n=t.id,i=t.source,r=t.type,o=t.modules,u=t.defines,c=void 0===u?{}:u,l=t.hookFunctions,h=void 0===l?S:l,f=t.moduleInjections,v=void 0===f?j:f,g=t.inject,b=void 0===g?{}:g,_=t.prologue,x=void 0===_||_,C=t.log;Object(s.a)("string"==typeof i,"shader source must be a string");var E=r===a.b,T=i.split("\n"),A=100,M="",L=i;0===T[0].indexOf("#version ")&&(A=300,M=T[0],L=T.slice(1).join("\n"));var I={};o.forEach(function(e){Object.assign(I,e.getDefines())}),Object.assign(I,c);var R=x?"".concat(M,"\n").concat(function(e){var t=e.id,n=e.source,i=e.type;return t&&"string"==typeof t&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(t,"_").concat(P[i],"\n\n"):""}({id:n,source:i,type:r}),"\n").concat(function(e){var t=e.type;return"\n#define SHADER_TYPE_".concat(P[t].toUpperCase(),"\n")}({type:r}),"\n").concat(y(e),"\n").concat(function(e,t,n){var i="#if (__VERSION__ > 120)\n\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return m(e,d.GLSL_FRAG_DEPTH)&&(i+="// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),m(e,d.GLSL_DERIVATIVES)&&p(e,d.GLSL_DERIVATIVES)&&(i+="// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define DERIVATIVES\n#endif\n"),m(e,d.GLSL_FRAG_DATA)&&p(e,d.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define DRAW_BUFFERS\n#endif\n"),m(e,d.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n# define TEXTURE_LOD\n#define texture2DLod texture2DLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define texture2DProjLod texture2DProjLodEXT\n#define textureCubeLod textureCubeLodEXT\n#define texture2DGrad texture2DGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define texture2DProjGrad texture2DProjGradEXT\n#define textureCubeGrad textureCubeGradEXT\n#endif\n"),i}(e),"\n").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=0,n="";for(var i in e){0===t&&(n+="\n// APPLICATION DEFINES\n"),t++;var r=e[i];(r||Number.isFinite(r))&&(n+="#define ".concat(i.toUpperCase()," ").concat(e[i],"\n"))}0===t&&(n+="\n");return n}(I),"\n").concat(E?"":k,"\n"):"".concat(M,"\n"),F=!1,D={},N={};for(var z in b){var B="string"==typeof b[z]?{injection:b[z],order:0}:b[z];z.match(/^(v|f)s:/)?"#"===z[3]?N[z]=[B]:D[z]=[B]:N[z]=[B]}var U=!0,V=!1,G=void 0;try{for(var W,H=o[Symbol.iterator]();!(U=(W=H.next()).done);U=!0){var X=W.value;switch(X.name){case"inject":F=!0;break;default:if(C&&X.checkDeprecations(L,C),R+=X.getModuleSource(r,A),v[r][X.name]){var q=v[r][X.name];for(var Z in q)Z.match(/^(v|f)s:#/)?(N[Z]=N[Z]||[],N[Z].push(q[Z])):(D[Z]=D[Z]||[],D[Z].push(q[Z]))}}}}catch(e){V=!0,G=e}finally{try{U||null==H.return||H.return()}finally{if(V)throw G}}return R+=O,R+=function(e,t){var n="";for(var i in e){var r=e[i];if(n+="void ".concat(r.signature," {\n"),r.header&&(n+=" ".concat(r.header)),t[i]){var a=t[i];a.sort(function(e,t){return e.order-t.order});var o=!0,s=!1,u=void 0;try{for(var c,l=a[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var h=c.value;n+=" ".concat(h.injection,"\n")}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}}r.footer&&(n+=" ".concat(r.footer)),n+="}\n"}return n}(h[r],D),R+=L,R=Object(w.c)(R,r,N,F)}function M(e){return function(t){var n={},i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value.getUniforms(t,n);Object.assign(n,u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}function L(e){var t={},n=!0,i=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value,c=Object(o.b)(u);t[u]=c}}catch(e){i=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw r}}return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(136),c=n(22),l=function(e,t){if(!e)throw new Error(t)},h=function(e){function t(){return Object(i.a)(this,t),Object(a.a)(this,Object(o.a)(t).apply(this,arguments))}return Object(s.a)(t,e),Object(r.a)(t,[{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"lengthSquared",value:function(){for(var e=0,t=0;t=0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0?", ":"")+Object(u.f)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n0&&void 0!==arguments[0]?arguments[0]:this,t=e&&e.length===this.ELEMENTS,n=0;n0&&void 0!==arguments[0]?arguments[0]:this;if(u.c.debug&&!this.validate(e))throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}},{key:"sub",value:function(e){return this.subtract(e)}},{key:"setScalar",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.viewport,n=e.devicePixelRatio,i=void 0===n?1:n,r=e.modelMatrix,o=void 0===r?null:r,u=e.coordinateSystem,c=void 0===u?a.a.LNGLAT:u,l=e.coordinateOrigin,f=void 0===l?d:l,v=e.wrapLongitude,g=void 0!==v&&v;e.projectionMode,e.positionOrigin;return Object(s.a)(t),Object.assign({project_uModelMatrix:o||h},p({viewport:t,devicePixelRatio:i,coordinateSystem:c,coordinateOrigin:f,wrapLongitude:g}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(29),u=n(204),c=n(18),l={position:[0,0,0],lookAt:[0,0,0],up:[0,0,1],rotationX:0,rotationY:0,fov:50,near:1,far:100},h=function(){function e(t){r()(this,e);var n=t.width,i=t.height,a=t.position,o=void 0===a?l.position:a;Object(c.a)(Number.isFinite(n),"`width` must be supplied"),Object(c.a)(Number.isFinite(i),"`height` must be supplied"),this._viewportProps=this._applyConstraints(Object.assign({},t,{position:new s.a(o)}))}return o()(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getDirection",value:function(){return new u.a({bearing:this._viewportProps.bearing,pitch:this._viewportProps.pitch}).toVector3().normalize()}},{key:"getDirectionFromBearing",value:function(e){return new u.a({bearing:e,pitch:90}).toVector3().normalize()}},{key:"shortestPathFrom",value:function(e){return this._viewportProps}},{key:"_applyConstraints",value:function(e){return e}}]),e}()},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){return(r="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function i(e){for(var t=e.data,n=e.getIndex,i=e.dataRange,r=e.replace,a=i.startRow,o=void 0===a?0:a,s=i.endRow,u=void 0===s?1/0:s,c=t.length,l=c,h=c,f=0;ff&&d>=o&&(l=f),d>=u){h=f;break}}for(var v=l,p=h-l!==r.length,g=p&&t.slice(h),m=0;m=t.min)}},array:{validate:function(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function c(e){var t=l(e);return"object"===t?e?"type"in e?Object.assign({},e,u[e.type]):"value"in e?(t=l(e.value),Object.assign({type:t},e,u[t])):{type:"object",value:e}:{type:"object",value:null}:Object.assign({type:t,value:e},u[t])}function l(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":Object(s.a)(e)}n.d(t,"a",function(){return h}),n.d(t,"b",function(){return f});var h=function(){function e(t){var n=t.name,r=t.vs,a=t.fs,s=t.dependencies,u=void 0===s?[]:s,l=t.uniforms,h=t.getUniforms,f=t.deprecations,d=void 0===f?[]:f,v=t.defines,p=void 0===v?{}:v,g=t.vertexShader,m=t.fragmentShader;Object(i.a)(this,e),Object(o.a)("string"==typeof n),this.name=n,this.vs=r||g,this.fs=a||m,this.getModuleUniforms=h,this.dependencies=u,this.deprecations=this._parseDeprecationDefinitions(d),this.defines=p,l&&(this.uniforms=function(e){var t={};for(var n in e){var i=c(e[n]);t[n]=i}return t}(l))}return Object(r.a)(e,[{key:"getModuleSource",value:function(e,t){var n;switch(e){case"vs":n=a(this.vs||"",t,!0);break;case"fs":n=a(this.fs||"",t,!1);break;default:Object(o.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase(),"\n").concat(n,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,t){this.deprecations.forEach(function(n){n.regex.test(e)&&(n.deprecated?t.deprecated(n.old,n.new)():t.removed(n.old,n.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(e){switch(e.type){case"function":e.regex=new RegExp("\\b".concat(e.old,"\\("));break;default:e.regex=new RegExp("".concat(e.type," ").concat(e.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=this.uniforms;for(var i in n){var r=n[i];i in e&&!r.private?(r.validate&&Object(o.a)(r.validate(e[i],r),"".concat(this.name,": invalid ").concat(i)),t[i]=e[i]):t[i]=r.value}return t}}]),e}();function f(e){if(!e.normalized&&(e.normalized=!0,e.uniforms&&!e.getUniforms)){var t=new h(e);e.getUniforms=t.getUniforms.bind(t)}return e}},function(e,t,n){"use strict";n.d(t,"b",function(){return d}),n.d(t,"c",function(){return v}),n.d(t,"a",function(){return p});var i=n(233),r=n.n(i);function a(e){if(e=e&&e.positions||e,!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new Error("invalid polygon")}function o(e){return e.length>=1&&e[0].length>=2&&Number.isFinite(e[0][0])}function s(e){var t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function u(e,t,n,i){for(var r=0;r4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=(a=a||n.length)-r;if(o<=0)return t;for(var s=t,c=0;c2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return n>=(i=i||e.length)?0:(u(e,t,n,i)?0:1)+(i-n)/t}function d(e,t){if(a(e),e.positions){var n=e,i=n.positions,r=n.holeIndices;if(r){for(var s=0,u=0;u<=r.length;u++)s+=f(e.positions,t,r[u-1],r[u]);return s}e=i}if(Number.isFinite(e[0]))return f(e,t);if(!o(e)){var c=0,l=!0,d=!1,v=void 0;try{for(var p,g=e[Symbol.iterator]();!(l=(p=g.next()).done);l=!0){c+=h(p.value)}}catch(e){d=!0,v=e}finally{try{l||null==g.return||g.return()}finally{if(d)throw v}}return c}return h(e)}function v(e,t,n){a(e),n=n||d(e,t);var i=new Float64Array(n*t),r=[];if(e.positions){var s=e,u=s.positions,h=s.holeIndices;if(h){for(var f=0,v=0;v<=h.length;v++)f=l(i,f,u,t,h[v-1],h[v]),r.push(f);return r.pop(),{positions:i,holeIndices:r}}e=u}if(Number.isFinite(e[0]))return l(i,0,e,t),{positions:i,holeIndices:null};if(!o(e)){var p=0,g=!0,m=!1,y=void 0;try{for(var b,_=e[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){p=c(i,p,b.value,t),r.push(p)}}catch(e){m=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(m)throw y}}return r.pop(),{positions:i,holeIndices:r}}return c(i,0,e,t),{positions:i,holeIndices:null}}function p(e,t){var n=null;return e.holeIndices&&(n=e.holeIndices.map(function(e){return e/t})),r()(e.positions,n,t)}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i,r,a=n(0),o=n(97),s=function(e){return c(e)?void 0:0},u=(i={},Object(a.a)(i,3074,function(e){return c(e)?void 0:36064}),Object(a.a)(i,35723,function(e){return c(e)?void 0:4352}),Object(a.a)(i,35977,s),Object(a.a)(i,32937,s),Object(a.a)(i,36795,function(e,t){var n=c(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?t(n.GPU_DISJOINT_EXT):0}),Object(a.a)(i,37445,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_VENDOR_WEBGL||7936)}),Object(a.a)(i,37446,function(e,t){var n=e.getExtension("WEBGL_debug_renderer_info");return t(n&&n.UNMASKED_RENDERER_WEBGL||7937)}),Object(a.a)(i,34047,function(e,t){var n=e.luma.extensions.EXT_texture_filter_anisotropic;return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),Object(a.a)(i,32883,s),Object(a.a)(i,35071,s),Object(a.a)(i,37447,s),Object(a.a)(i,36063,function(e,t){if(!c(e)){var n=e.getExtension("WEBGL_draw_buffers");return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),Object(a.a)(i,35379,s),Object(a.a)(i,35374,s),Object(a.a)(i,35377,s),Object(a.a)(i,34852,function(e){if(!c(e)){var t=e.getExtension("WEBGL_draw_buffers");return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),Object(a.a)(i,36203,function(e){return e.getExtension("OES_element_index")?2147483647:65535}),Object(a.a)(i,33001,function(e){return e.getExtension("OES_element_index")?16777216:65535}),Object(a.a)(i,33e3,function(e){return 16777216}),Object(a.a)(i,37157,s),Object(a.a)(i,35373,s),Object(a.a)(i,35657,s),Object(a.a)(i,36183,s),Object(a.a)(i,37137,s),Object(a.a)(i,34045,s),Object(a.a)(i,35978,s),Object(a.a)(i,35979,s),Object(a.a)(i,35968,s),Object(a.a)(i,35376,s),Object(a.a)(i,35375,s),Object(a.a)(i,35659,s),Object(a.a)(i,37154,s),Object(a.a)(i,35371,s),Object(a.a)(i,35658,s),Object(a.a)(i,35076,s),Object(a.a)(i,35077,s),Object(a.a)(i,35380,s),i);function c(e){return Boolean(e&&2===e._version)}n.d(t,"b",function(){return h}),n.d(t,"a",function(){return f});function l(e){return Boolean(e&&2===e._version)}var h=(r={},Object(a.a)(r,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){Object(o.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),Object(a.a)(r,"ANGLE_instanced_arrays",{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(e,t){Object(o.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),Object(a.a)(r,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){Object(o.a)(!1)}}),Object(a.a)(r,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){Object(o.a)(!1)},deleteQuery:function(){Object(o.a)(!1)},beginQuery:function(){Object(o.a)(!1)},endQuery:function(){},getQuery:function(e,t){return this.getQueryObject(e,t)},getQueryParameter:function(e,t){return this.getQueryObject(e,t)},getQueryObject:function(){}}),r),f={readBuffer:function(e,t,n){l(e)&&t(n)},getVertexAttrib:function(e,t,n,i){var r,a=function(e,t){return{webgl2:l(e),ext:e.getExtension(t)}}(e,"ANGLE_instanced_arrays"),o=a.webgl2,s=a.ext;switch(i){case 35069:r=!!o&&void 0;break;case 35070:r=o||s?void 0:0}return void 0!==r?r:t(n,i)},getProgramParameter:function(e,t,n,i){if(!l(e))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,i)},getInternalformatParameter:function(e,t,n,i,r){if(!l(e))switch(r){case 32937:return new Int32Array([0])}return e.getInternalformatParameter(n,i,r)},getTexParameter:function(e,t,n,i){switch(i){case 34046:var r=e.luma.extensions.EXT_texture_filter_anisotropic;i=r&&r.TEXTURE_MAX_ANISOTROPY_EXT||34046}return t(n,i)},getParameter:function(e,t,n){var i=u[n],r="function"==typeof i?i(e,t,n):i;return void 0!==r?r:t(n)},hint:function(e,t,n,i){return t(n,i)}}},function(e,t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";n.d(t,"a",function(){return p}),n.d(t,"b",function(){return g}),n.d(t,"c",function(){return m});var i=n(5),r=n(10),a=n(9),o=n(11),s=n(4),u=n(29),c=n(70),l=[255,255,255],h=[0,0,1],f=[0,0,-1],d=[0,0,1],v=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e),this.id=t.id||Object(c.c)("light");var n=t.color,i=void 0===n?l:n;this.color=i;var r=t.intensity,a=void 0===r?1:r;this.intensity=a},p=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="ambient",e}return Object(o.a)(t,e),t}(v),g=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="directional";var i=n.direction,o=void 0===i?f:i;return e.direction=new u.a(o).normalize().toArray(),e}return Object(o.a)(t,e),t}(v),m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,t),(e=Object(r.a)(this,Object(a.a)(t).call(this,n))).type="point";var i=n.position,o=void 0===i?d:i;return e.position=o,e.attenuation=e._getAttenuation(n),e}return Object(o.a)(t,e),Object(i.a)(t,[{key:"_getAttenuation",value:function(e){return"attenuation"in e?e.attenuation:"intensity"in e?[0,0,e.intensity]:h}}]),t}(v)},function(e,t,n){"use strict";var i,r=n(0),a=n(62),o=n(121);n.d(t,"a",function(){return u}),n.d(t,"c",function(){return f}),n.d(t,"b",function(){return d});var s=(i={},Object(r.a)(i,a.b,"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n"),Object(r.a)(i,a.a,"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"),i),u="__LUMA_INJECT_DECLARATIONS__",c=/void main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,h=[];function f(e,t,n,i){var r=t===a.b,o=function(t){var i=n[t];i.sort(function(e,t){return e.order-t.order}),h.length=i.length;for(var a=0,o=i.length;a1),e.forEach(function(e){for(var n in e)t[n]=t[n]?"".concat(t[n],"\n").concat(e[n]):e[n]}),t}},function(e,t,n){"use strict";var i=n(69),r=n(23),a=n(26);function o(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var s={framebuffer:function(e,t){var n=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,n)},blend:function(e,t){return t?e.enable(3042):e.disable(3042)},blendColor:function(e,t){return e.blendColor.apply(e,Object(a.a)(t))},blendEquation:function(e,t){t=o(t)?t:[t,t],e.blendEquationSeparate.apply(e,Object(a.a)(t))},blendFunc:function(e,t){t=o(t)&&2===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,e.blendFuncSeparate.apply(e,Object(a.a)(t))},clearColor:function(e,t){return e.clearColor.apply(e,Object(a.a)(t))},clearDepth:function(e,t){return e.clearDepth(t)},clearStencil:function(e,t){return e.clearStencil(t)},colorMask:function(e,t){return e.colorMask.apply(e,Object(a.a)(t))},cull:function(e,t){return t?e.enable(2884):e.disable(2884)},cullFace:function(e,t){return e.cullFace(t)},depthTest:function(e,t){return t?e.enable(2929):e.disable(2929)},depthFunc:function(e,t){return e.depthFunc(t)},depthMask:function(e,t){return e.depthMask(t)},depthRange:function(e,t){return e.depthRange.apply(e,Object(a.a)(t))},dither:function(e,t){return t?e.enable(3024):e.disable(3024)},derivativeHint:function(e,t){e.hint(35723,t)},frontFace:function(e,t){return e.frontFace(t)},mipmapHint:function(e,t){return e.hint(33170,t)},lineWidth:function(e,t){return e.lineWidth(t)},polygonOffsetFill:function(e,t){return t?e.enable(32823):e.disable(32823)},polygonOffset:function(e,t){return e.polygonOffset.apply(e,Object(a.a)(t))},sampleCoverage:function(e,t){return e.sampleCoverage.apply(e,Object(a.a)(t))},scissorTest:function(e,t){return t?e.enable(3089):e.disable(3089)},scissor:function(e,t){return e.scissor.apply(e,Object(a.a)(t))},stencilTest:function(e,t){return t?e.enable(2960):e.disable(2960)},stencilMask:function(e,t){var n=t=o(t)?t:[t,t],i=Object(r.a)(n,2),a=i[0],s=i[1];e.stencilMaskSeparate(1028,a),e.stencilMaskSeparate(1029,s)},stencilFunc:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],h=i[4],f=i[5];e.stencilFuncSeparate(1028,s,u,c),e.stencilFuncSeparate(1029,l,h,f)},stencilOp:function(e,t){var n=t=o(t)&&3===t.length?[].concat(Object(a.a)(t),Object(a.a)(t)):t,i=Object(r.a)(n,6),s=i[0],u=i[1],c=i[2],l=i[3],h=i[4],f=i[5];e.stencilOpSeparate(1028,s,u,c),e.stencilOpSeparate(1029,l,h,f)},viewport:function(e,t){return e.viewport.apply(e,Object(a.a)(t))}};function u(e,t){for(var n in Object(i.f)(e,t),t){var r=s[n];r&&r(e,t[n],n)}}n.d(t,"a",function(){return u})},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(104),v=n(73),p=n(102),g=n(113),m=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),n=u()(this,l()(t).call(this,e,i));var a=i.module,o=i.fs,s=i.id,c=i.moduleProps;return n.model=n._getModel(e,a,o,s,c),n}return f()(t,e),o()(t,[{key:"render",value:function(e){var t=this,n=this.gl;Object(v.a)(n,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},function(){return t._renderPass(n,e)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_getModel",value:function(e,t,n,i,r){var a=new p.a(e,{id:i,fs:n,modules:[t]}),o=Object.assign(t.getUniforms(),t.getUniforms(r));return a.setUniforms(o),a}},{key:"_renderPass",value:function(e,t){var n=t.inputBuffer;t.outputBuffer;Object(g.a)(e,{color:!0}),this.model.draw({uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),t}(n(179).a),y=n(142);n.d(t,"a",function(){return b});var b=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r()(this,t),(n=u()(this,l()(t).call(this,i))).id="".concat(e.name,"-pass"),Object(y.b)(e),n.module=e,n}return f()(t,e),o()(t,[{key:"prepare",value:function(e){this.passes||(this.passes=function(e,t,n,i){if(t.filter||t.sampler){var r=w(t),a=new m(e,{id:n,module:t,fs:r,moduleProps:i});return[a]}return(t.passes||[]).map(function(r,a){var o=w(t,r),s="".concat(n,"-").concat(a);return new m(e,{id:s,module:t,fs:o,moduleProps:i})})}(e,this.module,this.id,this.props))}},{key:"render",value:function(e){for(var t=e.target,n=void 0===t?null:t,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:e;if(t.filter){var n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor");return _(n)}if(t.sampler){var i="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor");return x(i)}return null}},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(128),v=n(110),p=n(148),g=n(114),m=n(104),y=n(68),b=n(29),_=n(8),x=n.n(_),w=n(13),O=n.n(w),P=n(103),S=n(94),j=n(63),k=n(73),C=function(e){function t(e,n){var i,a,o;return r()(this,t),(o=u()(this,l()(t).call(this,e,n))).shadowMap=new d.a(e,{width:1,height:1,parameters:(i={},x()(i,10241,9729),x()(i,10240,9729),x()(i,10242,33071),x()(i,10243,33071),i)}),o.depthBuffer=new S.a(e,{format:33189,width:1,height:1}),o.fbo=new j.a(e,{id:"shadowmap",width:1,height:1,attachments:(a={},x()(a,36064,o.shadowMap),x()(a,36096,o.depthBuffer),a)}),o}return f()(t,e),o()(t,[{key:"render",value:function(e){var n=this,i=this.fbo;Object(k.a)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var r=e.viewports[0],a=r.width*n.props.pixelRatio,o=r.height*n.props.pixelRatio;a===i.width&&o===i.height||i.resize({width:a,height:o}),O()(l()(t.prototype),"render",n).call(n,Object.assign(e,{outputBuffer:i}))})}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:0,drawToShadowMap:!0,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{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)}}]),t}(P.a),E=n(164);n.d(t,"a",function(){return L});var T={color:[255,255,255],intensity:1},A=[{color:[255,255,255],intensity:1,direction:[-1,-3,-1]},{color:[255,255,255],intensity:.9,direction:[1,8,-2.5]}],M=[0,0,0,200/255],L=function(e){function t(e){var n;for(var i in r()(this,t),(n=u()(this,l()(t).call(this,e))).ambientLight=null,n.directionalLights=[],n.pointLights=[],n.shadowColor=M,n.shadowPasses=[],n.dummyShadowMap=null,n.shadow=!1,e){var a=e[i];switch(a.type){case"ambient":n.ambientLight=a;break;case"directional":n.directionalLights.push(a);break;case"point":n.pointLights.push(a)}}return n._applyDefaultLights(),n.directionalLights.some(function(e){return e.shadow})&&(n.shadow=!0,n._addShadowModule()),n}return f()(t,e),o()(t,[{key:"prepare",value:function(e,t){var n=t.layers,i=t.viewports,r=t.onViewportActive,a=t.views,o=t.pixelRatio;if(!this.shadow)return{};var s=this._createLightMatrix();0===this.shadowPasses.length&&this._createShadowPasses(e,o),this.dummyShadowMap||(this.dummyShadowMap=new d.a(e,{width:1,height:1}));for(var u=[],c=0;c2&&void 0!==arguments[2]&&arguments[2],i=r()(e,3),a=i[0],o=i[1],s=i[2],u=void 0===s?0:s,l=t.projectFlat(e),h=r()(l,2);return[h[0],h[1],u*(n?Object(c.b)({longitude:a,latitude:o,scale:t.scale}):t.getDistanceScales()).pixelsPerMeter[2]]}function h(e,t){var n=t.viewport,i=t.modelMatrix,o=t.coordinateSystem,u=t.coordinateOrigin,h=t.offsetMode,f=r()(e,3),d=f[0],v=f[1],p=f[2];if(i){var g=s.n([],[d,v,p,1],i),m=r()(g,3);d=m[0],v=m[1],p=m[2]}switch(o){case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:return l([d,v,p],n,h);case a.a.LNGLAT_OFFSETS:return l([d+u[0],v+u[1],p+(u[2]||0)],n,h);case a.a.METER_OFFSETS:return l(Object(c.a)(u,[d,v,p]),n,h);case a.a.IDENTITY:default:return n.projectPosition([d,v,p])}}function f(e,t){var n=function(e){var t=Object.assign({},e),n=e.viewport,i=e.coordinateSystem,r=e.coordinateOrigin,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin;return void 0===s&&(t.fromCoordinateSystem=i),void 0===u&&(t.fromCoordinateOrigin=r),i===a.a.LNGLAT&&n.zoom>=o.a&&(t.coordinateSystem=a.a.LNGLAT_OFFSETS,t.coordinateOrigin=[Math.fround(n.longitude),Math.fround(n.latitude)]),t}(t),i=n.viewport,r=n.coordinateSystem,s=n.coordinateOrigin,c=n.modelMatrix,f=n.fromCoordinateSystem,d=n.fromCoordinateOrigin;switch(r){case a.a.LNGLAT_OFFSETS:case a.a.METER_OFFSETS:var v=h(e,{viewport:i,modelMatrix:c,coordinateSystem:f,coordinateOrigin:d,offsetMode:!0}),p=l(s,i,!0);return u.m(v,v,p),v;case a.a.LNGLAT:case a.a.LNGLAT_DEPRECATED:case a.a.IDENTITY:default:return h(e,{viewport:i,modelMatrix:c,coordinateSystem:f,coordinateOrigin:d,offsetMode:!1})}}},function(e,t){function n(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}e.exports=function(e){return function(){var t=this,i=arguments;return new Promise(function(r,a){var o=e.apply(t,i);function s(e){n(o,r,a,s,u,"next",e)}function u(e){n(o,r,a,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(9),s=n(11),u=n(33),c=n(23),l=n(56),h=n(27),f=n(21),d=Object(l.a)(),v=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width,r=t.height,a=t.viewMatrix,o=void 0===a?d:a,s=t.projectionMatrix,u=void 0===s?d:s;Object(i.a)(this,e),this.width=n||1,this.height=r||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=u;var c=Object(l.a)();f.g(c,c,this.projectionMatrix),f.g(c,c,this.viewMatrix),this.viewProjectionMatrix=c;var h=Object(l.a)();f.n(h,h,[this.width/2,-this.height/2,1]),f.o(h,h,[1,-1,0]),f.g(h,h,this.viewProjectionMatrix);var v=f.e(Object(l.a)(),h);if(!v)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=h,this.pixelUnprojectionMatrix=v,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 Object(r.a)(e,[{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&f.b(t.projectionMatrix,this.projectionMatrix)&&f.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===t||t,i=this.projectPosition(e),r=Object(h.k)(i,this.pixelProjectionMatrix),a=Object(c.a)(r,2),o=a[0],s=a[1],u=n?s:this.height-s;return 2===e.length?[o,u]:[o,u,r[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,i=void 0===n||n,r=t.targetZ,a=Object(c.a)(e,3),o=a[0],s=a[1],u=a[2],l=i?s:this.height-s,f=r&&r*this.pixelsPerMeter,d=Object(h.h)([o,l,u],this.pixelUnprojectionMatrix,f),v=this.unprojectPosition(d),p=Object(c.a)(v,3),g=p[0],m=p[1],y=p[2];return Number.isFinite(u)?[g,m,y]:Number.isFinite(r)?[g,m,r]:[g,m]}},{key:"projectPosition",value:function(e){var t=this.projectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)*this.pixelsPerMeter]}},{key:"unprojectPosition",value:function(e){var t=this.unprojectFlat(e),n=Object(c.a)(t,2);return[n[0],n[1],(e[2]||0)/this.pixelsPerMeter]}},{key:"projectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}},{key:"unprojectFlat",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return e}}]),e}(),p=n(203),g=n(48);n.d(t,"a",function(){return m});var m=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.width,s=n.height,c=n.latitude,l=void 0===c?0:c,f=n.longitude,d=void 0===f?0:f,v=n.zoom,p=void 0===v?0:v,g=n.pitch,m=void 0===g?0:g,y=n.bearing,b=void 0===y?0:y,_=n.altitude,x=void 0===_?1.5:_,w=n.nearZMultiplier,O=n.farZMultiplier;Object(i.a)(this,t),r=r||1,s=s||1;var P=Object(h.l)(p);x=Math.max(.75,x);var S=Object(h.g)([d,l],P);S[2]=0;var j=Object(h.d)({width:r,height:s,pitch:m,bearing:b,altitude:x,nearZMultiplier:w||1/s,farZMultiplier:O||1.01}),k=Object(h.f)({height:s,center:S,pitch:m,bearing:b,altitude:x,flipY:!0});return(e=Object(a.a)(this,Object(o.a)(t).call(this,{width:r,height:s,viewMatrix:k,projectionMatrix:j}))).latitude=l,e.longitude=d,e.zoom=p,e.pitch=m,e.bearing=b,e.altitude=x,e.scale=P,e.center=S,e.pixelsPerMeter=Object(h.b)(Object(u.a)(Object(u.a)(e))).pixelsPerMeter[2],Object.freeze(Object(u.a)(Object(u.a)(e))),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"projectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(h.g)(e,t)}},{key:"unprojectFlat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.scale;return Object(h.j)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(h.h)(n,this.pixelUnprojectionMatrix),r=Object(h.g)(t,this.scale),a=g.a([],r,g.e([],i)),o=g.a([],this.center,a);return Object(h.j)(o,this.scale)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(p.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(v)},,,function(e,t,n){"use strict";(function(e){var t=n(97),i=n(145);function r(e,n){var r=n.extension,a=n.target,o=n.target2,s=i.b[r];Object(t.a)(s);for(var u=s.meta,c=(void 0===u?{}:u).suffix,l=void 0===c?"":c,h=e.getExtension(r),f=function(){var t=v[d],n="".concat(t).concat(l),i=null;"meta"===t||"function"==typeof e[t]||(h&&"function"==typeof h[n]?i=function(){return h[n].apply(h,arguments)}:"function"==typeof s[t]&&(i=s[t].bind(a))),i&&(a[t]=i,o[t]=i)},d=0,v=Object.keys(s);d0&&void 0!==arguments[0]&&arguments[0];var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.project_uViewProjectionMatrix,n=e.project_uScale;if(t&&n)return u({project_uViewProjectionMatrix:t,project_uScale:n});return{}},deprecations:[{type:"function",old:"project_to_clipspace_fp64",new:"project_common_position_to_clipspace_fp64"}]},Object(a.a)(function(e){var t=e.project_uViewProjectionMatrix,n=e.project_uScale,i=s(t),r=o(n);return{project_uViewProjectionMatrixFP64:i,project64_uViewProjectionMatrix:i,project64_uScale:r}}))},function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return l});var i=n(0),r=n(128),a=n(161),o=n(162),s=n(63),u=n(19);function c(e,t){Object(u.a)(e instanceof r.a||e instanceof a.a||e instanceof o.a);var n=e.constructor,i=e.gl,s=e.width,c=e.height,l=e.format,h=e.type,f=e.dataFormat,d=e.border,v=e.mipmaps;return new n(i,Object.assign({width:s,height:c,format:l,type:h,dataFormat:f,border:d,mipmaps:v},t))}function l(e,t){var n=e.gl,r=e.width,a=e.height,o=e.id;return new s.a(n,Object.assign({},t,{id:"framebuffer-for-".concat(o),width:r,height:a,attachments:Object(i.a)({},36064,e)}))}},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(51),r=n.n(i),a=n(117),o=n(4),s=n(5),u=n(10),c=n(9),l=n(33),h=n(11),f=n(57),d=n(30),v=n(25),p=[34069,34070,34071,34072,34073,34074],g=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,t),Object(d.b)(e),(n=Object(u.a)(this,Object(c.a)(t).call(this,e,Object.assign({},i,{target:34067})))).initialize(i),Object.seal(Object(l.a)(n)),n}return Object(h.a)(t,e),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.mipmaps,i=void 0===n||n,r=t.parameters,a=void 0===r?{}:r;this.opts=t,this.setCubeMapImageData(t).then(function(){e.loaded=!0,i&&e.generateMipmap(t),e.setParameters(a)})}},{key:"subImage",value:function(e){var t=e.face,n=e.data,i=e.x,r=void 0===i?0:i,a=e.y,o=void 0===a?0:a,s=e.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:t,data:n,x:r,y:o,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var e=Object(a.a)(r.a.mark(function e(t){var n,i,a,o,s,u,c,l,h,f,d,g,m,y=this;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.width,i=t.height,a=t.pixels,o=t.data,s=t.border,u=void 0===s?0:s,c=t.format,l=void 0===c?6408:c,h=t.type,f=void 0===h?5121:h,d=this.gl,g=a||o,e.next=5,Promise.all(p.map(function(e){var t=g[e];return Promise.all(Array.isArray(t)?t:[t])}));case 5:m=e.sent,this.bind(),p.forEach(function(e,t){m[t].length>1&&!1!==y.opts.mipmaps&&v.a.warn("".concat(y.id," has mipmap and multiple LODs."))(),m[t].forEach(function(t,r){n&&i?d.texImage2D(e,r,l,n,i,u,l,f,t):d.texImage2D(e,r,l,l,f,t)})}),this.unbind();case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(e){var t=this,n=e.face,i=e.width,r=e.height,a=e.pixels,o=e.data,s=e.border,u=void 0===s?0:s,c=e.format,l=void 0===c?6408:c,h=e.type,f=void 0===h?5121:h,d=this.gl,v=a||o;return this.bind(),v instanceof Promise?v.then(function(i){return t.setImageDataForFace(Object.assign({},e,{face:n,data:i,pixels:i}))}):this.width||this.height?d.texImage2D(n,0,l,i,r,u,l,f,v):d.texImage2D(n,0,l,l,f,v),this}}]),t}(f.a);g.FACES=p},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(33),s=n(5),u=n(11),c=n(73),l=n(30),h=n(57),f=n(98),d=n(43),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(l.a)(e),s=Object.assign({depth:1},s,{target:32879,unpackFlipY:!1}),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(s.a)(t,[{key:"setImageData",value:function(e){var t=this,n=e.level,i=void 0===n?0:n,r=e.dataFormat,a=void 0===r?6408:r,o=e.width,s=e.height,u=e.depth,l=void 0===u?1:u,h=e.border,v=void 0===h?0:h,p=e.format,g=e.type,m=void 0===g?5121:g,y=e.offset,b=void 0===y?0:y,_=e.data,x=e.parameters,w=void 0===x?{}:x;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(c.a)(this.gl,w,function(){ArrayBuffer.isView(_)&&t.gl.texImage3D(t.target,i,a,o,s,l,v,p,m,_),_ instanceof d.a&&(t.gl.bindBuffer(35052,_.handle),t.gl.texImage3D(t.target,i,a,o,s,l,v,p,m,b))}),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var O=f.a[this.dataFormat]||4,P=f.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*O*P,"Texture")}return this.loaded=!0,this}}]),t}(h.a)},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=e.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";var i=n(99),r=n.n(i),a=n(16),o=n.n(a),s=n(134),u=n(42),c=n(68),l=n(29),h=n(93),f=n(27),d=Object(h.a)(function(e){var t=e.viewport,n=e.center;return new c.a(t.viewProjectionMatrix).invert().transformVector4(n)}),v=Object(h.a)(function(e){var t=e.viewport,n=e.shadowMatrices,i=[],a=t.pixelUnprojectionMatrix,s=t.isGeospatial?void 0:1,u=[[0,0,s],[t.width,0,s],[0,t.height,s],[t.width,t.height,s],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(function(e){return function(e,t){var n=o()(e,3),i=n[0],r=n[1],a=n[2],s=Object(f.h)([i,r,a],t);if(Number.isFinite(a))return s;return[s[0],s[1],0]}(e,a)}),h=!0,d=!1,v=void 0;try{for(var p,g=function(){var e=p.value,n=e.clone().translate(new l.a(t.center).negate()),a=u.map(function(e){return n.transformVector3(e)}),o=(new c.a).ortho({left:Math.min.apply(Math,r()(a.map(function(e){return e[0]}))),right:Math.max.apply(Math,r()(a.map(function(e){return e[0]}))),bottom:Math.min.apply(Math,r()(a.map(function(e){return e[1]}))),top:Math.max.apply(Math,r()(a.map(function(e){return e[1]}))),near:Math.min.apply(Math,r()(a.map(function(e){return-e[2]}))),far:Math.max.apply(Math,r()(a.map(function(e){return-e[2]})))});i.push(o.multiplyRight(e))},m=n[Symbol.iterator]();!(h=(p=m.next()).done);h=!0)g()}catch(e){d=!0,v=e}finally{try{h||null==m.return||m.return()}finally{if(d)throw v}}return i});Object(s.b)("shadow",{hook:"vs:DECKGL_FILTER_GL_POSITION",injection:"\nposition = shadow_setVertexPosition(geometry.position);\n "}),Object(s.b)("shadow",{hook:"fs:DECKGL_FILTER_COLOR",injection:"\ncolor = shadow_filterShadowColor(color);\n "});var p=[0,0,0,1],g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];t.a={name:"shadow",dependencies:["project"],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){var n={},i=e.shadowEnabled;return(void 0===i||i)&&e.shadowMatrices&&e.shadowMatrices.length>0?Object.assign(n,function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||p,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},i=d({viewport:e.viewport,center:t.project_uCenter}),r=[],a=v({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice(),o=0;o0?n["shadow_uShadowMap".concat(h)]=e.shadowMaps[h]:n["shadow_uShadowMap".concat(h)]=e.dummyShadowMap;return n}(e,t)):Object.assign(n,{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}),n}return{}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(54),v=n(166),p=n(173),g=function(e){function t(e){return r()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:v.a})))}return f()(t,e),o()(t,[{key:"controller",get:function(){return this._getControllerProps({type:p.a})}}]),t}(d.a);g.displayName="MapView"},function(e,t,n){"use strict";n.d(t,"a",function(){return O});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),h=n(3),f=n.n(h),d=n(7),v=n.n(d),p=n(65),g=n.n(p),m=n(44),y=n(27),b=n(203),_=n(48),x=n(18),w="Illegal argument to WebMercatorViewport",O=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,t);var i=n.latitude,r=void 0===i?0:i,a=n.longitude,s=void 0===a?0:a,u=n.zoom,c=void 0===u?11:u,h=n.pitch,d=void 0===h?0:h,v=n.bearing,p=void 0===v?0:v,m=n.nearZMultiplier,b=void 0===m?.1:m,_=n.farZMultiplier,x=void 0===_?10:_,w=n.orthographic,O=void 0!==w&&w,P=n.width,S=n.height,j=n.altitude,k=void 0===j?1.5:j;P=P||1,S=S||1,k=Math.max(.75,k);var C=Object(y.e)({width:P,height:S,pitch:d,altitude:k,nearZMultiplier:b,farZMultiplier:x}),E=C.fov,T=C.aspect,A=C.focalDistance,M=C.near,L=C.far,I=Object(y.f)({height:S,pitch:d,bearing:p,altitude:k}),R=Object.assign({},n,{width:P,height:S,viewMatrix:I,longitude:s,latitude:r,zoom:c,orthographic:O,fovyRadians:E,aspect:T,orthographicFocalDistance:A,near:M,far:L});return(e=l()(this,f()(t).call(this,R))).latitude=r,e.longitude=s,e.zoom=c,e.pitch=d,e.bearing=p,e.altitude=k,e.orthographic=O,e.metersToLngLatDelta=e.metersToLngLatDelta.bind(g()(g()(e))),e.lngLatDeltaToMeters=e.lngLatDeltaToMeters.bind(g()(g()(e))),e.addMetersToLngLat=e.addMetersToLngLat.bind(g()(g()(e))),Object.freeze(g()(g()(e))),e}return v()(t,e),u()(t,[{key:"metersToLngLatDelta",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerMeter,c=s.degreesPerPixel,l=n*u[0]*c[0],h=i*u[1]*c[1];return 2===e.length?[l,h]:[l,h,o]}},{key:"lngLatDeltaToMeters",value:function(e){var t=r()(e,3),n=t[0],i=t[1],a=t[2],o=void 0===a?0:a;Object(x.a)(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o),w);var s=this.distanceScales,u=s.pixelsPerDegree,c=s.metersPerPixel,l=n*u[0]*c[0],h=i*u[1]*c[1];return 2===e.length?[l,h]:[l,h,o]}},{key:"addMetersToLngLat",value:function(e,t){return Object(y.a)(e,t)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=e.pos,i=Object(y.h)(n,this.pixelUnprojectionMatrix),r=this.projectFlat(t),a=_.a([],r,_.e([],i)),o=_.a([],this.center,a);return this.unprojectFlat(o)}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.width,r=this.height,a=Object(b.a)(Object.assign({width:i,height:r,bounds:e},n));return new t({width:i,height:r,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),t}(m.a);O.displayName="WebMercatorViewport"},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(18),u=n(193),c=n(271),l=n(41),h=n.n(l),f=n(132),d=n(100),v=n(15),p=n(77),g=n(272),m=n(44),y=n(72),b=Object.seal({layerManager:null,deck:null,gl:null,useDevicePixels:!0,stats:null,shaderCache:null,pickingFBO:null,animationProps:null,mousePosition:null,userData:{}}),_=function(e){return e instanceof f.a?"".concat(e):e?"invalid":"null"},x=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.deck,a=n.stats,o=n.viewport,s=void 0===o?null:o,l=n.timeline,h=void 0===l?null:l;r()(this,e),this.lastRenderedLayers=[],this.layers=[],this.context=Object.assign({},b,{layerManager:this,deck:i,gl:t,shaderCache:t&&new u.a({gl:t,_cachePrograms:!0}),stats:a||new g.a({id:"deck.gl"}),viewport:s||new m.a({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:h||new c.a}),this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),this._initSeer=this._initSeer.bind(this),this._editSeer=this._editSeer.bind(this),Object.seal(this),Object(y.e)(this._initSeer),Object(y.c)(this._editSeer)}return o()(e,[{key:"finalize",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.layers[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var a=i.value;this._finalizeLayer(a)}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}h.a.removeListener(this._initSeer),h.a.removeListener(this._editSeer)}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._checkIfNeedsRedraw(e)}},{key:"needsUpdate",value:function(){return 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&&void 0!==arguments[0]?arguments[0]:{}).layerIds,t=void 0===e?null:e;return t?this.layers.filter(function(e){return t.find(function(t){return 0===e.id.indexOf(t)})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"useDevicePixels"in e&&(this.context.useDevicePixels=e.useDevicePixels),"layers"in e&&this.setLayers(e.layers)}},{key:"setLayers",value:function(e){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&e===this.lastRenderedLayers)return v.a.log(3,"Ignoring layer update due to layer array not changed")(),this;this.lastRenderedLayers=e,e=Object(p.b)(e,{filter:Boolean});var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.context=this.context}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}var o=this._updateLayers({oldLayers:this.layers,newLayers:e}),s=o.error,u=o.generatedLayers;if(this.layers=u,s)throw s;return this}},{key:"updateLayers",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=this.needsUpdate();if(e){this.setNeedsRedraw("updating layers: ".concat(e));this.setLayers(this.lastRenderedLayers,!0)}}},{key:"_checkIfNeedsRedraw",value:function(e){var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value.getNeedsRedraw(e);t=t||s}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"activateViewport",value:function(e){var t=this.context.viewport;if(!t||!e.equals(t)){v.a.log(4,"Viewport changed",e)(),this.context.viewport=e;var n=!0,i=!1,r=void 0;try{for(var a,o=this.layers[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;u.setChangeFlags({viewportChanged:"Viewport changed"}),this._updateLayer(u)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}return Object(s.a)(this.context.viewport,"LayerManager: viewport not set"),this}},{key:"_updateLayers",value:function(e){var t=e.oldLayers,n=e.newLayers,i={},r=!0,a=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i[c.id]?v.a.warn("Multiple old layers with same id ".concat(_(c)))():i[c.id]=c}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}var l=[],h=this._updateSublayersRecursively({newLayers:n,oldLayerMap:i,generatedLayers:l}),f=this._finalizeOldLayers(i);return this._needsUpdate=l.some(function(e){return e.hasUniformTransition()}),{error:h||f,generatedLayers:l}}},{key:"_updateSublayersRecursively",value:function(e){var t=e.newLayers,n=e.oldLayerMap,i=e.generatedLayers,r=null,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;l.context=this.context;var h=n[l.id];null===h&&v.a.warn("Multiple new layers with same id ".concat(_(l)))(),n[l.id]=null;var f=null;try{if(this._debug&&h!==l&&l.validateProps(),h){this._transferLayerState(h,l);var d=this._updateLayer(l);r=r||d,Object(y.g)(l)}else{var p=this._initializeLayer(l);r=r||p,Object(y.b)(l)}i.push(l),f=l.isComposite&&l.getSubLayers()}catch(p){v.a.warn("error during matching of ".concat(_(l)),p)(),r=r||p}if(f){var g=this._updateSublayersRecursively({newLayers:f,oldLayerMap:n,generatedLayers:i});r=r||g}}}catch(p){o=!0,s=p}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"_finalizeOldLayers",value:function(e){var t=null;for(var n in e){var i=e[n];i&&(t=t||this._finalizeLayer(i))}return t}},{key:"_initializeLayer",value:function(e){v.a.log(2,"initializing ".concat(_(e)))();var t=null;try{e._initialize(),e.lifecycle=d.a.INITIALIZED}catch(n){v.a.warn("error while initializing ".concat(_(e),"\n"),n)(),t=t||n}e.internalState.layer=e;var n=!0,i=!1,r=void 0;try{for(var a,o=e.getModels()[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){a.value.userData.layer=e}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}},{key:"_transferLayerState",value:function(e,t){t._transferState(e),t.lifecycle=d.a.MATCHED,t!==e?(v.a.log(4,"matched ".concat(_(t)),e,"->",t)(),e.lifecycle=d.a.AWAITING_GC):v.a.log(4,"Matching layer is unchanged ".concat(t.id))()}},{key:"_updateLayer",value:function(e){v.a.log(4,"updating ".concat(e," because: ").concat(e.printChangeFlags()))();var t=null;try{e._update()}catch(n){v.a.warn("error during update of ".concat(_(e)),n)(),t=n}return t}},{key:"_finalizeLayer",value:function(e){Object(s.a)(e.lifecycle!==d.a.AWAITING_FINALIZATION),e.lifecycle=d.a.AWAITING_FINALIZATION;var t=null;this.setNeedsRedraw("finalized ".concat(_(e)));try{e._finalize()}catch(n){v.a.warn("error during finalization of ".concat(_(e)),n)(),t=n}return e.lifecycle=d.a.FINALIZED,v.a.log(2,"finalizing ".concat(_(e)))(),t}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){Object(y.b)(e),Object(y.g)(e)})}},{key:"_editSeer",value:function(e){"edit"===e.type&&"props"===e.valuePath[0]&&(Object(y.f)(e.itemKey,e.valuePath.slice(1),e.value),this.updateLayers())}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return x});var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),h=n(3),f=n.n(h),d=n(7),v=n.n(d),p=n(84),g=n(139),m=n(22),y=n(29);function b(e,t){return Number.isFinite(e)?e:t}var _=function(e){function t(e){var n,i=e.width,r=e.height,a=e.position,s=e.bearing,u=e.pitch,c=e.longitude,h=e.latitude,d=e.zoom,v=(e.syncBearing,e.bounds,e.startPanEventPosition),p=e.startPanPosition,g=e.startRotateCenter,m=e.startRotateViewport,y=e.startZoomPos,b=e.startZoom;return o()(this,t),(n=l()(this,f()(t).call(this,{width:i,height:r,position:a,bearing:s,pitch:u,longitude:c,latitude:h,zoom:d})))._interactiveState={startPanEventPosition:v,startPanPosition:p,startRotateCenter:g,startRotateViewport:m,startZoomPos:y,startZoom:b},n}return v()(t,e),u()(t,[{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos,n=this._viewportProps,i=n.translationX,r=n.translationY;return this._getUpdatedState({startPanPosition:[i,r],startPanEventPosition:t})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanEventPosition||n;if(!i)return this;var a=this._interactiveState.startPanPosition||[],o=r()(a,2),s=o[0],u=o[1];s=b(s,this._viewportProps.translationX),u=b(u,this._viewportProps.translationY);var c=t[0]-i[0],l=t[1]-i[1];return this._getUpdatedState({translationX:s+c,translationY:u-l})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null,startPanPos:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startRotateCenter:this._viewportProps.position,startRotateViewport:this._viewportProps})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY;if(!this._interactiveState.startRotateCenter)return this;var i=this._viewportProps,r=i.bearing,a=i.pitch;return this._getUpdatedState({bearing:r+10*t,pitch:a-10*n})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotateCenter:null,startRotateViewport:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomPos:t,startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale,r=this._viewportProps,a=r.zoom,o=r.minZoom,s=r.maxZoom,u=r.width,c=r.height,l=(r.translationX,r.translationY,this._interactiveState.startZoomPos||n||t),h=Object(m.b)(a*i,o,s);t[0],l[0],t[1],l[1],l[0],l[1];return h/a<1?this.moveBackward():this.moveForward()}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPos:null,startZoom:null})}},{key:"moveLeft",value:function(){var e=this._viewportProps.bearing-2;return this._getUpdatedState({bearing:e})}},{key:"moveRight",value:function(){var e=this._viewportProps.bearing+2;return this._getUpdatedState({bearing:e})}},{key:"moveForward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveBackward",value:function(){var e=this._viewportProps.position,t=this.getDirection(),n=new y.a(t).normalize().scale(-1);return this._getUpdatedState({position:new y.a(e).add(n)})}},{key:"moveUp",value:function(){var e=this._viewportProps.position;return this._getUpdatedState({position:new y.a(e).add([0,0,1])})}},{key:"moveDown",value:function(){var e=this._viewportProps.position,t=e[2]>=1?[0,0,-1]:[0,0,0];return this._getUpdatedState({position:new y.a(e).add(t)})}},{key:"zoomIn",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom+.2})}},{key:"zoomOut",value:function(){return this._getUpdatedState({zoom:this._viewportProps.zoom-.2})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}}]),t}(g.a),x=function(e){function t(e){return o()(this,t),l()(this,f()(t).call(this,_,e))}return v()(t,e),t}(p.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(84),v=n(131),p=n(82),g=n(83),m={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new p.a(["target","zoom"]),transitionInterruption:g.a.BREAK},y=function(e){function t(e){var n;return r()(this,t),(n=u()(this,l()(t).call(this,v.a,e))).invertPan=!0,n}return f()(t,e),o()(t,[{key:"_onPanRotate",value:function(e){return!1}},{key:"_getTransitionProps",value:function(){return m}}]),t}(d.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(16),u=n.n(s),c=n(8),l=n.n(c),h=n(6),f=n.n(h),d=n(3),v=n.n(d),p=n(13),g=n.n(p),m=n(7),y=n.n(m),b=n(65),_=n.n(b),x=n(43),w=n(18),O=n(74),P=n(77),S=[],j=[[0,1/0]];var k=n(15),C=n(129),E=n(105),T=n(60),A=n(70),M=n(25),L=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?Object(A.c)("attribute"):i,o=n.type,s=n.isIndexed,u=void 0!==s&&s;this.gl=t,this.id=a,this.isIndexed=u,this.target=u?34963:34962,this.type=o,u&&!o&&(this.type=t&&Object(C.b)(t,E.a.ELEMENT_INDEX_UINT32)?5125:5123),this.value=null,this.externalBuffer=null,this.buffer=null,this.userData={},this.update(n),this._validateAttributeDefinition()}return o()(e,[{key:"delete",value:function(){this.buffer&&(this.buffer.delete(),this.buffer=null)}},{key:"update",value:function(e){var t=e.value,n=e.buffer,i=e.constant,r=void 0===i?this.constant||!1:i;if(this.constant=r,n)this.externalBuffer=n,this.constant=!1,this.value=null,this.type=e.type||n.accessor.type,void 0!==n.accessor.divisor&&(this.divisor=n.accessor.divisor),void 0!==e.divisor&&(this.divisor=e.divisor);else if(t){this.externalBuffer=null;var a=this.size||e.size||0;if(r&&t.length!==a){this.value=new Float32Array(a),this._setAccessor(e);for(var o=this.elementOffset,s=0;s1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t);var a=i.type,o=5130===a;o&&(i=Object.assign({},i,{type:5126})),n=f()(this,v()(t).call(this,e,i));var s=i,u=s.transition,c=void 0!==u&&u,h=s.noAlloc,d=void 0!==h&&h,p=s.update,g=void 0===p?null:p,m=s.accessor,y=void 0===m?null:m,b=s.transform,x=void 0===b?null:b,w=s.bufferLayout,O=void 0===w?null:w,P=i.defaultValue,S=void 0===P?[0,0,0,0]:P;S=Array.isArray(S)?S:[S],n.defaultType=a||n.type||5126,n.shaderAttributes={},n.hasShaderAttributes=!1,n.doublePrecision=o;var j=i.shaderAttributes||o&&l()({},n.id,{});if(j){var k=Object.keys(j);for(var C in j=o?function(e,t){var n={};for(var i in t){var r=t[i],a="offset"in r?r.offset:e.offset,o="stride"in r?r.stride:4*e.size;n["".concat(i,"32")]=Object.assign({},r,{offset:a,stride:o}),n["".concat(i,"64")]=Object.assign({},r,{offset:2*a,stride:2*o}),n["".concat(i,"64xyLow")]=Object.assign({},r,{offset:2*a+o,stride:2*o})}return n}(_()(_()(n)),j):j){var E=j[C];n.shaderAttributes[C]=new L(n.gl,Object.assign({size:n.size,normalized:n.normalized,integer:n.integer,offset:n.offset,stride:n.stride,divisor:n.divisor},E,{id:C,buffer:n.getBuffer()})),n.hasShaderAttributes=k}}return Object.assign(n.userData,D,i,{transition:c,noAlloc:d,update:g||y&&n._standardAccessor,accessor:y,transform:x,defaultValue:S,bufferLayout:O}),Object.seal(n.userData),n._validateAttributeUpdaters(),n}return y()(t,e),o()(t,[{key:"delete",value:function(){g()(v()(t.prototype),"delete",this).call(this),I.a.release(this.userData.allocatedValue)}},{key:"needsUpdate",value:function(){return this.userData.needsUpdate}},{key:"needsRedraw",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,t=void 0!==e&&e,n=this.userData.needsRedraw;return this.userData.needsRedraw=this.userData.needsRedraw&&!t,n}},{key:"getUpdateTriggers",value:function(){var e=this.userData.accessor;return[this.id].concat("function"!=typeof e&&e||[])}},{key:"getAccessor",value:function(){return this.userData.accessor}},{key:"getShaderAttributes",value:function(){var e={};if(this.doublePrecision){var t=this.value instanceof Float64Array,n=!0,i=!1,r=void 0;try{for(var a,o=this.hasShaderAttributes[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;e[s]=this.shaderAttributes["".concat(s,t?"64":"32")];var u="".concat(s,"64xyLow");e[u]=t?this.shaderAttributes[u]:new Float32Array(this.size)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}else this.hasShaderAttributes?Object.assign(e,this.shaderAttributes):e[this.id]=this;return e}},{key:"supportsTransition",value:function(){return this.userData.transition}},{key:"getTransitionSetting",value:function(e){var t=this.userData,n=t.transition,i=t.accessor;if(!n)return null;var r=Array.isArray(i)?e[i.find(function(t){return e[t]})]:e[i];return(r=Object(F.c)(r))?Object.assign({},n,r):null}},{key:"setNeedsUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,t=arguments.length>1?arguments[1]:void 0;if(this.userData.needsUpdate=this.userData.needsUpdate||e,t){var n=t.startRow,i=void 0===n?0:n,r=t.endRow,a=void 0===r?1/0:r;this.userData.updateRanges=function(e,t){if(e===j)return e;if(t[0]<0&&(t[0]=0),t[0]>=t[1])return e;for(var n=[],i=e.length,r=0,a=0;at[1]?n.push(o):t=[Math.min(o[0],t[0]),Math.max(o[1],t[1])]}return n.splice(r,0,t),n}(this.userData.updateRanges,[i,a])}else this.userData.updateRanges=j}},{key:"clearNeedsUpdate",value:function(){this.userData.needsUpdate=!1,this.userData.updateRanges=S}},{key:"setNeedsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.userData.needsRedraw=this.userData.needsRedraw||e}},{key:"allocate",value:function(e){var t=this.userData;if(t.isExternalBuffer||t.noAlloc)return!1;if(t.update){Object(w.a)(Number.isFinite(e));var n=Math.max(e,1),i=z(this.defaultType),r=t.allocatedValue,a=t.updateRanges!==j;return this.constant=!1,this.value=I.a.allocate(r,n,{size:this.size,type:i,padding:this.elementOffset,copy:a}),this.buffer&&this.buffer.byteLength=e)break;n+=c*this.size,i++}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}return n+e*this.size}},{key:"_normalizeValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.userData.defaultValue;if(!Array.isArray(e)&&!ArrayBuffer.isView(e))return t[n]=Number.isFinite(e)?e:i[0],t;switch(this.size){case 4:t[n+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:t[n+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:t[n+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:t[n+0]=Number.isFinite(e[0])?e[0]:i[0]}return t}},{key:"_areValuesEqual",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.size,i=0;i=4&&!(Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])))throw new Error("Illegal attribute generated for ".concat(this.id))}},{key:"_updateShaderAttributes",value:function(){var e=this.shaderAttributes;for(var t in e){e[t].update({buffer:this.getBuffer(),value:this.value,constant:this.constant})}}},{key:"bufferLayout",get:function(){return this.userData.bufferLayout},set:function(e){this.userData.bufferLayout=e}}]),t}(L);function z(e){switch(e){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("Failed to deduce type from array")}}var B=n(228),U=n(181),V=function(){function e(t,n){var i=n.id;r()(this,e),this.id=i,this.gl=t,this.attributeTransitions={},this.needsRedraw=!1,this.transform=null,this.numInstances=0,B.a.isSupported(t)?this.isSupported=!0:t&&k.a.warn("WebGL2 not supported by this browser. Transition animation is disabled.")()}return o()(e,[{key:"finalize",value:function(){for(var e in this.transform&&this.transform.delete(),this.attributeTransitions)this._removeTransition(e)}},{key:"update",value:function(e){var t=e.attributes,n=e.transitions,i=void 0===n?{}:n,r=e.numInstances;if(this.opts=i,this.numInstances=r||1,this.isSupported){var a=this.attributeTransitions,o={};for(var s in t){this._updateAttribute(s,t[s])&&(o[s]=a[s])}for(var u in a){var c=t[u];c&&c.supportsTransition()||this._removeTransition(u)}if(this.transform){if(this.transform){var l=Object(F.a)(o),h=l.sourceBuffers,f=l.feedbackBuffers;this.transform.update({elementCount:this.numInstances,sourceBuffers:h,feedbackBuffers:f})}}else this._createModel()}}},{key:"hasAttribute",value:function(e){return e in this.attributeTransitions}},{key:"getAttributes",value:function(){var e={};for(var t in this.attributeTransitions){var n=this.attributeTransitions[t];n.buffer&&(e[t]=n.attributeInTransition)}return e}},{key:"setCurrentTime",value:function(e){if(!this.transform||0===this.numInstances)return!1;var t={},n=this.needsRedraw;for(var i in this.needsRedraw=!1,this.attributeTransitions){var r=this.attributeTransitions[i];r.update(e)&&(t["".concat(i,"Time")]=r.time,n=!0)}return n&&this.transform.run({uniforms:t}),n}},{key:"_createTransition",value:function(e,t){var n=this.attributeTransitions[e];return n?null:(n=new U.a({name:e,attribute:t,attributeInTransition:new N(this.gl,t),bufferLayout:t.bufferLayout}),this.attributeTransitions[e]=n,this._invalidateModel(),n)}},{key:"_removeTransition",value:function(e){var t=this.attributeTransitions[e];t&&(t.buffer&&t.buffer.delete(),t._swapBuffer&&t._swapBuffer.delete(),delete this.attributeTransitions[e],this._invalidateModel())}},{key:"_updateAttribute",value:function(e,t){var n=t.getTransitionSetting(this.opts);if(n){var i,r=this.attributeTransitions[e];if(r?i=t.needsRedraw():(r=this._createTransition(e,t),i=!0),i)return this._triggerTransition(r,n),!0}return!1}},{key:"_invalidateModel",value:function(){this.transform&&(this.transform.delete(),this.transform=null)}},{key:"_createModel",value:function(){0!==Object.keys(this.attributeTransitions).length&&(this.transform=new B.a(this.gl,Object.assign({elementCount:this.numInstances},Object(F.a)(this.attributeTransitions),Object(F.b)(this.attributeTransitions))))}},{key:"_getNextTransitionStates",value:function(e,t){var n,i=e.attribute,r=i.size,a=i.offset,o=i.normalized;n=i.constant?new L(this.gl,{constant:!0,value:i.value,size:r,offset:a}):new L(this.gl,{constant:!1,buffer:i.getBuffer(),divisor:0,size:r,offset:a,normalized:o,value:i.externalBuffer||i.doublePrecision?null:i.value});var s=e.buffer||n,u=i.userData.noAlloc?i.value.length:this.numInstances*r,c=s instanceof x.a&&s.getElementCount()||u,l=e._swapBuffer;return e._swapBuffer=e.buffer,l?l.getElementCount()0),this.needsRedraw=!0,e.start(Object.assign({},this._getNextTransitionStates(e,t),t))}}]),e}();n.d(t,"a",function(){return H});function G(){}var W={savedMessages:null,timeStart:null,onLog:function(e){var t=e.level,n=e.message;k.a.log(t,n)()},onUpdateStart:function(e){e.level,e.numInstances;W.savedMessages=[],W.timeStart=new Date},onUpdate:function(e){e.level;var t=e.message;W.savedMessages&&W.savedMessages.push(t)},onUpdateEnd:function(e){var t=e.level,n=e.id,i=e.numInstances,r=Math.round(new Date-W.timeStart),a="".concat(r,"ms");k.a.group(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a),{collapsed:!0})();var o=!0,s=!1,u=void 0;try{for(var c,l=W.savedMessages[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var h=c.value;k.a.log(t,h)()}}catch(e){s=!0,u=e}finally{try{o||null==l.return||l.return()}finally{if(s)throw u}}k.a.groupEnd(t,"Updated attributes for ".concat(i," instances in ").concat(n," in ").concat(a))(),W.savedMessages=null}},H=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.id,a=void 0===i?"attribute-manager":i,o=n.stats;r()(this,e),this.id=a,this.gl=t,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new V(t,{id:"".concat(a,"-transitions")}),Object.seal(this)}return o()(e,null,[{key:"setDefaultLogFunctions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onLog,n=e.onUpdateStart,i=e.onUpdate,r=e.onUpdateEnd;void 0!==t&&(W.onLog=t||G),void 0!==n&&(W.onUpdateStart=n||G),void 0!==i&&(W.onUpdate=i||G),void 0!==r&&(W.onUpdateEnd=r||G)}}]),o()(e,[{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&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}},{key:"setNeedsRedraw",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.needsRedraw=!0,this}},{key:"add",value:function(e,t){this._add(e,t)}},{key:"addInstanced",value:function(e,t){this._add(e,t,{instanced:1})}},{key:"remove",value:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=e.numInstances,i=e.bufferLayout,r=e.transitions,a=e.props,o=void 0===a?{}:a,s=e.buffers,u=void 0===s?{}:s,c=e.context,l=void 0===c?{}:c,h=!1;for(var f in W.onUpdateStart({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[f];d.setExternalBuffer(u[f]||t.attributes&&t.attributes[f])||d.setConstantValue(o[d.getAccessor()])||d.needsUpdate()&&(h=!0,this._updateAttribute({attribute:d,numInstances:n,bufferLayout:i,data:t,props:o,context:l})),this.needsRedraw|=d.needsRedraw()}h&&W.onUpdateEnd({level:2,id:this.id,numInstances:n}),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:r})}},{key:"updateTransition",value:function(e){var t=this.attributeTransitionManager.setCurrentTime(e);return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},t=this.attributes,n=this.attributeTransitionManager,i=Object.assign({},n.getAttributes());for(var r in t){var a=t[r];a.needsRedraw(e)&&!n.hasAttribute(r)&&(i[r]=a)}return i}},{key:"getAccessors",value:function(){return this.updateTriggers}},{key:"_add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&k.a.warn("AttributeManager.add({updaters}) - updater map no longer supported")();var i={};for(var r in e){var a=e[r],o=this._createAttribute(r,a,n);i[r]=o}Object.assign(this.attributes,i),this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,t,n){var i={id:e,constant:t.constant||!1,isIndexed:t.isIndexed||t.elements,size:t.elements?1:t.size,value:t.value||null,divisor:t.instanced||n.instanced?1:t.divisor};return new N(this.gl,Object.assign({},t,i))}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,t={},n=function(n){e.attributes[n].getUpdateTriggers().forEach(function(e){t[e]||(t[e]=[]),t[e].push(n)})};for(var i in this.attributes)n(i);this.updateTriggers=t}},{key:"_invalidateTrigger",value:function(e,t){var n=this.attributes,i=this.updateTriggers[e];if(i)i.forEach(function(e){var i=n[e];i&&i.setNeedsUpdate(i.id,t)});else{var r="invalidating non-existent trigger ".concat(e," for ").concat(this.id,"\n");r+="Valid triggers: ".concat(Object.keys(n).join(", ")),k.a.warn(r,i)()}return i}},{key:"_updateAttribute",value:function(e){var t=e.attribute,n=e.numInstances;t.allocate(n)&&W.onUpdate({level:3,message:"".concat(t.id," allocated ").concat(n),id:this.id});var i=Date.now();if(t.updateBuffer(e)){this.needsRedraw=!0;var r=Math.round(Date.now()-i);W.onUpdate({level:3,message:"".concat(t.id," updated ").concat(n," in ").concat(r,"ms")})}}}]),e}()},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(13),f=n.n(h),d=n(7),v=n.n(d),p=n(132),g=n(195),m=n(92),y=n(185),b=n.n(y),_=n(15),x=n(70),w=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,t);var n=e.id,i=void 0===n?Object(x.c)("column-geometry"):n,a=function(e){var t=e.radius,n=e.height,i=void 0===n?1:n,r=e.nradial,a=void 0===r?10:r,o=e.vertices;_.a.assert(!o||o.length>=a);for(var s=a+1,u=3*s,c=2*Math.PI/a,l=new Uint16Array(3*a*2),h=new Float32Array(3*u),f=new Float32Array(3*u),d=0,v=0;v 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec2 centroidPosition64xyLow = instancePositions64xyLow;\n vec3 pos = vec3(project_size(rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","gouraud-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:this.use64bitPositions()?5130:5126,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:P},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:P},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;f()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r});var a=r.extensionsChanged;if(a){var o=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(o)}),this.getAttributeManager().invalidateAll()}(a||n.diskResolution!==i.diskResolution||n.vertices!==i.vertices)&&this._updateGeometry(n)}},{key:"getGeometry",value:function(e,t){var n=new w({radius:1,height:2,vertices:t,nradial:e}),i=0;if(t)for(var r=0;r 1.0) {\n discard;\n } \n if (distToCenter > innerUnitRadius) {\n gl_FragColor = vLineColor;\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:this.use64bitPositions()?5130:5126,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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(f()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.radiusScale,a=i.radiusMinPixels,o=i.radiusMaxPixels,s=i.stroked,u=i.filled,c=i.lineWidthUnits,l=i.lineWidthScale,h=i.lineWidthMinPixels,f=i.lineWidthMaxPixels,d="pixels"===c?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{stroked:s?1:0,filled:u,radiusScale:r,radiusMinPixels:a,radiusMaxPixels:o,lineWidthScale:l*d,lineWidthMinPixels:h,lineWidthMaxPixels:f})).draw()}},{key:"_getModel",value:function(e){return new g.a(e,Object.assign(this.getShaders(),{id:this.props.id,geometry:new m.a({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0])}}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}}]),t}(p.a);_.layerName="ScatterplotLayer",_.defaultProps=b},function(e,t,n){"use strict";var i=n(16),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(6),l=n.n(c),h=n(3),f=n.n(h),d=n(7),v=n.n(d),p=n(22),g=n(84),m=n(139),y=n(155),b=n(56),_=85.05113,x=-85.05113;var w=n(18),O=n(82),P=n(83);n.d(t,"a",function(){return T});var S={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new O.a,transitionInterruption:P.a.BREAK},j={transitionDuration:0},k={minZoom:0,maxZoom:20,minPitch:0,maxPitch:60},C={pitch:0,bearing:0,altitude:1.5},E=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.width,r=n.height,a=n.latitude,s=n.longitude,u=n.zoom,c=n.bearing,h=void 0===c?C.bearing:c,d=n.pitch,v=void 0===d?C.pitch:d,p=n.altitude,g=void 0===p?C.altitude:p,m=n.maxZoom,y=void 0===m?k.maxZoom:m,b=n.minZoom,_=void 0===b?k.minZoom:b,x=n.maxPitch,O=void 0===x?k.maxPitch:x,P=n.minPitch,S=void 0===P?k.minPitch:P,j=n.startPanLngLat,E=n.startZoomLngLat,T=n.startBearing,A=n.startPitch,M=n.startZoom;return o()(this,t),Object(w.a)(Number.isFinite(s),"`longitude` must be supplied"),Object(w.a)(Number.isFinite(a),"`latitude` must be supplied"),Object(w.a)(Number.isFinite(u),"`zoom` must be supplied"),(e=l()(this,f()(t).call(this,{width:i,height:r,latitude:a,longitude:s,zoom:u,bearing:h,pitch:v,altitude:g,maxZoom:y,minZoom:_,maxPitch:O,minPitch:S})))._interactiveState={startPanLngLat:j,startZoomLngLat:E,startBearing:T,startPitch:A,startZoom:M},e}return v()(t,e),u()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,i=this._interactiveState.startPanLngLat||this._unproject(n);if(!i)return this;var a=this._calculateNewLngLat({startPanLngLat:i,pos:t}),o=r()(a,2),s=o[0],u=o[1];return this._getUpdatedState({longitude:s,latitude:u})}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,i=e.deltaScaleY,r=void 0===i?0:i,a=this._interactiveState,o=a.startBearing,s=a.startPitch;if(!Number.isFinite(o)||!Number.isFinite(s))return this;var u=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:r,startBearing:o,startPitch:s}),c=u.pitch,l=u.bearing;return this._getUpdatedState({bearing:l,pitch:c})}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,i=e.scale;Object(w.a)(i>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,s=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(n)||this._unproject(t)),Object(w.a)(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var u=this._calculateNewZoom({scale:i,startZoom:o}),c=new y.a(Object.assign({},this._viewportProps,{zoom:u})).getLocationAtPoint({lngLat:s,pos:t}),l=r()(c,2),h=l[0],f=l[1];return this._getUpdatedState({zoom:u,longitude:h,latitude:f})}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){return this._zoomFromCenter(2)}},{key:"zoomOut",value:function(){return this._zoomFromCenter(.5)}},{key:"moveLeft",value:function(){return this._panFromCenter([100,0])}},{key:"moveRight",value:function(){return this._panFromCenter([-100,0])}},{key:"moveUp",value:function(){return this._panFromCenter([0,100])}},{key:"moveDown",value:function(){return this._panFromCenter([0,-100])}},{key:"rotateLeft",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing-15})}},{key:"rotateRight",value:function(){return this._getUpdatedState({bearing:this._viewportProps.bearing+15})}},{key:"rotateUp",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch+10})}},{key:"rotateDown",value:function(){return this._getUpdatedState({pitch:this._viewportProps.pitch-10})}},{key:"shortestPathFrom",value:function(e){var t=e.getViewportProps(),n=Object.assign({},this._viewportProps),i=n.bearing,r=n.longitude;return Math.abs(i-t.bearing)>180&&(n.bearing=i<0?i+360:i-360),Math.abs(r-t.longitude)>180&&(n.longitude=r<0?r+360:r-360),n}},{key:"_zoomFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.zoom({pos:[n/2,i/2],scale:e})}},{key:"_panFromCenter",value:function(e){var t=this._viewportProps,n=t.width,i=t.height;return this.pan({startPos:[n/2,i/2],pos:[n/2+e[0],i/2+e[1]]})}},{key:"_getUpdatedState",value:function(e){return new t(Object.assign({},this._viewportProps,this._interactiveState,e))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,i=e.zoom;e.zoom=Object(p.b)(i,n,t);var r=e.maxPitch,a=e.minPitch,o=e.pitch;return e.pitch=Object(p.b)(o,a,r),Object.assign(e,function(e){var t=e.width,n=e.height,i=e.longitude,r=e.latitude,a=e.zoom,o=e.pitch,s=void 0===o?0:o,u=e.bearing,c=void 0===u?0:u;(i<-180||i>180)&&(i=Object(b.c)(i+180,360)-180),(c<-180||c>180)&&(c=Object(b.c)(c+180,360)-180);var l=new y.a({width:t,height:n,longitude:i,latitude:r,zoom:a}),h=l.project([i,_])[1],f=l.project([i,x])[1],d=0;return f-h0?d=h:f0?u=r+n*(s-r):n<0&&(u=r-n*(o-r)),{pitch:u,bearing:i+180*t}}}]),t}(m.a),T=function(e){function t(e){var n;return o()(this,t),(n=l()(this,f()(t).call(this,E,e))).invertPan=!0,n}return v()(t,e),u()(t,[{key:"_getTransitionProps",value:function(){return S}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,i=this.getCenter(e),a=r()(i,2)[1],o=a-n,s=this.controllerState.getViewportProps(),u=s.width,c=s.height,l=t/u,h=0;n>0?Math.abs(c-o)>5&&(h=n/(o-c)*1.2):n<0&&o>5&&(h=1-a/o),h=Math.min(1,Math.max(-1,h));var f=this.controllerState.rotate({deltaScaleX:l,deltaScaleY:h});return this.updateViewport(f,j,{isDragging:!0,isRotating:!0})}}]),t}(g.a)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(15),u=n(6),c=n.n(u),l=n(3),h=n.n(l),f=n(13),d=n.n(f),v=n(7),p=n.n(v),g=function(e){function t(){return r()(this,t),c()(this,h()(t).apply(this,arguments))}return p()(t,e),o()(t,[{key:"getModuleParameters",value:function(e,n,i){var r=d()(h()(t.prototype),"getModuleParameters",this).call(this,e);Object.assign(r,this.getObjectHighlightParameters(e),i);var a=!0,o=!1,s=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;Object.assign(r,l.getParameters(e))}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}},{key:"getObjectHighlightParameters",value:function(e){var t=e.props,n=t.highlightedObjectIndex,i=t.highlightColor,r={pickingHighlightColor:[i[0],i[1],i[2],i[3]||255]};return Number.isInteger(n)&&(r.pickingSelectedColor=n>=0?e.encodePickingColor(n):null),r}}]),t}(n(103).a),m=n(183),y=n(184),b=n(151),_=n(63);n.d(t,"a",function(){return x});var x=function(){function e(t){r()(this,e),this.gl=t,this.pixelRatio=null,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new g(t),this.pickLayersPass=new m.a(t),this.renderCount=0,this._needsRedraw="Initial render",this.screenBuffer=null,this.offscreenBuffer=null,this.lastPostProcessEffect=null}return o()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(y.a)(e.useDevicePixels)),"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed");var t=this.pixelRatio,n=this.layerFilter;this.drawLayersPass.setProps({pixelRatio:t,layerFilter:n}),this.pickLayersPass.setProps({pixelRatio:t,layerFilter:n})}},{key:"renderLayers",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.activateViewport,a=e.views,o=e.redrawReason,u=void 0===o?"unknown reason":o,c=e.clearCanvas,l=void 0===c||c,h=e.effects,f=void 0===h?[]:h,d=e.pass,v=e.stats,p=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,g=this.prepareEffects({layers:n,viewports:i,onViewportActive:r,views:a,effects:f,pixelRatio:this.pixelRatio}),m=this.lastPostProcessEffect?this.screenBuffer:_.a.getDefaultFramebuffer(this.gl),y=p.render({layers:n,viewports:i,views:a,onViewportActive:r,redrawReason:u,clearCanvas:l,effects:f,effectProps:g,outputBuffer:m});this.postRender(f),this.renderCount++,s.a.priority>=2&&y.forEach(function(e){t.logRenderStats({status:e,pass:d,redrawReason:u,stats:v,renderStats:y})})}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"finalize",value:function(){this.screenBuffer&&(this.screenBuffer.delete(),this.screenBuffer=null),this.offscreenBuffer&&(this.offscreenBuffer.delete(),this.offscreenBuffer=null)}},{key:"prepareEffects",value:function(e){var t=e.effects,n={};this.lastPostProcessEffect=null;var i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;Object.assign(n,u.prepare(this.gl,e)),u instanceof b.a&&(this.lastPostProcessEffect=u)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return this.lastPostProcessEffect&&this.prepareRenderBuffers(),n}},{key:"prepareRenderBuffers",value:function(){this.screenBuffer||(this.screenBuffer=new _.a(this.gl)),this.screenBuffer.resize(),this.offscreenBuffer||(this.offscreenBuffer=new _.a(this.gl)),this.offscreenBuffer.resize()}},{key:"postRender",value:function(e){var t={inputBuffer:this.screenBuffer,outputBuffer:this.offscreenBuffer,target:null},n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if(s instanceof b.a){if(s===this.lastPostProcessEffect){Object.assign(t,{target:_.a.getDefaultFramebuffer(this.gl)}),t=s.render(t);break}t=s.render(t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}},{key:"logRenderStats",value:function(e){var t=e.renderStats,n=e.pass,i=e.redrawReason,r=e.stats,a=t.totalCount,o=t.visibleCount,u=t.compositeCount,c=t.pickableCount,l=a-u-o,h="";h+="RENDER #".concat(this.renderCount," ").concat(o," (of ").concat(a," layers) to ").concat(n," because ").concat(i," "),s.a.priority>2&&(h+="(".concat(l," hidden, ").concat(u," composite ").concat(c," pickable)")),s.a.log(2,h)(),r&&r.get("Redraw Layers").add(o)}}]),e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a});var i=n(35),r=n(176);function a(){return!("object"===(void 0===e?"undefined":Object(i.a)(e))&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(88))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r});var i=n(35);function r(t){if("undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"===Object(i.a)(e.versions)&&Boolean(e.versions.electron))return!0;var n="object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}}).call(this,n(88))},function(e,t,n){"use strict";function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(33),s=n(5),u=n(11),c=n(53),l=n(129),h=n(105),f=n(30),d=n(19),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).target=null,n._queryPending=!1,n._pollingPromise=null,Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(f.d)(e),i=Object(l.c)(e,h.a.TIMER_QUERY),r=n||i,a=!0,o=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){switch(u.value){case"queries":r=r&&n;break;case"timers":r=r&&i;break;default:Object(d.a)(!1)}}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return r}}]),Object(s.a)(t,[{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,t=void 0!==e&&e;return this.begin(t?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(e){return this._queryPending?this:(this.target=e,this.gl.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var e=this.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}},{key:"isTimerDisjoint",value:function(){return this.gl.getParameter(36795)}},{key:"getResult",value:function(){return this.gl.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise(function(i,r){requestAnimationFrame(function a(){e.isResultAvailable()?(i(e.getResult()),e._pollingPromise=null):n++>t?(r("Timed out"),e._pollingPromise=null):requestAnimationFrame(a)})}),this._pollingPromise}},{key:"_createHandle",value:function(){return t.isSupported(this.gl)?this.gl.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl.deleteQuery(this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e);var i=n.id,a=void 0===i?"pass":i;this.id=a,this.gl=t,this.props={},Object.assign(this.props,n)}return o()(e,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(){}},{key:"cleanup",value:function(){}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(22),u=n(18),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r()(this,e),Array.isArray(t)&&(t={compare:t,extract:t,required:t});var n=t,i=n.compare,a=n.extract,o=n.required;this._propsToCompare=i,this._propsToExtract=a,this._requiredProps=o}return o()(e,[{key:"arePropsEqual",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=(this._propsToCompare||Object.keys(t))[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var u=a.value;if(!Object(s.e)(e[u],t[u]))return!1}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!0}},{key:"initializeProps",value:function(e,t){var n;if(this._propsToExtract){var i={},r={},a=!0,o=!1,s=void 0;try{for(var u,c=this._propsToExtract[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=u.value;i[l]=e[l],r[l]=t[l]}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}n={start:i,end:r}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}},{key:"interpolateProps",value:function(e,t,n){Object(u.a)(!1,"interpolateProps is not implemented")}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(t){var n=e[t];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s={NONE:"none",PENDING:"pending",IN_PROGRESS:"in_progress",ENDED:"ended"};function u(){}var c=function(){function e(t){r()(this,e),this._startTime=null,this._state=s.NONE,this.duration=1,this.easing=function(e){return e},this.onStart=u,this.onUpdate=u,this.onInterrupt=u,this.onEnd=u,Object.assign(this,t)}return o()(e,[{key:"start",value:function(e){this.inProgress&&this.onInterrupt(this),Object.assign(this,e),this._setState(s.PENDING)}},{key:"cancel",value:function(){this.inProgress&&(this.onInterrupt(this),this._setState(s.NONE))}},{key:"update",value:function(e){if(this.state===s.PENDING&&(this._startTime=e,this._setState(s.IN_PROGRESS)),this.state===s.IN_PROGRESS){var t=!1,n=(e-this._startTime)/this.duration;return n>=1&&(n=1,t=!0),this.time=this.easing(n),this.onUpdate(this),t&&this._setState(s.ENDED),!0}return!1}},{key:"_setState",value:function(e){if(this._state!==e)switch(this._state=e,e){case s.PENDING:this.onStart(this);break;case s.ENDED:this.onEnd(this)}}},{key:"state",get:function(){return this._state}},{key:"inProgress",get:function(){return this._state===s.PENDING||this._state===s.IN_PROGRESS}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n(31),r=n.n(i),a="count(): argument not an object",o="count(): argument not a container";function s(e){if(null===(t=e)||"object"!==r()(t))throw new Error(a);var t;if("function"==typeof e.count)return e.count();if(Number.isFinite(e.size))return e.size;if(Number.isFinite(e.length))return e.length;if(function(e){return null!==e&&"object"===r()(e)&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(o)}},function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(13),f=n.n(h),d=n(7),v=n.n(d),p=n(103),g=n(73),m=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"render",value:function(e){e.pickingFBO?this.drawPickingBuffer(e):f()(l()(t.prototype),"render",this).call(this,e)}},{key:"drawPickingBuffer",value:function(e){var t=this,n=e.layers,i=e.viewports,r=e.onViewportActive,a=e.pickingFBO,o=e.effectProps,s=e.deviceRect,u=s.x,c=s.y,l=s.width,h=s.height,f=e.redrawReason,d=void 0===f?"":f,v=this.gl;return Object(g.a)(v,{framebuffer:a,scissorTest:!0,scissor:[u,c,l,h],clearColor:[0,0,0,0]},function(){t.drawLayers({layers:n,viewports:i,onViewportActive:r,pass:"picking",redrawReason:d,effectProps:o,parameters:{blend:!0,blendFunc:[1,0,32771,0],blendEquation:32774,blendColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]}})})}},{key:"shouldDrawLayer",value:function(e,t){var n=this.props.layerFilter,i=!e.isComposite&&e.props.visible&&e.props.pickable;return i&&n&&(i=n({layer:e,viewport:t,isPicking:!0})),i}},{key:"getModuleParameters",value:function(e,t,n){var i=Object.assign(Object.create(e.props),{viewport:e.context.viewport,pickingActive:1,devicePixelRatio:this.props.pixelRatio});return Object.assign(i,n),i}},{key:"getLayerParameters",value:function(e,t,n,i){var r=Object.assign({},e.props.parameters||{},i);return Object.assign(r,{viewport:n,blendColor:[0,0,0,(t+1)/255]}),r}}]),t}(p.a)},function(e,t,n){"use strict";function i(e){return e&&"undefined"!=typeof window?window.devicePixelRatio:1}n.d(t,"a",function(){return i})},function(e,t,n){var i=n(8);e.exports=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(i.a)(this,t),e=Object(a.a)(this,Object(o.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,r),e}return Object(s.a)(t,e),Object(r.a)(t,[{key:"cross",value:function(e){return c.b(this,this,e),this.check()}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"operation",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i":function(e,t){return e>t},"<=":function(e,t){return e<=t},">=":function(e,t){return e>=t},"<<":function(e,t){return e<>":function(e,t){return e>>t},">>>":function(e,t){return e>>>t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t}},a={"-":function(e){return-e},"+":function(e){return e},"~":function(e){return~e},"!":function(e){return!e}};function o(e,t){return e.map(function(e){return l(e,t)})}async function s(e,t){return await Promise.all(e.map(e=>h(e,t)))}function u(e,t){const n=l(e.object,t);return e.computed?[n,n[l(e.property,t)]]:[n,n[e.property.name]]}async function c(e,t){const n=await h(e.object,t);return e.computed?[n,n[await h(e.property,t)]]:[n,n[e.property.name]]}function l(e,t){switch(e.type){case"ArrayExpression":return o(e.elements,t);case"BinaryExpression":return r[e.operator](l(e.left,t),l(e.right,t));case"CallExpression":let n,i,s;if("MemberExpression"===e.callee.type?(n=(s=u(e.callee,t))[0],i=s[1]):i=l(e.callee,t),"function"!=typeof i)return;return i.apply(n,o(e.arguments,t));case"ConditionalExpression":return l(e.test,t)?l(e.consequent,t):l(e.alternate,t);case"Identifier":return t[e.name];case"Literal":return e.value;case"LogicalExpression":return"||"===e.operator?l(e.left,t)||l(e.right,t):"&&"===e.operator?l(e.left,t)&&l(e.right,t):r[e.operator](l(e.left,t),l(e.right,t));case"MemberExpression":return u(e,t)[1];case"ThisExpression":return t;case"UnaryExpression":return a[e.operator](l(e.argument,t));default:return}}async function h(e,t){switch(e.type){case"ArrayExpression":return await s(e.elements,t);case"BinaryExpression":{const[n,i]=await Promise.all([h(e.left,t),h(e.right,t)]);return r[e.operator](n,i)}case"CallExpression":let n,i,o;if("MemberExpression"===e.callee.type?(n=(o=await c(e.callee,t))[0],i=o[1]):i=await h(e.callee,t),"function"!=typeof i)return;return await i.apply(n,await s(e.arguments,t));case"ConditionalExpression":return await h(e.test,t)?await h(e.consequent,t):await h(e.alternate,t);case"Identifier":return t[e.name];case"Literal":return e.value;case"LogicalExpression":{if("||"===e.operator)return await h(e.left,t)||await h(e.right,t);if("&&"===e.operator)return await h(e.left,t)&&await h(e.right,t);const[n,i]=await Promise.all([h(e.left,t),h(e.right,t)]);return r[e.operator](n,i)}case"MemberExpression":return(await c(e,t))[1];case"ThisExpression":return t;case"UnaryExpression":return a[e.operator](await h(e.argument,t));default:return}}e.exports={parse:i,eval:l,evalAsync:h,compile:function(e){return l.bind(null,i(e))},compileAsync:function(e){return h.bind(null,i(e))}}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isInteger,r=void 0!==n&&n;if(Array.isArray(e)||ArrayBuffer.isView(e))return function(e,t){for(var n=t.maxElts,r=void 0===n?16:n,a=t.size,o=void 0===a?1:a,s="[",u=0;u0&&(s+=",".concat(u%o==0?" ":"")),s+=i(e[u],t);var c=e.length>r?"...":"]";return"".concat(s).concat(c)}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return r?"0":"0.";if(r)return e.toFixed(0);if(Math.abs(e)>100&&Math.abs(e)<1e4)return e.toFixed(0);var a=e.toPrecision(2);return a.indexOf(".0")===a.length-2?a.slice(0,-1):a}n.d(t,"a",function(){return i})},,function(e,t,n){"use strict";var i=n(116),r="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var a={name:"gouraud-lighting",dependencies:[i.a],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:u},o={name:"phong-lighting",dependencies:[i.a],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:u},s={};function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;if(!("material"in e))return{};var t=e.material;return t?function(e){var t={};return t.lighting_uAmbient=e.ambient,t.lighting_uDiffuse=e.diffuse,t.lighting_uShininess=e.shininess,t.lighting_uSpecularColor=e.specularColor.map(function(e){return e/255}),t}(t):{lighting_uEnabled:!1}}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(4),r=n(5),a=n(64),o=n(200),s=n(19),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.gl,r=t._cachePrograms,a=void 0!==r&&r;Object(i.a)(this,e),Object(s.a)(n),this.gl=n,this.vertexShaders={},this.fragmentShaders={},this.programs={},this._cachePrograms=a}return Object(r.a)(e,[{key:"delete",value:function(){return this}},{key:"getVertexShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.vertexShaders[t];return n||(n=new a.c(e,t),this.vertexShaders[t]=n),n}},{key:"getFragmentShader",value:function(e,t){Object(s.a)("string"==typeof t),Object(s.a)(this._compareContexts(e,this.gl));var n=this.fragmentShaders[t];return n||(n=new a.a(e,t),this.fragmentShaders[t]=n),n}},{key:"getProgram",value:function(e,t){Object(s.a)(this._compareContexts(e,this.gl)),Object(s.a)("string"==typeof t.vs),Object(s.a)("string"==typeof t.fs),Object(s.a)("string"==typeof t.id);var n=this._getProgramKey(t),i=this.programs[n];return i?(this._resetProgram(i),i):(i=this._createNewProgram(e,t),this._cachePrograms&&this._checkProgramProp(i)&&(i._isCached=!0,this.programs[n]=i),i)}},{key:"_getProgramKey",value:function(e){return"".concat(e.id,"-").concat(e.vs,"-").concat(e.fs)}},{key:"_checkProgramProp",value:function(e){return!e.varyings}},{key:"_createNewProgram",value:function(e,t){var n=t.vs,i=t.fs,r=this.getVertexShader(e,n),a=this.getFragmentShader(e,i);return new o.a(this.gl,Object.assign({},t,{vs:r,fs:a}))}},{key:"_resetProgram",value:function(e,t){e.reset()}},{key:"_compareContexts",value:function(e,t){return(e.gl||e)===(t.gl||t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n(36),r=n(4),a=n(10),o=n(9),s=n(11),u=n(59),c=n(70),l=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),h=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),f=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),d=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]),v={POSITION:{size:3,value:new Float32Array(h)},NORMAL:{size:3,value:new Float32Array(f)},TEXCOORD_0:{size:2,value:new Float32Array(d)}},p=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var n=e.id,s=void 0===n?Object(c.c)("cube-geometry"):n;return Object(a.a)(this,Object(o.a)(t).call(this,Object(i.a)({},e,{id:s,indices:{size:1,value:new Uint16Array(l)},attributes:Object(i.a)({},v,e.attributes)})))}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(10),a=n(9),o=n(33),s=n(11),u=n(130),c={ambient:.35,diffuse:.6,shininess:32,specularColor:[30,30,30]},l=function(e){function t(e){var n;return Object(i.a)(this,t),n=Object(r.a)(this,Object(a.a)(t).call(this,e)),e=Object.assign({},c,e),Object.assign(Object(o.a)(n),e),n}return Object(s.a)(t,e),t}(u.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(13),f=n.n(h),d=n(7),v=n.n(d),p=n(132),g=n(15),m=n(77),y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(){}},{key:"setState",value:function(e){f()(l()(t.prototype),"setState",this).call(this,e),this.setNeedsUpdate()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=t.object;return n&&n.__source&&n.__source.parent&&n.__source.parent.id===this.id?Object.assign(t,{object:n.__source.object,index:n.__source.index}):t}},{key:"renderLayers",value:function(){return null}},{key:"shouldRenderSubLayer",value:function(e,t){var n=this.props._subLayerProps;return t&&t.length||n&&n[e]}},{key:"getSubLayerClass",value:function(e,t){var n=this.props._subLayerProps;return n&&n[e]&&n[e].type||t}},{key:"getSubLayerRow",value:function(e,t,n){return e.__source={parent:this,object:t,index:n},e}},{key:"getSubLayerAccessor",value:function(e){if("function"==typeof e){var t={data:this.props.data,target:[]};return function(n,i){return n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,i)}}return e}},{key:"getSubLayerProps",value:function(e){var t=this.props,n=t.opacity,i=t.pickable,r=t.visible,a=t.parameters,o=t.getPolygonOffset,s=t.highlightedObjectIndex,u=t.autoHighlight,c=t.highlightColor,l=t.coordinateSystem,h=t.coordinateOrigin,f=t.wrapLongitude,d=t.positionFormat,v=t.modelMatrix,p=t.extensions,g=t._subLayerProps,m={opacity:n,pickable:i,visible:r,parameters:a,getPolygonOffset:o,highlightedObjectIndex:s,autoHighlight:u,highlightColor:c,coordinateSystem:l,coordinateOrigin:h,wrapLongitude:f,positionFormat:d,modelMatrix:v,extensions:p};if(e){var y=g&&g[e.id],b=y&&y.updateTriggers;Object.assign(m,e,y,{id:"".concat(this.props.id,"-").concat(e.id),updateTriggers:Object.assign({all:this.props.updateTriggers.all},e.updateTriggers,b)})}var _=!0,x=!1,w=void 0;try{for(var O,P=p[Symbol.iterator]();!(_=(O=P.next()).done);_=!0){var S=O.value,j=S.getSubLayerProps.call(this,S);Object.assign(m,j,{updateTriggers:Object.assign(m.updateTriggers,j.updateTriggers)})}}catch(e){x=!0,w=e}finally{try{_||null==P.return||P.return()}finally{if(x)throw w}}return m}},{key:"_getAttributeManager",value:function(){return null}},{key:"_renderLayers",value:function(){var e=this.internalState.subLayers;e&&!this.needsUpdate()?g.a.log(3,"Composite layer reused subLayers ".concat(this),this.internalState.subLayers)():(e=this.renderLayers(),e=Object(m.b)(e,{filter:Boolean}),this.internalState.subLayers=e,g.a.log(2,"Composite layer rendered new subLayers ".concat(this),e)());var t=!0,n=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){r.value.parent=this}}catch(e){n=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"isComposite",get:function(){return!0}}]),t}(p.a);y.layerName="CompositeLayer"},function(e,t,n){"use strict";var i=n(31),r=n.n(i),a=n(1),o=n.n(a),s=n(2),u=n.n(s),c=n(167),l=n(18),h=n(106),f=n(54),d=n(44),v=n(15),p=n(77),g=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,e),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractiveStateChange:t.onInteractiveStateChange},Object.seal(this),this.setProps(t)}return u()(e,[{key:"finalize",value:function(){for(var e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("time"in e)for(var t in this.controllers){var n=this.controllers[t];n&&n.updateTransition(e.time)}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(t){return t.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(t){e[t.id]=t}),e}},{key:"getView",value:function(e){return"string"==typeof e?this.views.find(function(t){return t.id===e}):e}},{key:"getViewState",value:function(e){var t=this.getView(e),n=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(n):n}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,t){for(var n=this.getViewports(),i={x:e[0],y:e[1]},r=n.length-1;r>=0;--r){var a=n[r];if(a.containsPixel(i)){var o=e.slice();return o[0]-=a.x,o[1]-=a.y,a.unproject(o,t)}}return null}},{key:"setProps",value:function(e){"views"in e&&this._setViews(e.views),"viewState"in e&&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,t){Object(l.a)(Number.isFinite(e)&&Number.isFinite(t)),e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=Object(p.b)(e,{filter:Boolean}).map(function(e){return e instanceof d.a?new f.a({viewportInstance:e}):e}),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){e?(!Object(h.a)(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):v.a.warn("setting null viewState")()}},{key:"_onViewStateChange",value:function(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange(t)}},{key:"_createController",value:function(e){return new(0,e.type)(Object.assign({eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractiveStateChange},e))}},{key:"_updateController",value:function(e,t,n,i){if(e.controller){var r=Object.assign({},e.controller,t,{id:e.id,x:n.x,y:n.y,width:n.width,height:n.height});return i?i.setProps(r):i=this._createController(r),i}return null}},{key:"_rebuildViewports",value:function(){var e=this.width,t=this.height,n=this.views,i=this.controllers;this._viewports=[],this.controllers={};for(var r=n.length;r--;){var a=n[r],o=this.getViewState(a),s=a.makeViewport({width:e,height:t,viewState:o});this.controllers[a.id]=this._updateController(a,o,s,i[a.id]),this._viewports.unshift(s)}for(var u in i)i[u]&&!this.controllers[u]&&i[u].finalize();this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={},this._viewports.forEach(function(t){t.id&&(e._viewportMap[t.id]=e._viewportMap[t.id]||t)})}},{key:"_diffViews",value:function(e,t){return e.length!==t.length||e.some(function(n,i){return!e[i].equals(t[i])})}}]),e}(),m=n(165),y=n(152),b=new y.a,_=function(){function e(){o()(this,e),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return u()(e,[{key:"setProps",value:function(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(h.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=e,this._createInternalEffects()}},{key:"cleanup",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=this.effects[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){i.value.cleanup()}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=!0,o=!1,s=void 0;try{for(var u,c=this._internalEffects[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){u.value.cleanup()}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}this.effects.length=0,this._internalEffects.length=0}},{key:"_createInternalEffects",value:function(){this._internalEffects=this.effects.slice(),this.effects.some(function(e){return e instanceof y.a})||this._internalEffects.push(b)}}]),e}(),x=n(104),w=n(174),O=n(63),P=n(81),S=n(184),j=n(183),k={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function C(e){var t=e.pickedColors,n=e.layers,i=e.deviceX,r=e.deviceY,a=e.deviceRadius,o=e.deviceRect;if(t){for(var s=o.x,u=o.y,c=o.width,l=o.height,h=a*a,f=-1,d=0,p=0;ph)d+=4*c;else for(var y=0;y=0){var b=y+s-i,_=b*b+m;_<=h&&(h=_,f=d)}d+=4}}if(f>=0){var x=t[f+3]-1,w=t.slice(f,f+4),O=n[x];if(O){var P=O.decodePickingColor(w);return{pickedColor:w,pickedLayer:O,pickedObjectIndex:P}}v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return k}function E(e){var t=e.pickInfo,n=e.lastPickedInfo,i=e.mode,r=e.layers,a=e.viewports,o=e.x,s=e.y,u=e.deviceX,c=e.deviceY,l=e.pixelRatio,h=t.pickedColor,f=t.pickedLayer,d=t.pickedObjectIndex,v=f?[f]:[];if("hover"===i){var p=n.index,g=n.layerId,m=f&&f.props.id;if(m!==g||d!==p){if(m!==g){var y=r.find(function(e){return e.props.id===g});y&&v.unshift(y)}n.layerId=m,n.index=d,n.info=null}}var b={viewports:a}.viewports[0],_=b&&b.unproject([o,s]),x={color:null,layer:null,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:_,lngLat:_,devicePixel:[u,c],pixelRatio:l},w=new Map;return w.set(null,x),v.forEach(function(e){var t=Object.assign({},x);if(e===f&&(t.color=h,t.index=d,t.picked=!0),t=T({layer:e,info:t,mode:i}),e===f&&"hover"===i&&(n.info=t),t&&w.set(t.layer.id,t),"hover"===i){var r=e.props.autoHighlight&&f===e?h:null;e.setModuleParameters({pickingSelectedColor:r}),e.setNeedsRedraw()}}),w}function T(e){for(var t=e.layer,n=e.info,i=e.mode;t&&n;){var r=n.layer||t;n.layer=t,n=t.pickLayer({info:n,mode:i,sourceLayer:r}),t=t.parent}return n}var A=function(){function e(t){o()(this,e),this.gl=t,this.pickingFBO=null,this.pickLayersPass=new j.a(t),this.pixelRatio=null,this.layerFilter=null,this.pickingEvent=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}return u()(e,[{key:"setProps",value:function(e){"useDevicePixels"in e&&(this.pixelRatio=Object(S.a)(e.useDevicePixels)),"layerFilter"in e&&(this.layerFilter=e.layerFilter),this.pickLayersPass.setProps({pixelRatio:this.pixelRatio,layerFilter:this.layerFilter})}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.mode,r=e.radius,a=void 0===r?0:r,o=e.layers,s=e.viewports,u=e.activateViewport,c=e.depth,l=void 0===c?1:c,h=e.event,f=void 0===h?null:h;this.pickingEvent=f;var d=this.pickClosestObject({x:t,y:n,radius:a,layers:o,mode:i,depth:l,viewports:s,onViewportActive:u});return this.pickingEvent=null,d}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a=e.layers,o=e.viewports,s=e.activateViewport;return this.pickVisibleObjects({x:t,y:n,width:i,height:r,layers:a,mode:"pickObjects",viewports:o,onViewportActive:s})}},{key:"getLastPickedObject",value:function(e){var t=e.x,n=e.y,i=e.layers,r=e.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,o=a&&a.layer&&a.layer.id,s=o?i.find(function(e){return e.id===o}):null,u=r[0]&&r[0].unproject([t,n]),c={x:t,y:n,coordinate:u,lngLat:u,layer:s};return s?Object.assign({},a,c):Object.assign(c,{color:null,object:null,index:-1})}},{key:"updatePickingBuffer",value:function(){var e=this.gl;return this.pickingFBO||(this.pickingFBO=new O.a(e)),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}},{key:"pickClosestObject",value:function(e){var t=e.layers,n=e.viewports,i=e.x,r=e.y,a=e.radius,o=e.depth,s=void 0===o?1:o,u=e.mode,c=e.onViewportActive;this.updatePickingBuffer();for(var l,h=this.pixelRatio,f=Math.round(i*h),d=Math.round(this.gl.canvas.height-(r+1)*h),v=Math.round(a*h),p=this.pickingFBO,g=p.width,m=p.height,y=this.getPickingRect({deviceX:f,deviceY:d,deviceRadius:v,deviceWidth:g,deviceHeight:m}),b=[],_={},x=0;x=0){var o=t.slice(r,r+4),s=o.join(",");if(!i.has(s)){var u=n[a];u?i.set(s,{pickedColor:o,pickedLayer:u,pickedObjectIndex:u.decodePickingColor(o)}):v.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(i.values())}({pickedColors:this.drawAndSamplePickingBuffer({layers:t,viewports:n,onViewportActive:u,deviceRect:p,redrawReason:s}),layers:t}),m=new Map;return g.forEach(function(e){var t={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:i,y:r,width:a,height:o,pixelRatio:c};t=T({layer:e.pickedLayer,info:t,mode:s}),m.has(t.object)||m.set(t.object,t)}),Array.from(m.values())}},{key:"drawAndSamplePickingBuffer",value:function(e){var t=e.layers,n=e.viewports,i=e.onViewportActive,r=e.deviceRect,a=e.redrawReason;if(Object(l.a)(r),Object(l.a)(Number.isFinite(r.width)&&r.width>0,"`width` must be > 0"),Object(l.a)(Number.isFinite(r.height)&&r.height>0,"`height` must be > 0"),t.filter(function(e){return e.isPickable()}).length<1)return null;var o=this.pickingFBO;this.pickLayersPass.render({layers:t,viewports:n,onViewportActive:i,pickingFBO:o,deviceRect:r,redrawReason:a,effectProps:{lightSources:{}}});var s=r.x,u=r.y,c=r.width,h=r.height,f=new Uint8Array(c*h*4);return Object(P.e)(o,{sourceX:s,sourceY:u,sourceWidth:c,sourceHeight:h,target:f}),f}},{key:"getPickingRect",value:function(e){var t=e.deviceX,n=e.deviceY,i=e.deviceRadius,r=e.deviceWidth,a=e.deviceHeight,o=Math.max(0,t-i),s=Math.max(0,n-i),u=Math.min(r,t+i+1)-o,c=Math.min(a,n+i+1)-s;return u<=0||c<=0?null:{x:o,y:s,width:u,height:c}}},{key:"callLayerPickingCallbacks",value:function(e,t){var n=[],i=this.pickingEvent;return e.forEach(function(e){if(e.layer){var r=!1;switch(t){case"hover":r=e.layer.onHover(e,i);break;case"query":break;default:throw new Error("unknown pick type")}r||n.push(e)}}),n}}]),e}(),M=n(198),L=n(208),I=n(90),R=n(89),F=n(150),D=n(108),N=n(271),z=n(272),B=n(23),U=n(4),V=n(5),G=1,W=2,H=4,X={mousedown:G,mousemove:W,mouseup:H};var q,Z,Y=null;"undefined"!=typeof document&&(Y=n(259),q=Y.PointerEventInput,Z=q.prototype.handler,q.prototype.handler=function(e){var t=this.store;e.button>0&&(function(e,t){for(var n=0;n=0&&(this.pressed=!0),t&W&&0===e.which&&(t=H),this.pressed&&(t&H&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))});var K=Y;var Q=K?[[K.Rotate,{enable:!1}],[K.Pinch,{enable:!1}],[K.Swipe,{enable:!1}],[K.Pan,{threshold:0,enable:!1}],[K.Press,{enable:!1}],[K.Tap,{event:"doubletap",taps:2,enable:!1}],[K.Tap,{event:"anytap",enable:!1}],[K.Tap,{enable:!1}]]:null,J={rotate:["pinch"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},$={doubletap:["tap"]},ee={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},te=["keydown","keyup"],ne=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],ie=["wheel","mousewheel","DOMMouseScroll"],re={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",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"},ae={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},oe=n(122),se=-1!==oe.b.indexOf("firefox"),ue=ie,ce=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(U.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.events=ue.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent,!!oe.a&&{passive:!1})})}return Object(V.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"wheel"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){if(this.options.enable){var t=e.deltaY;oe.c.WheelEvent&&(se&&e.deltaMode===oe.c.WheelEvent.DOM_DELTA_PIXEL&&(t/=oe.c.devicePixelRatio),e.deltaMode===oe.c.WheelEvent.DOM_DELTA_LINE&&(t*=40));var n={x:e.clientX,y:e.clientY};0!==t&&t%4.000244140625==0&&(t=Math.floor(t/4.000244140625)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,n)}}},{key:"_onWheel",value:function(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),le=ne,he=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(U.a)(this,e),this.element=t,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},r),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=le.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(V.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"pointermove"===e&&(this.enableMoveEvent=t),"pointerover"===e&&(this.enableOverEvent=t),"pointerout"===e&&(this.enableOutEvent=t),"pointerleave"===e&&(this.enableLeaveEvent=t)}},{key:"handleEvent",value:function(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}},{key:"handleOverEvent",value:function(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:"pointerover",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleOutEvent",value:function(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:"pointerout",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleLeaveEvent",value:function(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:"pointerleave",srcEvent:e,pointerType:"mouse",target:e.target})}},{key:"handleMoveEvent",value:function(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}]),e}(),fe=te,de=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(U.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},r),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=fe.concat(r.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=1,t.style.outline="none",this.events.forEach(function(e){return t.addEventListener(e,i.handleEvent)})}return Object(V.a)(e,[{key:"destroy",value:function(){var e=this;this.events.forEach(function(t){return e.element.removeEventListener(t,e.handleEvent)})}},{key:"enableEventType",value:function(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}},{key:"handleEvent",value:function(e){var t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:"keydown",srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}]),e}(),ve=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(U.a)(this,e),this.element=t,this.callback=n,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),t.addEventListener("contextmenu",this.handleEvent)}return Object(V.a)(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(e,t){"contextmenu"===e&&(this.options.enable=t)}},{key:"handleEvent",value:function(e){this.options.enable&&this.callback({type:"contextmenu",center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),e}(),pe=1,ge=2,me=4,ye={pointerdown:pe,pointermove:ge,pointerup:me,mousedown:pe,mousemove:ge,mouseup:me},be=1,_e=2,xe=3,we=0,Oe=1,Pe=2,Se=1,je=2,ke=4;var Ce=function(){function e(t){Object(U.a)(this,e),this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this)}return Object(V.a)(e,[{key:"isEmpty",value:function(){return 0===this.handlers.length}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=this.handlers,r=this.handlersByElement;r.has(n)||r.set(n,[]);var a={type:e,handler:t,srcElement:n};i.push(a),r.get(n).push(a)}},{key:"remove",value:function(e,t){for(var n=this.handlers,i=this.handlersByElement,r=n.length-1;r>=0;r--){var a=n[r];if(a.type===e&&a.handler===t){n.splice(r,1);var o=i.get(a.srcElement);o.splice(o.indexOf(a),1),0===o.length&&i.delete(a.srcElement)}}}},{key:"handleEvent",value:function(e){if(!this.isEmpty()){for(var t=this._normalizeEvent(e),n=e.srcEvent.target;n&&n!==t.rootElement;){if(this._emit(t,n),t.handled)return;n=n.parentNode}this._emit(t,"root")}}},{key:"_emit",value:function(e,t){var n=this.handlersByElement.get(t);if(n)for(var i=!1,r=function(){e.handled=!0},a=function(){e.handled=!0,i=!0},o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(U.a)(this,e),this.options=Object.assign({},Ee,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(t);var i=n.events;i&&this.on(i)}return Object(V.a)(e,[{key:"setElement",value:function(e){var t=this;if(this.element&&this.destroy(),this.element=e,e){var n=this.options,i=n.Manager;for(var r in this.manager=new i(e,{touchAction:n.touchAction,recognizers:n.recognizers||Q}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(J).forEach(function(e){var n=t.manager.get(e);n&&J[e].forEach(function(e){n.recognizeWith(e)})}),n.recognizerOptions){var a=this.manager.get(r);if(a){var o=n.recognizerOptions[r];delete o.enable,a.set(o)}}this.wheelInput=new ce(e,this._onOtherEvent,{enable:!1}),this.moveInput=new he(e,this._onOtherEvent,{enable:!1}),this.keyInput=new de(e,this._onOtherEvent,{enable:!1}),this.contextmenuInput=new ve(e,this._onOtherEvent,{enable:!1});var s=!0,u=!1,c=void 0;try{for(var l,h=this.events[Symbol.iterator]();!(s=(l=h.next()).done);s=!0){var f=Object(B.a)(l.value,2),d=f[0],v=f[1];v.isEmpty()||(this._toggleRecognizer(v.recognizerName,!0),this.manager.on(d,v.handleEvent))}}catch(e){u=!0,c=e}finally{try{s||null==h.return||h.return()}finally{if(u)throw c}}}}},{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,t,n){if("string"==typeof e)this._addEventHandler(e,t,n);else for(var i in n=t,e)this._addEventHandler(i,e[i],n)}},{key:"off",value:function(e,t){if("string"==typeof e)this._removeEventHandler(e,t);else for(var n in e)this._removeEventHandler(n,e[n])}},{key:"_toggleRecognizer",value:function(e,t){var n=this.manager;if(n){var i=n.get(e);if(i&&i.options.enable!==t){i.set({enable:t});var r=$[e];r&&!this.options.recognizers&&r.forEach(function(r){var a=n.get(r);t?(a.requireFailure(e),i.dropRequireFailure(r)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}}},{key:"_addEventHandler",value:function(e,t,n){var i=this.manager,r=this.events,a=ae[e]||e,o=r.get(a);o||(o=new Ce(this),r.set(a,o),o.recognizerName=re[a]||a,i&&i.on(a,o.handleEvent)),this._toggleRecognizer(o.recognizerName,!0),o.add(e,t,n)}},{key:"_removeEventHandler",value:function(e,t){var n=this.events,i=ae[e]||e,r=n.get(i);if(r&&(r.remove(e,t),r.isEmpty())){var a=r.recognizerName,o=!1,s=!0,u=!1,c=void 0;try{for(var l,h=n.values()[Symbol.iterator]();!(s=(l=h.next()).done);s=!0){var f=l.value;if(f.recognizerName===a&&!f.isEmpty()){o=!0;break}}}catch(e){u=!0,c=e}finally{try{s||null==h.return||h.return()}finally{if(u)throw c}}o||this._toggleRecognizer(a,!1)}}},{key:"_onBasicInput",value:function(e){var t=e.srcEvent,n=ee[t.type];n&&this.manager.emit(n,e)}},{key:"_onOtherEvent",value:function(e){this.manager.emit(e.type,e)}}]),e}(),Ae=n(32);function Me(){}n.d(t,"a",function(){return Ie});var Le={id:"deckgl-overlay",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",_animate:!1,onWebGLInitialized:Me,onResize:Me,onViewStateChange:Me,onBeforeRender:Me,onAfterRender:Me,onLoad:Me,_onMetrics:null,getCursor:function(e){return e.isDragging?"grabbing":"grab"},debug:!1,drawPickingColors:!1},Ie=function(){function e(t){o()(this,e),t=Object.assign({},Le,t),this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=t.initialViewState||null,this.interactiveState={isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._pickAndCallback=this._pickAndCallback.bind(this),this._onRendererInitialized=this._onRendererInitialized.bind(this),this._onRenderFrame=this._onRenderFrame.bind(this),this._onViewStateChange=this._onViewStateChange.bind(this),this._onInteractiveStateChange=this._onInteractiveStateChange.bind(this),function(){if(void 0===("undefined"==typeof window?"undefined":r()(window)))return!1;return-1!==((window.navigator||{}).userAgent||"").indexOf("Trident/")}()&&v.a.warn("IE 11 support will be deprecated in v8.0")(),t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new z.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),this.animationLoop.start()}return u()(e,[{key:"finalize",value:function(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null),this.viewManager&&(this.viewManager.finalize(),this.viewManager=null),this.effectManager&&(this.effectManager.finalize(),this.effectManager=null),this.deckRenderer&&(this.deckRenderer.finalize(),this.deckRenderer=null),this.eventManager&&this.eventManager.destroy(),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&v.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&v.a.removed("onLayerClick","onClick")(),e=Object.assign({},this.props,e),this.props=e,this._setCanvasSize(e);var t=Object.assign({},e,{views:this._getViews(this.props),width:this.width,height:this.height}),n=this._getViewState(e);n&&(t.viewState=n),this.viewManager&&this.viewManager.setProps(t),this.layerManager&&this.layerManager.setProps(t),this.effectManager&&this.effectManager.setProps(t),this.animationLoop&&this.animationLoop.setProps(t),this.deckRenderer&&this.deckRenderer.setProps(t),this.deckPicker&&this.deckPicker.setProps(t),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(this.props._animate)return"Deck._animate";var t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),r=this.effectManager.needsRedraw(e),a=this.deckRenderer.needsRedraw(e);return t=t||n||i||r||a}},{key:"redraw",value:function(e){if(this.layerManager){var t=e||this.needsRedraw({clearRedrawFlags:!0});t&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}}},{key:"getViews",value:function(){return this.viewManager.views}},{key:"getViewports",value:function(e){return this.viewManager.getViewports(e)}},{key:"pickObject",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObject Time").timeStart();var s=this.layerManager.getLayers({layerIds:o}),u=this.layerManager.activateViewport,c=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:s,viewports:this.getViewports({x:t,y:n}),activateViewport:u,mode:"query",depth:1}).result;return this.stats.get("pickObject Time").timeEnd(),c.length?c[0]:null}},{key:"pickMultipleObjects",value:function(e){var t=e.x,n=e.y,i=e.radius,r=void 0===i?0:i,a=e.layerIds,o=void 0===a?null:a,s=e.depth,u=void 0===s?10:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickMultipleObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:o}),l=this.layerManager.activateViewport,h=this.deckPicker.pickObject({x:t,y:n,radius:r,layers:c,viewports:this.getViewports({x:t,y:n}),activateViewport:l,mode:"query",depth:u}).result;return this.stats.get("pickMultipleObjects Time").timeEnd(),h}},{key:"pickObjects",value:function(e){var t=e.x,n=e.y,i=e.width,r=void 0===i?1:i,a=e.height,o=void 0===a?1:a,s=e.layerIds,u=void 0===s?null:s;this.stats.get("Pick Count").incrementCount(),this.stats.get("pickObjects Time").timeStart();var c=this.layerManager.getLayers({layerIds:u}),l=this.layerManager.activateViewport,h=this.deckPicker.pickObjects({x:t,y:n,width:r,height:o,layers:c,viewports:this.getViewports({x:t,y:n,width:r,height:o}),activateViewport:l});return this.stats.get("pickObjects Time").timeEnd(),h}},{key:"_createCanvas",value:function(e){var t=e.canvas;("string"==typeof t&&(t=document.getElementById(t),Object(l.a)(t)),t)||(t=document.createElement("canvas"),(e.parent||document.body).appendChild(t));var n=e.id,i=e.style;return t.id=n,Object.assign(t.style,i),t}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var t=e.width,n=e.height;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(n||0===n)&&(n=Number.isFinite(n)?"".concat(n,"px"):n,this.canvas.style.position="absolute",this.canvas.style.height=n)}}},{key:"_updateCanvasSize",value:function(){if(this._checkForCanvasSizeChange()){var e=this.width,t=this.height;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}},{key:"_checkForCanvasSizeChange",value:function(){var e=this.canvas;if(!e)return!1;var t=e.clientWidth||e.width,n=e.clientHeight||e.height;return(t!==this.width||n!==this.height)&&(this.width=t,this.height=n,!0)}},{key:"_createAnimationLoop",value:function(e){var t=this,n=e.width,i=e.height,r=e.gl,a=e.glOptions,o=e.debug,s=e.useDevicePixels,u=e.autoResizeDrawingBuffer;return new L.a({width:n,height:i,useDevicePixels:s,autoResizeDrawingBuffer:u,gl:r,onCreateContext:function(e){return Object(I.a)(Object.assign({},a,e,{canvas:t.canvas,debug:o}))},onInitialize:this._onRendererInitialized,onRender:this._onRenderFrame,onBeforeRender:e.onBeforeRender,onAfterRender:e.onAfterRender})}},{key:"_getViewState",value:function(e){return e.viewState||this.viewState}},{key:"_getViews",value:function(e){var t=e.views||[new m.a({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&e.controller&&(t[0].props.controller=e.controller),t}},{key:"_onPointerMove",value:function(e){var t=this._pickRequest;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;var n=e.offsetCenter;if(!n)return;t.x=n.x,t.y=n.y,t.radius=this.props.pickingRadius}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.callback=this.props.onHover,t.event=e,t.mode="hover"}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.mode){var t=this.deckPicker.pickObject(Object.assign({layers:this.layerManager.getLayers(),viewports:this.getViewports(e),activateViewport:this.layerManager.activateViewport,depth:1},e)),n=t.result,i=t.emptyInfo;if(e.callback){var r=n.find(function(e){return e.index>=0})||i;e.callback(r,e.event)}e.mode=null}}},{key:"_updateCursor",value:function(){this.canvas&&(this.canvas.style.cursor=this.props.getCursor(this.interactiveState))}},{key:"_updateAnimationProps",value:function(e){this.layerManager.context.animationProps=e}},{key:"_setGLContext",value:function(e){if(!this.layerManager){for(var t in this.canvas||(this.canvas=e.canvas,Object(R.a)(e,{enable:!0,copyState:!0})),Object(F.a)(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e),this.eventManager=new Te(e.canvas,{touchAction:this.props.touchAction,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Ae.b)this.eventManager.on(t,this._onEvent);this.viewManager=new g({eventManager:this.eventManager,onViewStateChange:this._onViewStateChange,onInteractiveStateChange:this._onInteractiveStateChange,views:this._getViews(this.props),viewState:this._getViewState(this.props),width:this.width,height:this.height}),Object(l.a)(this.viewManager);var n=this.viewManager.getViewports()[0],i=new N.a;i.play(),this.animationLoop.attachTimeline(i),this.layerManager=new c.a(e,{deck:this,stats:this.stats,viewport:n,timeline:i}),this.effectManager=new _,this.deckRenderer=new w.a(e),this.deckPicker=new A(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,t){var n=this.layerManager.context.gl;Object(F.a)(n,this.props.parameters),this.props.onBeforeRender({gl:n});var i=this.layerManager.getLayers(),r=this.layerManager.activateViewport;this.deckRenderer.renderLayers(Object.assign({layers:i,viewports:this.viewManager.getViewports(),activateViewport:r,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:n})}},{key:"_onRendererInitialized",value:function(e){var t=e.gl;this._setGLContext(t)}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),v.a.table(3,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(e),this._updateAnimationProps(e),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates(e)}},{key:"_onViewStateChange",value:function(e){var t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState[e.viewId]=t,this.viewManager.setProps({viewState:t}))}},{key:"_onInteractiveStateChange",value:function(e){var t=e.isDragging,n=void 0!==t&&t;n!==this.interactiveState.isDragging&&(this.interactiveState.isDragging=n)}},{key:"_onEvent",value:function(e){var t=Ae.b[e.type],n=e.offsetCenter;if(t&&n){var i=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:n.x,y:n.y,layers:i,viewports:this.getViewports(n)},this._lastPointerDownInfo),a=r.layer,o=a&&(a[t.handler]||a.props[t.handler]),s=this.props[t.handler],u=!1;o&&(u=o.call(a,r,e)),!u&&s&&s(r,e)}}},{key:"_onPointerDown",value:function(e){var t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}},{key:"_getFrameStats",value:function(){var e=this.stats;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();var t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var e=this.metrics,t=this.stats;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();var n=D.a.get("Memory Usage");e.bufferMemory=n.get("Buffer Memory").count,e.textureMemory=n.get("Texture Memory").count,e.renderbufferMemory=n.get("Renderbuffer Memory").count,e.gpuMemory=n.get("GPU Memory").count}}]),e}();Ie.getPropTypes=function(e){return{id:e.string,width:e.oneOfType([e.number,e.string]),height:e.oneOfType([e.number,e.string]),layers:e.oneOfType([e.object,e.array]),layerFilter:e.func,views:e.oneOfType([e.object,e.array]),viewState:e.object,effects:e.arrayOf(e.instanceOf(x.a)),controller:e.oneOfType([e.func,e.bool,e.object]),gl:e.object,glOptions:e.object,parameters:e.object,pickingRadius:e.number,useDevicePixels:e.bool,touchAction:e.string,onWebGLInitialized:e.func,onResize:e.func,onViewStateChange:e.func,onBeforeRender:e.func,onAfterRender:e.func,onLoad:e.func,debug:e.bool,drawPickingColors:e.bool,_animate:e.bool}},Ie.defaultProps=Le,Ie.VERSION=M.a.VERSION},function(e,t,n){"use strict";var i=n(119),r=n(124),a=["png","jpg","jpeg","gif","webp","bmp","ico","svg"],o=(r.a&&r.d,!r.a&&r.b,r.e,{extensions:a,loadAndParse:r.c}),s=n(109),u=n(15);var c={name:"JSON",extensions:["json","geojson"],testText:function(e){var t=e[0],n=e[e.length-1];return"{"===t&&"}"===n||"["===t&&"]"===n},parseTextSync:JSON.parse},l=n(199),h="7.3.0-alpha.4";if(s.a.deck&&s.a.deck.VERSION!==h)throw new Error("deck.gl - multiple versions detected: ".concat(s.a.deck.VERSION," vs ").concat(h));s.a.deck||(u.a.log(0,"deck.gl ".concat(h," - ").concat("set deck.log.priority=1 (or higher) to trace attribute updates"))(),s.a.deck=s.a.deck||{VERSION:h,version:h,log:u.a},Object(i.b)([c,o]),Object(l.a)());t.a=s.a.deck},function(e,t,n){"use strict";var i=n(110),r=n(134),a=n(209),o=n(192),s=n(210),u={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n} geometry;\n",fs:"\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n"},c=n(85),l={name:"project32",dependencies:[c.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64xyLow);\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec2 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64xyLow, offset, commonPosition);\n}\n"};function h(){Object(i.c)([a.a,c.a,l,o.a,o.b,s.a]),Object(i.e)([u,c.a]),Object(r.c)("vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)"),Object(r.c)("vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)"),Object(r.c)("fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"),Object(r.b)("picking",{hook:"fs:DECKGL_FILTER_COLOR",order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n"})}n.d(t,"a",function(){return h})},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(10),o=n(33),s=n(9),u=n(47),c=n(11),l=n(53),h=n(57),f=n(63),d=n(76),v=n(64),p=n(60),g=n(30),m=n(75),y=function(){function e(t){Object(i.a)(this,e),this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}return Object(r.a)(e,[{key:"getAttributeInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var t=this.getAttributeInfo(e);return t?t.location:-1}},{key:"getAttributeAccessor",value:function(e){var t=this.getAttributeInfo(e);return t?t.accessor:null}},{key:"getVaryingInfo",value:function(e){var t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var t=this.getVaryingInfo();return t?t.location:-1}},{key:"getVaryingAccessor",value:function(e){var t=this.getVaryingInfo();return t?t.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var t=e.gl,n=t.getProgramParameter(e.handle,35721),i=0;i=0&&this._addAttribute(u,a,o,s)}this.attributeInfos.sort(function(e,t){return e.location-t.location})}},{key:"_readVaryingsFromProgram",value:function(e){var t=e.gl;if(Object(g.d)(t)){for(var n=t.getProgramParameter(e.handle,35971),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(s.a)(t).call(this,e,r))).stubRemovedMethods("Program","v6.0",P),n._isCached=!1,n.initialize(r),Object.seal(Object(o.a)(n)),n._setId(r.id),n}return Object(c.a)(t,e),Object(r.a)(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hash,n=e.vs,i=e.fs,r=e.varyings,a=e.bufferMode,o=void 0===a?35981:a;return this.hash=t||"",this.vs="string"==typeof n?new v.c(this.gl,{id:"".concat(e.id,"-vs"),source:n}):n,this.fs="string"==typeof i?new v.a(this.gl,{id:"".concat(e.id,"-fs"),source:i}):i,Object(x.a)(this.vs instanceof v.c),Object(x.a)(this.fs instanceof v.a),this.uniforms={},r&&r.length>0&&(Object(g.a)(this.gl),this.varyings=r,this.gl.transformFeedbackVaryings(this.handle,r,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new y(this),this.setProps(e)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this,e)}},{key:"setProps",value:function(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}},{key:"draw",value:function(e){var t=this,n=e.logPriority,i=e.drawMode,r=void 0===i?4:i,a=e.vertexCount,o=e.offset,s=void 0===o?0:o,u=e.start,c=e.end,l=e.isIndexed,h=void 0!==l&&l,f=e.indexType,d=void 0===f?5123:f,v=e.isInstanced,p=void 0!==v&&v,y=e.instanceCount,O=void 0===y?0:y,P=e.vertexArray,S=void 0===P?null:P,j=e.transformFeedback,k=e.framebuffer,C=e.parameters,E=void 0===C?{}:C,T=e.uniforms,A=e.samplers;if((T||A)&&(w.a.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(T||{})),void 0!==n){var M=k?k.id:"default",L="mode=".concat(Object(_.a)(this.gl,r)," verts=").concat(a," ")+"instances=".concat(O," indexType=").concat(Object(_.a)(this.gl,d)," ")+"isInstanced=".concat(p," isIndexed=").concat(h," ")+"Framebuffer=".concat(M);w.a.log(n,L)()}return Object(x.a)(S),this.gl.useProgram(this.handle),!!this._areTexturesRenderable()&&(S.bindForDraw(a,O,function(){if(void 0!==k&&(E=Object.assign({},E,{framebuffer:k})),j){var e=Object(m.c)(r);j.begin(e)}t._bindTextures(),Object(b.a)(t.gl,E,function(){h&&p?t.gl.drawElementsInstanced(r,a,d,s,O):h&&Object(g.d)(t.gl)&&!isNaN(u)&&!isNaN(c)?t.gl.drawRangeElements(r,u,c,a,d,s):h?t.gl.drawElements(r,a,d,s):p?t.gl.drawArraysInstanced(r,s,a,O):t.gl.drawArrays(r,s,a)}),j&&j.end()}),!0)}},{key:"setUniforms",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=!1,i={};for(var r in e)Object(d.a)(this.uniforms[r],e[r])||(n=!0,i[r]=e[r],this.uniforms[r]=Object(d.c)(e[r]));return n&&(t(),Object(d.b)(i,this.id,this._uniformSetters),this._setUniforms(i)),this}},{key:"reset",value:function(){}},{key:"_areTexturesRenderable",value:function(){var e=!0;for(var t in this.uniforms){var n=this._uniformSetters[t];if(n&&void 0!==n.textureIndex){var i=this.uniforms[t];if(i instanceof f.a)i=i.texture;if(i instanceof h.a)e=e&&i.loaded}}return e}},{key:"_bindTextures",value:function(){for(var e in this.uniforms){var t=this._uniformSetters[e];if(t&&void 0!==t.textureIndex){var n=this.uniforms[e];if(n instanceof f.a&&(n=n.texture),n instanceof h.a)n.bind(t.textureIndex)}}}},{key:"_setUniforms",value:function(e){for(var t in this.gl.useProgram(this.handle),e){var n=e[t],i=this._uniformSetters[t];if(i)if(n instanceof f.a&&(n=n.texture),n instanceof h.a){void 0===i.textureIndex&&(i.textureIndex=this._textureIndexCounter++);var r=n,a=i.textureIndex;r.bind(a),i(a)}else i(n)}return this}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(e){var t=this.gl.getAttachedShaders(e),n={},i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new v.c({handle:u});break;case 35632:n.fs=new v.a({handle:u})}}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}},{key:"_getParameter",value:function(e){return this.gl.getProgramParameter(this.handle,e)}},{key:"_setId",value:function(e){if(!e){var t=this._getName();this.id=Object(O.c)(t)}}},{key:"_getName",value:function(){var e=this.vs.getName()||this.fs.getName();return e=(e=e.replace(/shader/i,""))?"".concat(e,"-program"):"program"}},{key:"_compileAndLink",value:function(){var e=this.gl;if((e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),w.a.time(4,"linkProgram for ".concat(this._getName()))(),e.linkProgram(this.handle),w.a.timeEnd(4,"linkProgram for ".concat(this._getName()))(),e.debug||w.a.priority>0)&&(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35714)))throw new Error("Error linking: ".concat(e.getProgramInfoLog(this.handle)))}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var e=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var t=0;t1)for(var s=0;s0&&w[1]>0);var O=w[0]/x[0],P=w[1]/x[1],S=(u.right-u.left)/2/O,j=(u.bottom-u.top)/2/P,k=[(_[0]+b[0])/2+S,(_[1]+b[1])/2+j],C=y.unproject(k),E=y.zoom+Math.log2(Math.abs(Math.min(O,P)));return{longitude:C[0],latitude:C[1],zoom:E}}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(23),r=n(4),a=n(5),o=n(22),s=n(29),u=n(40),c=6371e3,l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.phi,i=t.theta,a=t.radius,o=t.bearing,s=t.pitch,u=(t.altitude,t.radiusScale),l=void 0===u?c:u;Object(r.a)(this,e),0===arguments.length?(this.phi=0,this.theta=0,this.radius=1):Number.isFinite(n)||Number.isFinite(i)?(this.phi=n||0,this.theta=i||0):(Number.isFinite(o)||Number.isFinite(s))&&(this.bearing=o||0,this.pitch=s||0),this.radius=a||1,this.radiusScale=l||1,this.check()}return Object(a.a)(e,[{key:"toString",value:function(){return this.formatString(o.c)}},{key:"formatString",value:function(e){var t=e.printTypes,n=(e.printDegrees,o.f);return"".concat(t?"Spherical":"","[rho:").concat(n(this.radius),",theta:").concat(n(this.theta),",phi:").concat(n(this.phi),"]")}},{key:"equals",value:function(e){return Object(o.e)(this.radius,e.radius)&&Object(o.e)(this.theta,e.theta)&&Object(o.e)(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}},{key:"clone",value:function(){return(new this.constructor).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 t=Object(i.a)(e,3),n=t[0],r=t[1],a=t[2];this.radius=1+a/this.radiusScale,this.phi=Object(o.h)(r),this.theta=Object(o.h)(n)}},{key:"fromVector3",value:function(e){return this.radius=u.g(e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(o.b)(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new s.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi))}},{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}},{key:"bearing",get:function(){return 180-Object(o.d)(this.phi)},set:function(e){this.phi=Math.PI-Object(o.h)(e)}},{key:"pitch",get:function(){return Object(o.d)(this.theta)},set:function(e){this.theta=Object(o.h)(e)}},{key:"longitude",get:function(){return Object(o.d)(this.phi)}},{key:"latitude",get:function(){return Object(o.d)(this.theta)}},{key:"lng",get:function(){return Object(o.d)(this.phi)}},{key:"lat",get:function(){return Object(o.d)(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}}]),e}()},,function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(4),r=n(10),a=n(9),o=n(33),s=n(5),u=n(11),c=n(53),l=n(43),h=n(30),f=n(70),d=n(25),v=function(e){function t(e){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),Object(h.a)(e),(n=Object(r.a)(this,Object(a.a)(t).call(this,e,s))).initialize(s),n.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(Object(o.a)(n)),n}return Object(u.a)(t,e),Object(s.a)(t,null,[{key:"isSupported",value:function(e){return Object(h.d)(e)}}]),Object(s.a)(t,[{key:"initialize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(f.a)(this.buffers)||this.bind(function(){return e._unbindBuffers()}),this.setProps(t),this}},{key:"setProps",value:function(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}},{key:"setBuffers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(function(){for(var n in t)e.setBuffer(n,t[n])}),this}},{key:"setBuffer",value:function(e,t){var n=this,i=this._getVaryingIndex(e),r=this._getBufferParams(t),a=r.buffer,o=r.byteSize,s=r.byteOffset;return i<0?(this.unused[e]=a,d.a.warn(function(){return"".concat(n.id," unused varying buffer ").concat(e)})(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,a,s,o),this)}},{key:"begin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(e){var t,n,i;return e instanceof l.a==!1?(i=e.buffer,n=e.byteSize,t=e.byteOffset):i=e,void 0===t&&void 0===n||(t=t||0,n=n||i.byteLength-t),{buffer:i,byteOffset:t,byteSize:n}}},{key:"_getVaryingInfo",value:function(e){return this.configuration&&this.configuration.getVaryingInfo(e)}},{key:"_getVaryingIndex",value:function(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;var t=Number(e);return Number.isFinite(t)?t:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers){var t=this._getBufferParams(this.buffers[e]),n=t.buffer,i=t.byteSize,r=t.byteOffset;this._bindBuffer(e,n,r,i)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var e in this.buffers)this._bindBuffer(e,null)}},{key:"_bindBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=t&&t.handle;return r&&void 0!==i?this.gl.bindBufferRange(35982,e,r,n,i):this.gl.bindBufferBase(35982,e,r),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(e){this.gl.bindTransformFeedback(36386,this.handle)}}]),t}(c.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(4),r=n(5),a=n(60),o=n(43),s=n(107),u=n(238),c=n(25),l=n(19),h=/^(.+)__LOCATION_([0-9]+)$/,f=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e);var r=n.id||n.program&&n.program.id;this.id=r,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=s.a.isSupported(t)?new s.a(t):s.a.getDefaultArray(t),Object(u.a)(this,"VertexArray","v6.0",f),this.initialize(n),Object.seal(this)}return Object(r.a)(e,[{key:"delete",value:function(){this.buffer&&this.buffer.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[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(e){return this.drawParams=this.drawParams||this._updateDrawParams(),Object.assign({},this.drawParams,e)}},{key:"setAttributes",value:function(e){var t=this;return Object.assign(this.attributes,e),this.vertexArrayObject.bind(function(){for(var n in e){var i=e[n];t._setAttribute(n,i)}t.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setElementBuffer(e,t),this}},{key:"setBuffer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===t.target)return this.setElementBuffer(t,n);var i=this._resolveLocationAndAccessor(e,t,t.accessor,n),r=i.location,a=i.accessor;return r>=0&&(this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.setBuffer(r,t,a)),this}},{key:"setConstant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n)),r=i.location,a=i.accessor;return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t,a),this.values[r]=t,this.accessors[r]=a,this.clearDrawParams(),this.vertexArrayObject.isDefaultArray||this.vertexArrayObject.enable(r,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(null),e.buffer=e.buffer||new o.a(e.gl,{accessor:{size:4}});for(var t=0;t0;if(e.isInstanced=e.isInstanced||r,n instanceof o.a){var a=n;if(r){var s=a.getVertexCount(i);e.instanceCount=Math.min(e.instanceCount,s)}else{var u=a.getVertexCount(i);e.vertexCount=Math.min(e.vertexCount,u)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c.a.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(35),r=n(51),a=n.n(r),o=n(117),s=n(4),u=n(5),c=n(90),l=n(108),h=n(127),f=n(178),d=n(137),v=n(30),p=n(69),g=n(63),m=n(25),y=n(19),b=0,_=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e);var n=t.onCreateContext,i=void 0===n?function(e){return Object(c.a)(e)}:n,r=t.onAddHTML,a=void 0===r?null:r,o=t.onInitialize,u=void 0===o?function(){}:o,h=t.onRender,f=void 0===h?function(){}:h,d=t.onFinalize,v=void 0===d?function(){}:d,p=t.gl,g=void 0===p?null:p,y=t.glOptions,_=void 0===y?{}:y,x=t.debug,w=void 0!==x&&x,O=t.createFramebuffer,P=void 0!==O&&O,S=t.autoResizeViewport,j=void 0===S||S,k=t.autoResizeDrawingBuffer,C=void 0===k||k,E=t.stats,T=void 0===E?l.a.get("animation-loop-".concat(b++)):E,A=t.useDevicePixels,M=void 0===A||A;"useDevicePixelRatio"in t&&(m.a.deprecated("useDevicePixelRatio","useDevicePixels")(),M=t.useDevicePixelRatio),this.props={onCreateContext:i,onAddHTML:a,onInitialize:u,onRender:f,onFinalize:v,gl:g,glOptions:_,debug:w,createFramebuffer:P},this.gl=g,this.needsRedraw=null,this.timeline=null,this.stats=T,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:j,autoResizeDrawingBuffer:C,useDevicePixels:M}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return Object(u.a)(e,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return Object(y.a)("string"==typeof e),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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._running?this:(this._running=!0,Object(h.b)().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(t),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=f.a.isSupported(e.gl,["timers"])?new f.a(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(t){e._running&&(e._addCallbackData(t||{}),!1!==t&&e._startLoop())}),this)}},{key:"redraw",value:function(){return 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(),Object(d.a)(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(t){e._resolveNextFrame=t})),this._nextFramePromise}},{key:"toDataURL",value:function(){var e=Object(o.a)(a.a.mark(function e(){return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setNeedsRedraw("toDataURL"),e.next=3,this.waitForRender();case 3:return e.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(e);return n?Number(n.value):t}},{key:"setViewParameters",value:function(){return m.a.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this;Object(d.a)(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(function t(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(t))})}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_requestAnimationFrame",value:function(e){this.display&&this.display.requestAnimationFrame(e)||Object(d.b)(e)}},{key:"_renderFrame",value:function(){var e;this.display?(e=this.display)._renderFrame.apply(e,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._onSetupFrame?this._onSetupFrame(this.animationProps):(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(),t=e.width,n=e.height,i=e.aspect;t===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=n,this.animationProps.aspect=i,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){"object"===Object(i.a)(e)&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?Object(c.c)(this.props.gl,e):this.onCreateContext(e),!Object(v.c)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(p.d)(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 t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);var n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight,n=1,i=this.gl.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&Object(c.d)(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new g.a(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()&&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}}]),e}()},function(e,t,n){"use strict";t.a={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}},function(e,t,n){"use strict";var i={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};t.a={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n\n if (selected) {\n vec4 highLightColor = picking_uHighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n if (picking_uActive && length(pickingColor) < 0.001) {\n discard;\n }\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t={};if(void 0!==e.pickingSelectedColor)if(null===e.pickingSelectedColor)t.picking_uSelectedColorValid=0;else{var n=[e.pickingSelectedColor[0],e.pickingSelectedColor[1],e.pickingSelectedColor[2]];t.picking_uSelectedColorValid=1,t.picking_uSelectedColor=n}return void 0!==e.pickingHighlightColor&&(t.picking_uHighlightColor=e.pickingHighlightColor),void 0!==e.pickingThreshold&&(t.picking_uThreshold=e.pickingThreshold),void 0!==e.pickingActive&&(t.picking_uActive=e.pickingActive?1:0),t}}},function(e,t,n){"use strict";t.a={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(0),r=n(43),a=n(71),o=n(75),s=n(190);function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertexArray,n=e.header,i=void 0===n?"Attributes":n;if(!t.configuration)return{};var r={};t.elements&&(r.ELEMENT_ARRAY_BUFFER=c(t,t.elements,null,i));var a=t.values;for(var o in a){var s=t._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),h=t.accessors[s.location];h&&(u="".concat(o,": ").concat(l(s.name,h))),r[u]=c(t,a[o],h,i)}}return r}function c(e,t,n,o){var u,c,l=e.gl;if(!t)return c={},Object(i.a)(c,o,"null"),Object(i.a)(c,"Format ","N/A"),c;var h,f,d,v="NOT PROVIDED",p="N/A",g="N/A",m="N/A";if(n&&(v=n.type,p=n.size,h=-1!==(v=String(v).replace("Array","")).indexOf("nt")),t instanceof r.a){var y,b,_=t,x=_.getDebugData(),w=x.data;if(f=x.modified?"*":"",d=w,g=(m=_.byteLength)/w.BYTES_PER_ELEMENT/p,n){var O=n.divisor>0;b="".concat(O?"I ":"P "," ").concat(g," (x").concat(p,"=").concat(m," bytes ").concat(Object(a.a)(l,v),")")}else h=!0,b="".concat(m," bytes");return y={},Object(i.a)(y,o,"".concat(f).concat(Object(s.a)(d,{size:p,isInteger:h}))),Object(i.a)(y,"Format ",b),y}return d=t,p=t.length,h=-1!==(v=String(t.constructor.name).replace("Array","")).indexOf("nt"),u={},Object(i.a)(u,o,"".concat(Object(s.a)(d,{size:p,isInteger:h})," (constant)")),Object(i.a)(u,"Format ","".concat(p,"x").concat(v," (constant)")),u}function l(e,t){var n=t.type,i=t.size,r=Object(o.b)(n,i);return r?"".concat(e," (").concat(r.name,")"):e}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(0),r=n(19),a=n(190);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.header,n=void 0===t?"Uniforms":t,o=e.program,u=e.uniforms,c=e.undefinedOnly,l=void 0!==c&&c;Object(r.a)(o);var h=o._uniformSetters,f={},d=Object.keys(h).sort(),v=0,p=!0,g=!1,m=void 0;try{for(var y,b=d[Symbol.iterator]();!(p=(y=b.next()).done);p=!0){var _=y.value;_.match(".*_.*")||_.match(".*Matrix")||s({table:f,header:n,uniforms:u,uniformName:_,undefinedOnly:l})&&v++}}catch(e){g=!0,m=e}finally{try{p||null==b.return||b.return()}finally{if(g)throw m}}var x=!0,w=!1,O=void 0;try{for(var P,S=d[Symbol.iterator]();!(x=(P=S.next()).done);x=!0){var j=P.value;j.match(".*Matrix")&&s({table:f,header:n,uniforms:u,uniformName:j,undefinedOnly:l})&&v++}}catch(e){w=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(w)throw O}}var k=!0,C=!1,E=void 0;try{for(var T,A=d[Symbol.iterator]();!(k=(T=A.next()).done);k=!0){var M=T.value;f[M]||s({table:f,header:n,uniforms:u,uniformName:M,undefinedOnly:l})&&v++}}catch(e){C=!0,E=e}finally{try{k||null==A.return||A.return()}finally{if(C)throw E}}var L=0,I={};if(!l)for(var R in u){var F=u[R];f[R]||(L++,I[R]=Object(i.a)({Type:"NOT USED: ".concat(F)},n,Object(a.a)(F)))}return{table:f,count:v,unusedTable:I,unusedCount:L}}function s(e){var t,n=e.table,r=e.header,o=e.uniforms,s=e.uniformName,u=e.undefinedOnly,c=o[s],l=function(e){return null!=e}(c);return(!u||!l)&&(n[s]=(t={},Object(i.a)(t,r,l?Object(a.a)(c):"N/A"),Object(i.a)(t,"Uniform Type",l?c:"NOT PROVIDED"),t),!0)}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n(0),r=n(75);function a(e){var t={},n="Accessors for ".concat(e.id),r=!0,a=!1,s=void 0;try{for(var u,c=e.attributeInfos[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var l=u.value;if(l){var h=o(l);t["in ".concat(h)]=Object(i.a)({},n,JSON.stringify(l.accessor))}}}catch(e){a=!0,s=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw s}}var f=!0,d=!1,v=void 0;try{for(var p,g=e.varyingInfos[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=p.value;if(m){var y=o(m);t["out ".concat(y)]=Object(i.a)({},n,JSON.stringify(m.accessor))}}}catch(e){d=!0,v=e}finally{try{f||null==g.return||g.return()}finally{if(d)throw v}}return t}function o(e){var t=e.accessor,n=t.type,i=t.size,a=Object(r.b)(n,i);return a?"".concat(a.name," ").concat(e.name):e.name}},function(e,t,n){"use strict";function i(e){var t=100,n=e.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var i=parseInt(n[1],10);Number.isFinite(i)&&(t=i)}return t}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n(26),r=n(4),a=n(5),o=n(10),s=n(9),u=n(47),c=n(11),l=n(68),h=n(25),f=n(91),d=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r.a)(this,t);var i=(n=Array.isArray(n)?{children:n}:n).children,a=void 0===i?[]:i;return h.a.assert(a.every(function(e){return e instanceof f.a}),"every child must an instance of ScenegraphNode"),(e=Object(o.a)(this,Object(s.a)(t).call(this,n))).children=a,e}return Object(c.a)(t,e),Object(a.a)(t,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}},{key:"delete",value:function(){this.children.forEach(function(e){return e.delete()}),this.removeAll(),Object(u.a)(Object(s.a)(t.prototype),"delete",this).call(this)}},{key:"traverse",value:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===n?new l.a:n,r=new l.a(i).multiplyRight(this.matrix),a=!0,o=!1,s=void 0;try{for(var u,c=this.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var h=u.value;h instanceof t?h.traverse(e,{worldMatrix:r}):e(h,{worldMatrix:r})}}catch(e){o=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}}},{key:"traverseReverse",value:function(e,t){return h.a.warn("traverseReverse is not reverse")(),this.traverse(e,t)}}]),t}(f.a)},function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n(4),r=n(5),a=n(10),o=n(9),s=n(47),u=n(11),c=n(92),l=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(this,t),(n=Object(a.a)(this,Object(o.a)(t).call(this,r))).onBeforeRender=null,n.AfterRender=null,e instanceof c.a?(n.model=e,n._setModelNodeProps(r)):n.model=new c.a(e,r),n.managedResources=r.managedResources||[],n}return Object(u.a)(t,e),Object(r.a)(t,[{key:"setProps",value:function(e){return Object(s.a)(Object(o.a)(t.prototype),"setProps",this).call(this,e),this._setModelNodeProps(e),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(function(e){return e.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var e;return(e=this.model).draw.apply(e,arguments)}},{key:"setUniforms",value:function(){var e;return(e=this.model).setUniforms.apply(e,arguments),this}},{key:"setAttributes",value:function(){var e;return(e=this.model).setAttributes.apply(e,arguments),this}},{key:"updateModuleSettings",value:function(){var e;return(e=this.model).updateModuleSettings.apply(e,arguments),this}},{key:"_setModelNodeProps",value:function(e){this.model.setProps(e)}}]),t}(n(91).a)},function(e,t,n){"use strict";n.d(t,"a",function(){return y});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(54),v=n(44),p=n(204),g=n(68),m=n(168);var y=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return f()(t,e),o()(t,[{key:"_getViewport",value:function(e){var t=e.viewState,n=t.modelMatrix,i=void 0===n?null:n,r=t.bearing,a=t.up,o=void 0===a?[0,0,1]:a,s=function(e){var t=e.bearing,n=e.pitch;return new p.a({bearing:t,pitch:n}).toVector3().normalize()}({bearing:r,pitch:89}),u=i?i.transformDirection(s):s,c=(new g.a).lookAt({eye:[0,0,0],center:u,up:o});return new v.a(Object.assign({},e,{zoom:null,viewMatrix:c}))}},{key:"controller",get:function(){return this._getControllerProps({type:m.a})}}]),t}(d.a);y.displayName="FirstPersonView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(1),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(54),v=n(44),p=n(68),g=n(131),m=Math.PI/180;function y(e){var t=e.height,n=e.fovy,i=e.orbitAxis,r=e.rotationX,a=e.rotationOrbit,o=(e.zoom,.5/Math.tan(n*m/2)),s="Z"===i?[0,0,1]:[0,1,0],u="Z"===i?[0,-o,0]:[0,0,o],c=(new p.a).lookAt({eye:u,up:s});c.rotateX(r*m),"Z"===i?c.rotateZ(a*m):c.rotateY(a*m);var l=1/(t||1);return c.scale([l,l,l]),c}var b=function(e){function t(e){o()(this,t);var n=e.id,i=e.x,r=e.y,a=e.width,s=e.height,c=e.fovy,h=void 0===c?50:c,f=e.near,d=e.far,v=e.orbitAxis,p=void 0===v?"Z":v,g=e.target,m=void 0===g?[0,0,0]:g,b=e.rotationX,_=void 0===b?0:b,x=e.rotationOrbit,w=void 0===x?0:x,O=e.zoom,P=void 0===O?0:O;return u()(this,l()(t).call(this,{id:n,viewMatrix:y({height:s,fovy:h,orbitAxis:p,rotationX:_,rotationOrbit:w,zoom:P}),fovy:h,near:f,far:d,x:i,y:r,position:m,width:a,height:s,zoom:P}))}return f()(t,e),t}(v.a),_=function(e){function t(e){return o()(this,t),u()(this,l()(t).call(this,Object.assign({},e,{type:b})))}return f()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.b,ViewportType:b})}}]),t}(d.a);_.displayName="OrbitView"},function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n(2),r=n.n(i),a=n(3),o=n.n(a),s=n(1),u=n.n(s),c=n(6),l=n.n(c),h=n(7),f=n.n(h),d=n(54),v=n(44),p=n(68),g=n(169),m=(new p.a).lookAt({eye:[0,0,1]});function y(e){var t=e.width,n=e.height,i=e.near,r=e.far;return t=t||1,n=n||1,(new p.a).ortho({left:-t/2,right:t/2,bottom:n/2,top:-n/2,near:i,far:r})}var b=function(e){function t(e){var n=e.id,i=e.x,r=e.y,a=e.width,o=e.height,s=e.near,c=void 0===s?.1:s,h=e.far,f=void 0===h?1e3:h,d=e.zoom,p=void 0===d?0:d,g=e.target,b=void 0===g?[0,0,0]:g;return u()(this,t),l()(void 0,new v.a({id:n,x:i,y:r,width:a,height:o,position:b,viewMatrix:m,projectionMatrix:y({width:a,height:o,near:c,far:f}),zoom:p}))}return f()(t,e),t}(v.a),_=function(e){function t(e){return u()(this,t),l()(this,o()(t).call(this,Object.assign({},e,{type:b})))}return f()(t,e),r()(t,[{key:"controller",get:function(){return this._getControllerProps({type:g.a,ViewportType:b})}}]),t}(d.a);_.displayName="OrthographicView"},function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(194),v=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return f()(t,e),o()(t,[{key:"getGeometry",value:function(e){return new d.a}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.elevationScale,r=n.extruded,a=n.offset,o=n.coverage,s=n.cellSize,u=n.angle;this.state.model.setUniforms(Object.assign({},t,{radius:s/2,angle:u,offset:a,extruded:r,coverage:o,elevationScale:i,edgeDistance:1,isWireframe:!1})).draw()}}]),t}(n(171).a);v.layerName="GridCellLayer",v.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",min:0,value:[1,1]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return w});var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(195),v=n(74),p=n(196),g=n(133),m=n(115),y=n(143),b=n(141),_=new d.a,x={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,lineDashJustified:!1,getPolygon:{type:"accessor",value:function(e){return e.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:_},w=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return f()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={paths:[]}}},{key:"updateState",value:function(e){var t=this,n=(e.oldProps,e.props,e.changeFlags),i=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(i&&Array.isArray(n.dataChanged)){var r=this.state.paths.slice(),a=n.dataChanged.map(function(e){return Object(b.a)({data:r,getIndex:function(e){return e.__source.index},dataRange:e,replace:t._getPaths(e)})});this.setState({paths:r,pathsDiff:a})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.props,n=t.data,i=t.getPolygon,r=[],a="XY"===t.positionFormat?2:3,o=e.startRow,s=e.endRow,u=Object(v.a)(n,o,s),c=u.iterable,l=u.objectInfo,h=!0,f=!1,d=void 0;try{for(var p,g=c[Symbol.iterator]();!(h=(p=g.next()).done);h=!0){var m=p.value;l.index++;var b=y.c(i(m,l),a),_=b.positions,x=b.holeIndices;if(x)for(var w=0;w<=x.length;w++){var O=_.subarray(x[w-1]||0,x[w]||_.length);r.push(this.getSubLayerRow({path:O},m,l.index))}else r.push(this.getSubLayerRow({path:_},m,l.index))}}catch(e){f=!0,d=e}finally{try{h||null==g.return||g.return()}finally{if(f)throw d}}return r}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e._dataDiff,i=e.stroked,r=e.filled,a=e.extruded,o=e.wireframe,s=e.elevationScale,u=e.transitions,c=e.positionFormat,l=this.props,h=l.lineWidthUnits,f=l.lineWidthScale,d=l.lineWidthMinPixels,v=l.lineWidthMaxPixels,p=l.lineJointRounded,y=l.lineMiterLimit,b=l.lineDashJustified,_=this.props,x=_.getFillColor,w=_.getLineColor,O=_.getLineWidth,P=_.getLineDashArray,S=_.getElevation,j=_.getPolygon,k=_.updateTriggers,C=_.material,E=this.state,T=E.paths,A=E.pathsDiff,M=this.getSubLayerClass("fill",g.a),L=this.getSubLayerClass("stroke",m.a),I=this.shouldRenderSubLayer("fill",T)&&new M({_dataDiff:n,extruded:a,elevationScale:s,filled:r,wireframe:o,getElevation:S,getFillColor:x,getLineColor:w,material:C,transitions:u},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:k.getPolygon,getElevation:k.getElevation,getFillColor:k.getFillColor,getLineColor:k.getLineColor}}),{data:t,positionFormat:c,getPolygon:j});return[!a&&I,!a&&i&&this.shouldRenderSubLayer("stroke",T)&&new L({_dataDiff:A&&function(){return A},widthUnits:h,widthScale:f,widthMinPixels:d,widthMaxPixels:v,rounded:p,miterLimit:y,dashJustified:b,transitions:u&&{getWidth:u.getLineWidth,getColor:u.getLineColor,getPath:u.getPolygon},getColor:this.getSubLayerAccessor(w),getWidth:this.getSubLayerAccessor(O),getDashArray:this.getSubLayerAccessor(P)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:k.getLineWidth,getColor:k.getLineColor,getDashArray:k.getLineDashArray}}),{data:T,positionFormat:c,getPath:function(e){return e.path}}),a&&I]}}]),t}(p.a);w.layerName="PolygonLayer",w.defaultProps=x},function(e,t,n){"use strict";var i="uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n",r={name:"project2",vs:i,fs:i},a=n(116);t.a={name:"pbr",vs:"varying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if (__VERSION__ < 300)\n#extension GL_EXT_shader_texture_lod: enable\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLodEXT(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n vec3 color = vec3(0, 0, 0);\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[r,a.a]}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.fround(e),r=e-i;return t[n]=i,t[n+1]=r,t}var r="uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",a="".concat(r,"\n").concat("const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12);\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14);\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\nvec2 exp_fp64(vec2 a) {\n\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n\n\n\n\n\n s = sum_fp64(s, t);\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n\n\n\n\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"),o={ONE:1};t.a={name:"fp64",vs:a,fs:null,fp64ify:i,fp64LowPart:function(e){return e-Math.fround(e)},fp64ifyMatrix4:function(e){for(var t=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var a=4*n+r;i(e[4*r+n],t,2*a)}return t},getUniforms:function(){return Object.assign({},o)}},"".concat(r)},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(13),f=n.n(h),d=n(7),v=n.n(d),p=n(74),g=n(132),m=n(92),y=n(59);n.d(t,"a",function(){return x});var b=[0,0,0,255],_={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getSourceColor:{type:"accessor",value:b},getTargetColor:{type:"accessor",value:b},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},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},getStrokeWidth:{deprecatedFor:"getWidth"}},x=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return f()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertexHeight = sqrt(max(0.0, paraboloid(source, target, segmentRatio))) * instanceHeights;\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target - source);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * vertexHeight * sin(tiltAngle);\n\n return vec3(\n mix(source, target, segmentRatio) + tilt,\n vertexHeight * cos(tiltAngle)\n );\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n vec2 source = project_position(geometry.worldPosition, instancePositions64xyLow.xy).xy;\n vec2 target = project_position(geometry.worldPositionAlt, instancePositions64xyLow.zw).xy;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n\n vec3 currPos = getPos(source, target, segmentRatio);\n vec3 nextPos = getPos(source, target, nextSegmentRatio);\n vec4 curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n vec4 next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:4,type:this.use64bitPositions()?5130:5126,transition:!0,accessor:["getSourcePosition","getTargetPosition"],update:this.calculateInstancePositions},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:b},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:b},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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(f()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){for(var t=[],n=0;n<50;n++)t=t.concat([n,-1,0,n,1,0]);var i=new m.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new y.a({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0,shaderCache:this.context.shaderCache}));return i.setUniforms({numSegments:50}),i}},{key:"calculateInstancePositions",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getSourcePosition,s=r.getTargetPosition,u=e.value,c=n*e.size,l=Object(p.a)(a,n,i),h=l.iterable,f=l.objectInfo,d=!0,v=!1,g=void 0;try{for(var m,y=h[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var b=m.value;f.index++;var _=o(b,f);u[c++]=_[0],u[c++]=_[1];var x=s(b,f);u[c++]=x[0],u[c++]=x[1]}}catch(e){v=!0,g=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw g}}}}]),t}(g.a);x.layerName="ArcLayer",x.defaultProps=_},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(13),f=n.n(h),d=n(7),v=n.n(d),p=n(132),g=n(92),m=n(59);n.d(t,"a",function(){return b});var y={getSourcePosition:{type:"accessor",value:function(e){return e.sourcePosition}},getTargetPosition:{type:"accessor",value:function(e){return e.targetPosition}},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0},getStrokeWidth:{deprecatedFor:"getWidth"}},b=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return f()(l()(t.prototype),"getShaders",this).call(this,{vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec2 instanceSourcePositions64xyLow;\nattribute vec2 instanceTargetPositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(instanceSourcePositions, instanceSourcePositions64xyLow, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(instanceTargetPositions, instanceTargetPositions64xyLow, vec3(0.), target_commonspace);\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:["project32","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:this.use64bitPositions()?5130:5126,transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:this.use64bitPositions()?5130:5126,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(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(f()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),r.extensionsChanged){var a=this.context.gl;this.state.model&&this.state.model.delete(),this.setState({model:this._getModel(a)}),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.viewport,i=this.props,r=i.widthUnits,a=i.widthScale,o=i.widthMinPixels,s=i.widthMaxPixels,u="pixels"===r?n.distanceScales.metersPerPixel[2]:1;this.state.model.setUniforms(Object.assign({},t,{widthScale:a*u,widthMinPixels:o,widthMaxPixels:s})).draw()}},{key:"_getModel",value:function(e){return new g.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new m.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}}]),t}(p.a);b.layerName="LineLayer",b.defaultProps=y},function(e,t,n){"use strict";var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(7),f=n.n(h),d=n(196),v=n(172),p=n(115),g=n(195),m=n(133),y=n(141),b=n(15);function _(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},r=n.startRow,a=void 0===r?0:r,o=n.endRow,s=void 0===o?e.length:o,u=a;u0;)t=t[0];return t&&Number.isFinite(t[0])}(a,o))switch(a){case"Point":s.push(n({geometry:e},i,r));break;case"MultiPoint":o.forEach(function(e){s.push(n({geometry:{type:"Point",coordinates:e}},i,r))});break;case"LineString":u.push(n({geometry:e},i,r));break;case"MultiLineString":o.forEach(function(e){u.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"Polygon":c.push(n({geometry:e},i,r)),o.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))});break;case"MultiPolygon":o.forEach(function(e){c.push(n({geometry:{type:"Polygon",coordinates:e}},i,r)),e.forEach(function(e){l.push(n({geometry:{type:"LineString",coordinates:e}},i,r))})})}else b.a.warn("".concat(a," coordinates are malformed"))()}var w={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};n.d(t,"a",function(){return j});var O=new g.a,P={stroked:!0,filled:!0,extruded:!1,wireframe:!1,lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,elevationScale:1,pointRadiusScale:1,pointRadiusMinPixels:0,pointRadiusMaxPixels:Number.MAX_SAFE_INTEGER,lineDashJustified:!1,getLineColor:{type:"accessor",value:[0,0,0,255]},getFillColor:{type:"accessor",value:[0,0,0,255]},getRadius:{type:"accessor",value:1},getLineWidth:{type:"accessor",value:1},getLineDashArray:{type:"accessor",value:[0,0]},getElevation:{type:"accessor",value:1e3},material:O};function S(e){return e.geometry.coordinates}var j=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return f()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={features:{}}}},{key:"updateState",value:function(e){var t=e.props,n=e.changeFlags;if(n.dataChanged){var i=function(e){if(Array.isArray(e))return e;switch(b.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return b.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(t.data),r=this.getSubLayerRow.bind(this);if(Array.isArray(n.dataChanged)){var a=this.state.features,o={},s={};for(var u in a)o[u]=a[u].slice(),s[u]=[];var c=!0,l=!1,h=void 0;try{for(var f,d=n.dataChanged[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var v=f.value,p=_(i,r,v);for(var g in a)s[g].push(Object(y.a)({data:o[g],getIndex:function(e){return e.__source.index},dataRange:v,replace:p[g]}))}}catch(e){l=!0,h=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw h}}this.setState({features:o,featuresDiff:s})}else this.setState({features:_(i,r),featuresDiff:{}})}}},{key:"renderLayers",value:function(){var e=this.state,t=e.features,n=e.featuresDiff,i=t.pointFeatures,r=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures,s=this.props,u=s.stroked,c=s.filled,l=s.extruded,h=s.wireframe,f=s.material,d=s.transitions,g=this.props,y=g.lineWidthUnits,b=g.lineWidthScale,_=g.lineWidthMinPixels,x=g.lineWidthMaxPixels,w=g.lineJointRounded,O=g.lineMiterLimit,P=g.pointRadiusScale,j=g.pointRadiusMinPixels,k=g.pointRadiusMaxPixels,C=g.elevationScale,E=g.lineDashJustified,T=this.props,A=T.getLineColor,M=T.getFillColor,L=T.getRadius,I=T.getLineWidth,R=T.getLineDashArray,F=T.getElevation,D=T.updateTriggers,N=this.getSubLayerClass("polygons-fill",m.a),z=this.getSubLayerClass("polygons-stroke",p.a),B=this.getSubLayerClass("line-strings",p.a),U=this.getSubLayerClass("points",v.a),V=this.shouldRenderSubLayer("polygons-fill",a)&&new N({_dataDiff:n.polygonFeatures&&function(){return n.polygonFeatures},extruded:l,elevationScale:C,filled:c,wireframe:h,material:f,getElevation:this.getSubLayerAccessor(F),getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(A),transitions:d&&{getPolygon:d.geometry,getElevation:d.getElevation,getFillColor:d.getFillColor,getLineColor:d.getLineColor}},this.getSubLayerProps({id:"polygons-fill",updateTriggers:{getElevation:D.getElevation,getFillColor:D.getFillColor,getLineColor:D.getLineColor}}),{data:a,getPolygon:S});return[!l&&V,!l&&u&&this.shouldRenderSubLayer("polygons-stroke",o)&&new z({_dataDiff:n.polygonOutlineFeatures&&function(){return n.polygonOutlineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(A),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"polygons-stroke",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:o,getPath:S}),this.shouldRenderSubLayer("linestrings",r)&&new B({_dataDiff:n.lineFeatures&&function(){return n.lineFeatures},widthUnits:y,widthScale:b,widthMinPixels:_,widthMaxPixels:x,rounded:w,miterLimit:O,dashJustified:E,getColor:this.getSubLayerAccessor(A),getWidth:this.getSubLayerAccessor(I),getDashArray:this.getSubLayerAccessor(R),transitions:d&&{getPath:d.geometry,getColor:d.getLineColor,getWidth:d.getLineWidth}},this.getSubLayerProps({id:"line-strings",updateTriggers:{getColor:D.getLineColor,getWidth:D.getLineWidth,getDashArray:D.getLineDashArray}}),{data:r,getPath:S}),this.shouldRenderSubLayer("points",i)&&new U({_dataDiff:n.pointFeatures&&function(){return n.pointFeatures},stroked:u,filled:c,radiusScale:P,radiusMinPixels:j,radiusMaxPixels:k,lineWidthUnits:y,lineWidthScale:b,lineWidthMinPixels:_,lineWidthMaxPixels:x,getFillColor:this.getSubLayerAccessor(M),getLineColor:this.getSubLayerAccessor(A),getRadius:this.getSubLayerAccessor(L),getLineWidth:this.getSubLayerAccessor(I),transitions:d&&{getPosition:d.geometry,getFillColor:d.getFillColor,getLineColor:d.getLineColor,getRadius:d.getRadius,getLineWidth:d.getLineWidth}},this.getSubLayerProps({id:"points",updateTriggers:{getFillColor:D.getFillColor,getLineColor:D.getLineColor,getRadius:D.getRadius,getLineWidth:D.getLineWidth}}),{data:i,getPosition:S}),l&&V]}}]),t}(d.a);j.layerName="GeoJsonLayer",j.defaultProps=P},function(e,t,n){"use strict";var i,r=n(4),a=n(5),o=n(0),s=n(149),u=n(125),c=n(211),l=n(30),h=n(43),f=n(81),d=n(128),v=n(160),p=n(206),g=n(63),m=n(215),y=n(19),b=n(25),_=n(70),x=n(92),w="transform_uSampler_",O="transform_uSize_",P="transform_position";function S(e){var t=e.vs,n=e.sourceTextureMap,i=e.targetTextureVarying,r=e.targetTexture,a=Object.keys(n).length,o=null,c={},l=t,h={};if(a>0||i){var f=l.split("\n"),d=f.slice();if(f.forEach(function(e,t,r){if(a>0){var l=function(e,t){var n={},i=function(e){return Object(u.c)(e,["attribute","in"])}(e);if(!i)return null;var r=i.type,a=i.name;if(a&&t[a]){var o="// ".concat(e," => Replaced by Transform with a sampler"),s=function(e){var t="".concat(w).concat(e),n="".concat(O).concat(e),i=" uniform sampler2D ".concat(t,";\n uniform vec2 ").concat(n,";");return{samplerName:t,sizeName:n,uniformDeclerations:i}}(a),c=s.samplerName,l=s.sizeName,h=s.uniformDeclerations,f=Object(u.e)(r),d=" ".concat(r," ").concat(a," = transform_getInput(").concat(c,", ").concat(l,").").concat(f,";\n");n[c]=a;var v={"vs:#decl":h,"vs:#main-start":d};return{updatedLine:o,inject:v,samplerTextureMap:n}}return null}(e,n);if(l){var f=l.updatedLine,v=l.inject;d[t]=f,h=Object(s.b)([h,v]),Object.assign(c,l.samplerTextureMap),a--}}i&&!o&&(o=function(e,t){var n=Object(u.c)(e,["varying","out"]);if(!n)return null;return n.name===t?n.type:null}(e,i))}),i){Object(y.a)(r);var v="".concat(O).concat(i),p={"vs:#decl":"uniform vec2 ".concat(v,";\n"),"vs:#main-start":" vec2 ".concat(P," = transform_getPos(").concat(v,");\n gl_Position = vec4(").concat(P,", 0, 1.);\n")};h=Object(s.b)([h,p])}l=d.join("\n")}return{vs:l,targetTextureType:o,inject:h,samplerTextureMap:c}}n.d(t,"a",function(){return k});var j=(i={},Object(o.a)(i,10241,9728),Object(o.a)(i,10240,9728),Object(o.a)(i,10242,33071),Object(o.a)(i,10243,33071),i),k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(this,e),Object(y.a)(Object(l.d)(t)),this.gl=t,this.model=null,this.elementCount=0,this.currentIndex=0,this.sourceBuffers=new Array(2),this.sourceTextures=new Array(2),this.feedbackBuffers=new Array(2),this.targetTextures=new Array(2),this.transformFeedbacks=new Array(2),this.framebuffers=new Array(2),this.resources={},this.elementIDBuffer=null,this._targetRefTexName=null,this._initialize(n),Object.seal(this)}return Object(a.a)(e,null,[{key:"isSupported",value:function(e){return Object(l.d)(e)}}]),Object(a.a)(e,[{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete();this.model.delete()}},{key:"getBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?this.feedbackBuffers[this.currentIndex][e]:null;return t?t instanceof h.a?t:t.buffer:null}},{key:"_getTargetTexture",value:function(){return this.framebuffers[this.currentIndex]?this.framebuffers[this.currentIndex].attachments[36064]:null}},{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.varyingName,n=void 0===t?null:t,i=e.packed,r=void 0!==i&&i,a=this.getBuffer(n);if(a)return a.getData();Object(y.a)(!n||n===this.targetTextureVarying);var o=Object(f.e)(this.framebuffers[this.currentIndex]);if(!r)return o;for(var s=o.constructor,c=Object(u.d)(this.targetTextureType),l=new s(o.length*c/4),h=0,d=0;d0&&void 0!==arguments[0]?arguments[0]:{},t=this._getInputs(),n=t.attributes,i=t.uniforms;Object.assign(i,e.uniforms);var r=Object.assign({},e.parameters),a=e.clearRenderTarget,o=void 0===a||a,s=null,u=!0;this.renderingToTexture&&(u=!1,s=this.framebuffers[this.currentIndex],Object(y.a)(s),r.viewport=[0,0,s.width,s.height],o&&s.clear({color:!0})),this.model.setAttributes(n),this.model.transform(Object.assign({},e,{transformFeedback:this.transformFeedbacks[this.currentIndex],uniforms:i,discard:u,framebuffer:s,parameters:r}))}},{key:"swapBuffers",value:function(){b.a.deprecated("swapBuffers()","swap()")(),this.swap()}},{key:"swap",value:function(){Object(y.a)(this.feedbackMap||this._swapTexture),this.currentIndex=(this.currentIndex+1)%2}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.elementCount&&this._setElementCount(e.elementCount);var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i,a=this.currentIndex;if(n||r){for(var o in r)Object(y.a)(r[o]instanceof h.a||r[o].buffer instanceof h.a);Object.assign(this.sourceBuffers[a],n),Object.assign(this.feedbackBuffers[a],r),this._createFeedbackBuffers({feedbackBuffers:r}),this.transformFeedbacks[a]&&this.transformFeedbacks[a].setBuffers(this.feedbackBuffers[a]),this._setupSwapBuffers()}var s=e._sourceTextures,u=e._targetTexture;(s||u)&&(Object.assign(this.sourceTextures[a],s),this._updateTargetTexture(u||this._targetRefTexName,a),this._setupSwapTextures())}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex;for(var t in this.sourceTextures[e])this.sourceTextures[e][t].setParameters(j)}},{key:"_setElementCount",value:function(e){this.elementCount!==e&&(this.elementCount0&&void 0!==arguments[0]?arguments[0]:{},t=this._validateProps(e),n=t.feedbackBuffers,i=t.feedbackMap,r=e.sourceBuffers,a=e.varyings,o=e._targetTexture,s=e._targetTextureVarying,u=e._swapTexture,c=a;i&&!Array.isArray(a)&&(c=Object.values(i)),this.varyingsArray=c,this.feedbackMap=i,this._swapTexture=u,o&&(this.targetTextureVarying=s,this.renderingToTexture=!0,Object(y.a)(this.targetTextureVarying)),this._setupBuffers({sourceBuffers:r,feedbackBuffers:n}),this._setupTextures(e),this._setupSwapBuffers(),this._setupSwapTextures(),this._buildModel(Object.assign({},e,{id:e.id||"transform-model",drawMode:e.drawMode||0,varyings:c}))}},{key:"_validateProps",value:function(e){var t=e.feedbackBuffers,n=e.feedbackMap,i=e.destinationBuffers,r=e.sourceDestinationMap;i&&(b.a.deprecated("destinationBuffers","feedbackBuffers")(),t=t||i),r&&(b.a.deprecated("sourceDestinationMap","feedbackMap")(),n=n||r);var a=e.vs,o=e.elementCount,s=e.varyings,u=e._sourceTextures,c=e._targetTexture,l=e._targetTextureVarying,f=e._swapTexture;for(var v in Object(y.a)(a&&(s||n||c)&&o),t||{})Object(y.a)(t[v]instanceof h.a||t[v].buffer instanceof h.a);for(var p in u||{})Object(y.a)(u[p]instanceof d.a);return Object(y.a)(!c||l),Object(y.a)(!f||u[f]),{feedbackBuffers:t,feedbackMap:n}}},{key:"_setupBuffers",value:function(e){var t=e.sourceBuffers,n=void 0===t?null:t,i=e.feedbackBuffers,r=void 0===i?null:i;this.sourceBuffers[0]=Object.assign({},n),this.feedbackBuffers[0]=Object.assign({},r),this._createFeedbackBuffers({feedbackBuffers:r}),this.sourceBuffers[1]={},this.feedbackBuffers[1]={}}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e._sourceTextures,n=e._targetTexture;if(this.sourceTextures[0]=Object.assign({},t),this.sourceTextures[1]={},this.hasSourceTextures=Object.keys(this.sourceTextures[0]).length>0,this.targetTextureVarying){var i=this._buildTargetTexture(n,0);Object(y.a)(i),this.targetTextures[0]=i,this.targetTextures[1]=null}}},{key:"_buildTargetTexture",value:function(e,t){var n;if(e instanceof d.a)return e;var i=this.sourceTextures[0][e];if(!i)return null;this._targetRefTexName=e;var r=Object(v.a)(i,{parameters:(n={},Object(o.a)(n,10241,9728),Object(o.a)(n,10240,9728),Object(o.a)(n,10242,33071),Object(o.a)(n,10243,33071),n),pixelStore:Object(o.a)({},37440,!1)}),a="target-texture-".concat(t);return this.resources[a]&&this.resources[a].delete(),this.resources[a]=r,r}},{key:"_createFeedbackBuffers",value:function(e){var t=e.feedbackBuffers;if(this.feedbackMap){var n=this.currentIndex;for(var i in this.feedbackMap){var r=this.feedbackMap[i];if(!(r===this.targetTextureVarying||t&&t[r])){var a=this.sourceBuffers[n][i],o=a.byteLength,s=a.usage,u=a.accessor,c=this._createNewBuffer(r,{byteLength:o,usage:s,accessor:u});this.feedbackBuffers[n][r]=c}}}}},{key:"_createNewBuffer",value:function(e,t){var n=new h.a(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=n,n}},{key:"_setupSwapBuffers",value:function(){if(this.feedbackMap){var e=this.currentIndex,t=(e+1)%2;for(var n in Object.assign(this.sourceBuffers[t],this.sourceBuffers[e]),Object.assign(this.feedbackBuffers[t],this.feedbackBuffers[e]),this.feedbackMap){var i=this.feedbackMap[n];i!==this.targetTextureVarying&&(this.sourceBuffers[t][n]=this.feedbackBuffers[e][i],this.feedbackBuffers[t][i]=this.sourceBuffers[e][n],Object(y.a)(this.feedbackBuffers[t][i]instanceof h.a))}this.transformFeedbacks[t]&&this.transformFeedbacks[t].setBuffers(this.feedbackBuffers[t])}}},{key:"_setupSwapTextures",value:function(){if(this._swapTexture&&this.targetTextureVarying){var e=this.currentIndex,t=(e+1)%2;Object.assign(this.sourceTextures[t],this.sourceTextures[e]),this.sourceTextures[t][this._swapTexture]=this.targetTextures[e],this._updateTargetTexture(this.sourceTextures[e][this._swapTexture],t)}}},{key:"_buildModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._getShaders(e),n=t.vs,i=t.fs,r=t.modules,a=t.uniforms,o=t.inject,s=t.samplerTextureMap;this.model=new x.a(this.gl,Object.assign({},e,{vs:n,fs:i,vertexCount:e.elementCount,modules:r,uniforms:a,inject:o})),this.samplerTextureMap=s,this._setupTransformFeedback(),this._setupFramebuffers(),this._setElementCount(e.elementCount)}},{key:"_setupTransformFeedback",value:function(){Object(_.a)(this.feedbackBuffers[0])||(this.transformFeedbacks[0]=new p.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[0]}),this.feedbackMap&&(this.transformFeedbacks[1]=new p.a(this.gl,{program:this.model.program,buffers:this.feedbackBuffers[1]})))}},{key:"_setupFramebuffers",value:function(){if(this.renderingToTexture){var e=this.targetTextures[0],t=e.width,n=e.height;if(this.framebuffers[0]=new g.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-0"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[0])}),this._swapTexture){var i=this.targetTextures[1];t=i.width,n=i.height,this.framebuffers[1]=new g.a(this.gl,{id:"".concat(this.id||"transform","-framebuffer-1"),width:t,height:n,attachments:Object(o.a)({},36064,this.targetTextures[1])})}}}},{key:"_updateElementIDBuffer",value:function(e){if(this.hasSourceTextures||this.targetTextureVarying){var t=new Float32Array(e);t.forEach(function(e,t,n){n[t]=t}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=this._createNewBuffer("elementIDBuffer",{data:t,accessor:{size:1}})}}},{key:"_getShaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._processVertexShader(e.vs),n=t.vs,i=t.uniforms,r=t.targetTextureType,a=t.inject,o=t.samplerTextureMap,l=Object(s.b)([e.inject||{},a]);return this.targetTextureType=r,{vs:n,fs:e._fs||Object(u.b)({version:Object(m.a)(n),input:this.targetTextureVarying,inputType:r,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[c.a].concat(e.modules||[]):e.modules,uniforms:i,inject:l,samplerTextureMap:o}}},{key:"_processVertexShader",value:function(e){return S({vs:e,sourceTextureMap:this.sourceTextures[this.currentIndex],targetTextureVarying:this.targetTextureVarying,targetTexture:this.targetTextures[this.currentIndex]})}}]),e}()},function(e,t,n){"use strict";(function(e){var i=n(35);t.a="undefined"!=typeof window&&"object"===Object(i.a)(window.process)&&"renderer"===window.process.type||!(void 0===e||"object"!==Object(i.a)(e.versions)||!Boolean(e.versions.electron))||"object"===("undefined"==typeof navigator?"undefined":Object(i.a)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}).call(this,n(88))},function(e,t,n){var i=n(258);e.exports=function(e,t){if(null==e)return{};var n,r,a=i(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){e.exports=function(e){var t;if("function"==typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return l});var i=n(0),r=n(38),a=n.n(r),o=n(123);const s={container:a.a.object,gl:a.a.object,mapboxApiAccessToken:a.a.string,attributionControl:a.a.bool,preserveDrawingBuffer:a.a.bool,reuseMaps:a.a.bool,transformRequest:a.a.func,mapOptions:a.a.object,mapStyle:a.a.oneOfType([a.a.string,a.a.object]),visible:a.a.bool,asyncRender:a.a.bool,onLoad:a.a.func,onError:a.a.func,width:a.a.number,height:a.a.number,viewState:a.a.object,longitude:a.a.number,latitude:a.a.number,zoom:a.a.number,bearing:a.a.number,pitch:a.a.number,altitude:a.a.number},u={container:o.a.body,mapboxApiAccessToken:function(){let t=null;if("undefined"!=typeof window&&window.location){const e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||void 0===e||(t=t||e.env.MapboxAccessToken||e.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:function(){},onError:function(e){e&&console.error(e.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0};function c(e,t="component"){e.debug&&a.a.checkPropTypes(s,e,"prop",t)}class l{constructor(e){if(Object(i.a)(this,"mapboxgl",void 0),Object(i.a)(this,"props",u),Object(i.a)(this,"_map",null),Object(i.a)(this,"width",0),Object(i.a)(this,"height",0),Object(i.a)(this,"_fireLoadEvent",()=>{this.props.onLoad({type:"load",target:this._map})}),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,l.initialized||(l.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}finalize(){return this._destroy(),this}setProps(e){return this._update(this.props,e),this}resize(){return this._map.resize(),this}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this._map}_reuse(e){this._map=l.savedMap;const t=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");t.childNodes.length>0;)n.appendChild(t.childNodes[0]);this._map._container=n,l.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}_create(e){if(e.reuseMaps&&l.savedMap)this._reuse(e);else{if(e.gl){const t=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=(()=>(HTMLCanvasElement.prototype.getContext=t,e.gl))}const t={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&&(t.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},t,e.mapOptions)),this._map.once("load",e.onLoad),this._map.on("error",e.onError)}return this}_destroy(){this._map&&(l.savedMap?this._map.remove():(l.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)}_initialize(e){c(e=Object.assign({},u,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||u.mapboxApiAccessToken,this._create(e);const t=e.container;Object.defineProperty(t,"offsetWidth",{get:()=>this.width}),Object.defineProperty(t,"clientWidth",{get:()=>this.width}),Object.defineProperty(t,"offsetHeight",{get:()=>this.height}),Object.defineProperty(t,"clientHeight",{get:()=>this.height});const n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}_update(e,t){if(!this._map)return;c(t=Object.assign({},this.props,t),"Mapbox");const n=this._updateMapViewport(e,t),i=this._updateMapSize(e,t);t.asyncRender||!n&&!i||this.redraw(),this.props=t}_updateMapSize(e,t){const n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}_updateMapViewport(e,t){const n=this._getViewState(e),i=this._getViewState(t),r=i.latitude!==n.latitude||i.longitude!==n.longitude||i.zoom!==n.zoom||i.pitch!==n.pitch||i.bearing!==n.bearing||i.altitude!==n.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(i)),i.altitude!==n.altitude&&(this._map.transform.altitude=i.altitude)),r}_getViewState(e){const t=e.viewState||e,n=t.longitude,i=t.latitude,r=t.zoom,a=t.pitch,o=void 0===a?0:a,s=t.bearing,u=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:i,zoom:r,pitch:o,bearing:u,altitude:void 0===c?1.5:c}}_checkStyleSheet(e="0.47.0"){if(void 0!==o.a)try{const t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){const t=o.a.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",`https://api.tiles.mapbox.com/mapbox-gl-js/v${e}/mapbox-gl.css`),o.a.head.append(t)}}catch(e){}}_viewStateToMapboxProps(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}Object(i.a)(l,"initialized",!1),Object(i.a)(l,"propTypes",s),Object(i.a)(l,"defaultProps",u),Object(i.a)(l,"savedMap",null)}).call(this,n(88))},function(e,t,n){"use strict";function i(e,t,n){n=n||2;var i,s,u,c,l,d,p,g=t&&t.length,m=g?t[0]*n:e.length,y=r(e,0,m,n,!0),b=[];if(!y)return b;if(g&&(y=function(e,t,n,i){var o,s,u,c,l,d=[];for(o=0,s=t.length;o80*n){i=u=e[0],s=c=e[1];for(var _=n;_u&&(u=l),d>c&&(c=d);p=0!==(p=Math.max(u-i,c-s))?1/p:0}return o(y,b,n,i,s,p),b}function r(e,t,n,i,r){var a,o;if(r===S(e,t,n,i)>0)for(a=t;a=t;a-=i)o=w(a,e[a],e[a+1],o);return o&&y(o,o.next)&&(O(o),o=o.next),o}function a(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(O(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function o(e,t,n,i,r,h,f){if(e){!f&&h&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,u,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t0||u>0&&i;)0!==s&&(0===u||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,u--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,h);for(var v,p,g=e;e.prev!==e.next;)if(v=e.prev,p=e.next,h?u(e,i,r,h):s(e))t.push(v.i/n),t.push(e.i/n),t.push(p.i/n),O(e),e=p.next,g=p.next;else if((e=p)===g){f?1===f?o(e=c(e,t,n),t,n,i,r,h,2):2===f&&l(e,t,n,i,r,h):o(a(e),t,n,i,r,h,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(p(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=d(s,u,t,n,i),f=d(c,l,t,n,i),v=e.prevZ,g=e.nextZ;v&&v.z>=h&&g&&g.z<=f;){if(v!==e.prev&&v!==e.next&&p(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,g!==e.prev&&g!==e.next&&p(r.x,r.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;v&&v.z>=h;){if(v!==e.prev&&v!==e.next&&p(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;g&&g.z<=f;){if(g!==e.prev&&g!==e.next&&p(r.x,r.y,a.x,a.y,o.x,o.y,g.x,g.y)&&m(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function c(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!y(r,a)&&b(r,i,i.next,a)&&_(r,a)&&_(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),O(i),O(i.next),i=e=a),i=i.next}while(i!==e);return i}function l(e,t,n,i,r,s){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&g(u,c)){var l=x(u,c);return u=a(u,u.next),l=a(l,l.next),o(u,t,n,i,r,s),void o(l,t,n,i,r,s)}c=c.next}u=u.next}while(u!==e)}function h(e,t){return e.x-t.x}function f(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&r!==i.x&&p(an.x)&&_(i,e)&&(n=i,f=u),i=i.next;return n}(e,t)){var n=x(t,e);a(n,n.next)}}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{t.x=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_(e,t)&&_(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){return!!(y(e,t)&&y(n,i)||y(e,i)&&y(n,t))||m(e,t,n)>0!=m(e,t,i)>0&&m(n,i,e)>0!=m(n,i,t)>0}function _(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function x(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function w(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(e,t,n,i){for(var r=0,a=t,o=n-i;a0&&(i+=e[r-1].length,n.holes.push(i))}return n}},function(e,t,n){"use strict";e.exports=r;var i=1e20;function r(e,t,n,i,r,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=i||.25,this.fontFamily=r||"sans-serif",this.fontWeight=a||"normal",this.radius=n||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function a(e,t,n,i,r,a,s){for(var u=0;u * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details - */r=[],void 0===(a="function"==typeof(i=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},i={};function r(e,t){var r,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=i[e])?a:(r=o(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(a=n[e])?a:(r=o(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:v;if(t){if(e<0)return g;if(e>=f)return _}else{if(e<=-h)return x;if(e+1>=h)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,n,i){return new e(t,n,i)}e.fromInt=r,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(s(n,8)),o=v,c=0;c>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(p)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,f=0,h=0,d=0,v=0;return d+=(v+=a+(65535&e.low))>>>16,h+=(d+=r+l)>>>16,f+=(h+=i+u)>>>16,f+=n+s,o((d&=65535)<<16|(v&=65535),(f&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(t(e)||(e=c(e)),e.isZero())return v;if(this.eq(x))return e.isOdd()?x:v;if(e.eq(x))return this.isOdd()?x:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,f=e.low>>>16,h=65535&e.low,g=0,p=0,m=0,y=0;return m+=(y+=s*h)>>>16,p+=(m+=r*h)>>>16,m&=65535,p+=(m+=s*f)>>>16,g+=(p+=i*h)>>>16,p&=65535,g+=(p+=r*f)>>>16,p&=65535,g+=(p+=s*l)>>>16,g+=n*h+i*f+r*l+s*u,o((m&=65535)<<16|(y&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:v;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return m;r=g}else{if(this.eq(x))return e.eq(p)||e.eq(y)?x:e.eq(x)?p:(n=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?p:y:(i=this.sub(e.mul(n)),r=n.add(i.div(e)));if(e.eq(x))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=v}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(n),f=l.mul(e);f.isNegative()||f.gt(i);)f=(l=a(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=p),r=r.add(l),i=i.sub(f)}return r},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;return e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?i.apply(t,r):i)||(e.exports=a)},function(e,t,n){"use strict";function i(e){for(var t in e)return!1;return!0}function r(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(26);function r(e,t,n){var r=n.removedProps,a=void 0===r?{}:r,o=n.deprecatedProps,s=void 0===o?{}:o,u=n.replacedProps,c=void 0===u?{}:u;for(var l in a)if(l in t){var f=a[l]?"".concat(e,".").concat(a[l]):"N/A";i.a.removed("".concat(e,".").concat(l),f)()}for(var h in s)if(h in t){var d=s[h];i.a.deprecated("".concat(e,".").concat(h),"".concat(e,".").concat(d))()}var v=null;for(var g in c)if(g in t){var p=c[g];i.a.deprecated("".concat(e,".").concat(g),"".concat(e,".").concat(p))(),(v=v||Object.assign({},t))[p]=t[g],delete v[g]}return v||t}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(26);function r(e,t,n,r){var a="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),o=Object.getPrototypeOf(e);r.forEach(function(e){o.methodName||(o[e]=function(){throw i.a.removed("Calling removed method ".concat(t,".").concat(e,": "),a)(),new Error(e)})})}},function(e,t,n){"use strict";var i=n(34),r=n(25),a=n(0),o=n(4),s=n(5),u=n(96);var c=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var f={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(e){return"string"==typeof e?f[e.toUpperCase()]||f.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(86);n.d(t,"a",function(){return b});var g={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!1,priority:0};function m(){}var y={};var b=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(243)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var f=new Image;return f.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(f,i,o)))},f.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=h(a),r="[".concat(a,"m").concat(r,"")),o&&(a=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();b.VERSION=u.a},function(e,t,n){const i=n(242);Object.assign(i,n(79),n(261),n(263),n(265),n(262),n(266),n(264)),e.exports=i},,,,,function(e,t,n){(function(t){const i=n(17),r=n(21),a=n(258).default,o="undefined"==typeof window?t:window;o.deck=o.deck||{},o.luma=o.luma||{},Object.assign(o.deck,r,{DeckGL:a}),Object.assign(o.luma,i),e.exports=o.deck}).call(this,n(78))},function(e,t){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var i=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(246),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=_;var f="suspendedStart",h="suspendedYield",d="executing",v="completed",g={},p={};p[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(T([])));y&&y!==i&&r.call(y,o)&&(p=y);var b=P.prototype=w.prototype=Object.create(p);O.prototype=b.constructor=P,P.constructor=O,P[u]=O.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===O||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,P):(e.__proto__=P,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},S(j.prototype),j.prototype[s]=function(){return this},l.AsyncIterator=j,l.async=function(e,t,n,i){var r=new j(_(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},S(b),b[u]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=T,A.prototype={constructor:A,reset:function(e){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(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:T(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function _(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new A(i||[]);return a._invoke=function(e,t,n){var i=f;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return M()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function O(){}function P(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function j(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function k(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,k(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; + */r=[],void 0===(a="function"==typeof(i=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var n={},i={};function r(e,t){var r,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=i[e])?a:(r=o(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(a=n[e])?a:(r=o(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?p:v;if(t){if(e<0)return p;if(e>=h)return _}else{if(e<=-f)return x;if(e+1>=f)return b}return e<0?a(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,n,i){return new e(t,n,i)}e.fromInt=r,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();for(var r=a(s(n,8)),o=v,c=0;c>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},w.isOdd=function(){return 1==(1&this.low)},w.isEven=function(){return 0==(1&this.low)},w.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(g)},w.neg=w.negate,w.add=function(e){t(e)||(e=c(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,h=0,f=0,d=0,v=0;return d+=(v+=a+(65535&e.low))>>>16,f+=(d+=r+l)>>>16,h+=(f+=i+u)>>>16,h+=n+s,o((d&=65535)<<16|(v&=65535),(h&=65535)<<16|(f&=65535),this.unsigned)},w.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(t(e)||(e=c(e)),e.isZero())return v;if(this.eq(x))return e.isOdd()?x:v;if(e.eq(x))return this.isOdd()?x:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,u=e.high>>>16,l=65535&e.high,h=e.low>>>16,f=65535&e.low,p=0,g=0,m=0,y=0;return m+=(y+=s*f)>>>16,g+=(m+=r*f)>>>16,m&=65535,g+=(m+=s*h)>>>16,p+=(g+=i*f)>>>16,g&=65535,p+=(g+=r*h)>>>16,g&=65535,p+=(g+=s*l)>>>16,p+=n*f+i*h+r*l+s*u,o((m&=65535)<<16|(y&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?p:v;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return p;if(e.gt(this.shru(1)))return m;r=p}else{if(this.eq(x))return e.eq(g)||e.eq(y)?x:e.eq(x)?g:(n=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?g:y:(i=this.sub(e.mul(n)),r=n.add(i.div(e)));if(e.eq(x))return this.unsigned?p:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=v}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),u=o<=48?1:s(2,o-48),l=a(n),h=l.mul(e);h.isNegative()||h.gt(i);)h=(l=a(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=g),r=r.add(l),i=i.sub(h)}return r},w.div=w.divide,w.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.not=function(){return o(~this.low,~this.high,this.unsigned)},w.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var n=this.high;return e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?i.apply(t,r):i)||(e.exports=a)},function(e,t,n){"use strict";function i(e){for(var t in e)return!1;return!0}function r(e){return Boolean(e&&2===e._version)}n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(25);function r(e,t,n){var r=n.removedProps,a=void 0===r?{}:r,o=n.deprecatedProps,s=void 0===o?{}:o,u=n.replacedProps,c=void 0===u?{}:u;for(var l in a)if(l in t){var h=a[l]?"".concat(e,".").concat(a[l]):"N/A";i.a.removed("".concat(e,".").concat(l),h)()}for(var f in s)if(f in t){var d=s[f];i.a.deprecated("".concat(e,".").concat(f),"".concat(e,".").concat(d))()}var v=null;for(var p in c)if(p in t){var g=c[p];i.a.deprecated("".concat(e,".").concat(p),"".concat(e,".").concat(g))(),(v=v||Object.assign({},t))[g]=t[p],delete v[p]}return v||t}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(25);function r(e,t,n,r){var a="See luma.gl ".concat(n," Upgrade Guide at http://uber.github.io/luma.gl/#/documentation/overview/upgrade-guide"),o=Object.getPrototypeOf(e);r.forEach(function(e){o.methodName||(o[e]=function(){throw i.a.removed("Calling removed method ".concat(t,".").concat(e,": "),a)(),new Error(e)})})}},function(e,t,n){"use strict";var i=n(35),r=n(26),a=n(0),o=n(4),s=n(5),u=n(95);var c=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(o.a)(this,e),this.storage=function(e){try{var t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(i),this.id=t,this.config={},Object.assign(this.config,n),this._loadConfiguration()}return Object(s.a)(e,[{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 t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}]),e}();function l(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,r=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(n=Math.min(n,i/e.width));var a=e.width*n,o=e.height*n,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(r,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var h={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function f(e){return"string"==typeof e?h[e.toUpperCase()]||h.WHITE:e}function d(e,t){if(!e)throw new Error(t||"Assertion failed")}var v=n(86);n.d(t,"a",function(){return b});var p={debug:u.b&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},g={enabled:!1,priority:0};function m(){}var y={};var b=function(){function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id;Object(o.a)(this,e),this.id=t,this.VERSION=u.a,this._startTs=Object(v.a)(),this._deltaTs=Object(v.a)(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new c("__probe-".concat(this.id,"__"),g),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(n),r=!0,a=!1,o=void 0;try{for(var s,u=function(){var n=s.value;"function"==typeof e[n]&&(t.find(function(e){return n===e})||(e[n]=e[n].bind(e)))},c=i[Symbol.iterator]();!(r=(s=c.next()).done);r=!0)u()}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}}(this),Object.seal(this)}return Object(s.a)(e,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getPriority",value:function(){return this._storage.config.priority}},{key:"getLevel",value:function(){return this._storage.config.priority}},{key:"getTotal",value:function(){return Number((Object(v.a)()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Object(v.a)()-this._deltaTs).toPrecision(10))}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({priority:e}),this}},{key:"assert",value:function(e,t){d(e,t)}},{key:"warn",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;r2?n-2:0),r=2;rthis.getPriority()?m:u.b?this._logImageInBrowser({image:n,message:r,scale:o}):this._logImageInNode({image:n,message:r,scale:o})}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,t){this._storage.updateConfiguration(Object(a.a)({},e,t))}},{key:"_logImageInNode",value:function(e){var t=e.image,i=(e.message,e.scale),r=void 0===i?1:i,a=null;try{a=n(246)}catch(e){}return a?function(){return a(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(function(e){return console.log(e)})}:m}},{key:"_logImageInBrowser",value:function(e){var t=e.image,n=e.message,i=void 0===n?"":n,a=e.scale,o=void 0===a?1:a;if("string"==typeof t){var s=new Image;return s.onload=function(){var e,t=l(s,i,o);(e=console).log.apply(e,Object(r.a)(t))},s.src=t,m}var u,c=t.nodeName||"";if("img"===c.toLowerCase())return(u=console).log.apply(u,Object(r.a)(l(t,i,o))),m;if("canvas"===c.toLowerCase()){var h=new Image;return h.onload=function(){var e;return(e=console).log.apply(e,Object(r.a)(l(h,i,o)))},h.src=t.toDataURL(),m}return m}},{key:"time",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.time?console.time:console.info})}},{key:"timeEnd",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeEnd?console.timeEnd:console.info})}},{key:"timeStamp",value:function(e,t){return this._getLogFunction({priority:e,message:t,method:console.timeStamp||m})}},{key:"group",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},i=(n=this._normalizeArguments({priority:e,message:t,opts:n})).collapsed;return this._getLogFunction({priority:e,message:t,opts:n,method:(i?console.groupCollapsed:console.group)||console.info})}},{key:"groupCollapsed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction({priority:e,message:"",method:console.groupEnd||m})}},{key:"withGroup",value:function(e,t,n){var i=this._normalizeArguments({priority:e,message:t});this.group(i);try{n()}finally{this.groupEnd(i.message)}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return 0===(e=this._normalizePriority(e))||this.isEnabled()&&this.getPriority()>=e}},{key:"_getElapsedTime",value:function(){var e=this.getTotal(),t=this.getDelta();return this._deltaTs=Object(v.a)(),{total:e,delta:t}}},{key:"_getLogFunction",value:function(e){if(this._shouldLog(e.priority)){var t=e.method;e=this._parseArguments(e),d(t);var n=e.message,i=e.tag||e.message;if(e.once){if(y[i])return m;y[i]=Object(v.a)()}return n=this._decorateMessage(n,e),t.bind.apply(t,[console,n].concat(Object(r.a)(e.args)))}return m}},{key:"_parseArguments",value:function(e){var t=this._normalizeArguments(e),n=this._getElapsedTime(),i=n.delta,r=n.total;return Object.assign(e,t,{delta:i,total:r})}},{key:"_normalizePriority",value:function(e){var t;switch(Object(i.a)(e)){case"number":t=e;break;case"object":t=e.priority||0;break;default:t=0}return d(Number.isFinite(t)&&t>=0),t}},{key:"_normalizeArguments",value:function(e){var t=e.priority,n=e.message,r=e.args,a=void 0===r?[]:r,o=e.opts,s={priority:this._normalizePriority(t),message:n,args:a};switch(Object(i.a)(t)){case"string":case"function":void 0!==n&&a.unshift(n),Object.assign(s,{message:t});break;case"object":Object.assign(s,t)}return"function"==typeof s.message&&(s.message=this._shouldLog(s.priority)?s.message():""),d("string"==typeof s.message||"object"===Object(i.a)(s.message)),Object.assign(s,o)}},{key:"_decorateMessage",value:function(e,t){if("string"==typeof e){var n="";if(t.time){var i=this._getElapsedTime().total;n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}((s=i)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s"))}e=t.time?"".concat(this.id,": ").concat(n," ").concat(e):"".concat(this.id,": ").concat(e),r=e,a=t.color,o=t.background,u.b||"string"!=typeof r||(a&&(a=f(a),r="[".concat(a,"m").concat(r,"")),o&&(a=f(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,a,o,s;return e}},{key:"priority",set:function(e){return this._storage.updateConfiguration({priority:e}),this},get:function(){return this._storage.config.priority}}]),e}();b.VERSION=u.a},function(e,t,n){const i=n(245);Object.assign(i,n(80),n(265),n(268),n(269),n(266),n(270),n(267)),e.exports=i},,,,,function(e,t,n){(function(t){const i=n(17),r=n(20),a=n(261).default,o="undefined"==typeof window?t:window;o.deck=o.deck||{},o.luma=o.luma||{},Object.assign(o.deck,r,{DeckGL:a}),Object.assign(o.luma,i),e.exports=o.deck}).call(this,n(79))},function(e,t){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){var i=function(){return this||"object"==typeof self&&self}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,a=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(249),r)i.regeneratorRuntime=a;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c="object"==typeof e,l=t.regeneratorRuntime;if(l)c&&(e.exports=l);else{(l=t.regeneratorRuntime=c?e.exports:{}).wrap=_;var h="suspendedStart",f="suspendedYield",d="executing",v="completed",p={},g={};g[o]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(A([])));y&&y!==i&&r.call(y,o)&&(g=y);var b=P.prototype=w.prototype=Object.create(g);O.prototype=b.constructor=P,P.constructor=O,P[u]=O.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===O||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,P):(e.__proto__=P,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},S(j.prototype),j.prototype[s]=function(){return this},l.AsyncIterator=j,l.async=function(e,t,n,i){var r=new j(_(e,t,n,i));return l.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},S(b),b[u]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},l.values=A,T.prototype={constructor:T,reset:function(e){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(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return s.type="throw",s.arg=e,t.next=i,r&&(t.method="next",t.arg=n),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:A(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),p}}}function _(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,a=Object.create(r.prototype),o=new T(i||[]);return a._invoke=function(e,t,n){var i=h;return function(r,a){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw a;return M()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=k(o,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var u=x(e,t,n);if("normal"===u.type){if(i=n.done?v:f,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function x(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function O(){}function P(){}function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function j(e){var t;this._invoke=function(n,i){function a(){return new Promise(function(t,a){!function t(n,i,a,o){var s=x(e[n],e,i);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,a,o)},function(e){t("throw",e,a,o)}):Promise.resolve(c).then(function(e){u.value=e,a(u)},function(e){return t("throw",e,a,o)})}o(s.arg)}(n,i,t,a)})}return t=t?t.then(a,a):a()}}function k(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,k(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=x(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,p):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0||(r[n]=e[n]);return r}},function(e,t,n){var i; /*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * @@ -14,4 +14,4 @@ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ -!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),f="function",h=Math.round,d=Math.abs,v=Date.now;function g(e,t,n){return setTimeout(w(e,n),t)}function p(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function A(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function L(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==B&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(f=o.pointers,h=i,oe(h[0],h[1],$)/oe(f[0],f[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>z||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,f=re(u,c,l);i=f.x,r=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var f,h;var g=e.element;k(t.srcEvent.target,g)&&(g=t.srcEvent.target);t.target=g}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?q:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(R(this.element),this.evWin,this.domHandler)}};var ue={mousedown:B,mousemove:U,mouseup:V},ce="mousedown",le="mousemove mouseup";function fe(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(fe,ee,{handler:function(e){var t=ue[e.type];t&B&&0===e.button&&(this.pressed=!0),t&U&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:B,pointermove:U,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",ge="pointermove pointerup pointercancel";function pe(){this.evEl=ve,this.evWin=ge,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",ge="MSPointerMove MSPointerUp MSPointerCancel"),x(pe,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=he[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=A(t,e.pointerId,"pointerId");r&B&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:B,touchmove:U,touchend:V,touchcancel:G},ye="touchstart",be="touchstart touchmove touchend touchcancel";function _e(){this.evTarget=ye,this.evWin=be,this.started=!1,ee.apply(this,arguments)}x(_e,ee,{handler:function(e){var t=me[e.type];if(t===B&&(this.started=!0),this.started){var n=function(e,t){var n=T(e.touches),i=T(e.changedTouches);t&(V|G)&&(n=M(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:B,touchmove:U,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Oe(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Oe,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=T(e.touches),i=this.targetIds;if(t&(B|U)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=T(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return k(e.target,u)}),t===B)for(r=0;r-1&&i.splice(e,1)},Pe)}}x(je,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,ke.call(this,t)):e&(V|G)&&ke.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Be&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return qe.prototype.attrTest.call(this,e)&&(this.state&Ne||!(this.state&Ne)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ye,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ne)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Ke,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&B)this.reset(),this._timer=g(function(){this.state=Ue,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ue;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ue&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Qe,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ne)}}),x(Je,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|K)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;j(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:C(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return o});var i=n(228),r=n(194);const a={position:"absolute",left:0,top:0,width:"100%",height:"100%"};class o extends r.a{constructor(e={}){if("undefined"==typeof document)throw Error("Deck can only be used in the browser");const{mapCanvas:t,deckCanvas:n}=function(e){let{container:t=document.body}=e;if("string"==typeof t&&(t=document.getElementById(t)),!t)throw Error("Deck: container not found");"static"===window.getComputedStyle(t).position&&(t.style.position="relative");const n=document.createElement("div");t.appendChild(n),Object.assign(n.style,a);const i=document.createElement("canvas");return t.appendChild(i),Object.assign(i.style,a),{container:t,mapCanvas:n,deckCanvas:i}}(e),r=e.initialViewState||function(e){if(!e.viewState&&"latitude"in e&&"longitude"in e&&"zoom"in e){const{latitude:t,longitude:n,zoom:i,pitch:r=0,bearing:a=0}=e;return{latitude:t,longitude:n,zoom:i,pitch:r,bearing:a}}return e.viewState}(e),o=Number.isFinite(r.latitude),{map:s=window.mapboxgl,controller:u=!0}=e;super(Object.assign({},e,{width:"100%",height:"100%",canvas:n,controller:u,initialViewState:r})),s&&s.Map?this._map=o&&new i.a(Object.assign({},e,{viewState:r,container:t,mapboxgl:s})):this._map=s,this._onBeforeRender=(e=>{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(260);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(21),p=n(72),m=n(15),y=n(165),b=n(130),_=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function x(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(Number.isFinite(e[0]))t=new i(e);else{t=new i(4*e.length);for(var r=0,a=0;ae?t:e}function U(e,t){return t1&&void 0!==arguments[1]?arguments[1]:{},n=t.width,i=void 0===n?1:n,r=t.height,a=void 0===r?1:r,o=t.data,s=void 0===o?null:o,u=t.unpackFlipY,c=void 0===u||u,l=t.parameters,f=void 0===l?ee:l;return new J.a(e,{data:s,format:34836,type:5126,border:0,mipmaps:!1,parameters:f,dataFormat:6408,width:i,height:a,unpackFlipY:c})}function ne(e,t){var n=t.id,i=t.width,r=void 0===i?1:i,a=t.height,o=void 0===a?1:a,s=t.texture;return new $.a(e,{id:n,width:r,height:o,attachments:P()({},36064,s)})}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(C.d)(t)&&Object(E.c)(this.gl,A.a.BLEND_EQUATION_MINMAX,A.a.COLOR_ATTACHMENT_RGBA32F,A.a.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.warn("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,oe){var r=oe[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},H,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,W)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||Q,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},K,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,f=0;f=0&&P=0&&S0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new L.a(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n pos = floor(pos / cellSize);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?[F.a]:["project32"],shaderCache:n,vertexCount:0,drawMode:0})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new L.a(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:[k.a],shaderCache:t,vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new I.a(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,h=a.weights,d=[o,s],v={blend:!0,depthTest:!1,blendFunc:[1,1]},g={viewport:n},p={windowSize:u,cellSize:t,gridSize:d,uProjectionMatrix:i,uProjectionMatrixFP64:re(i),projectPoints:r};for(var m in h){var y=h[m],b=y.needMin,_=y.needMax,x=b&&_&&h[m].combineMaxMin;this.renderToWeightsTexture({id:m,parameters:v,moduleSettings:g,uniforms:p,gridSize:d}),x?this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:Z}),gridSize:d,minOrMaxFb:c[m],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:x}):(b&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:X}),gridSize:d,minOrMaxFb:l[m],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:x}),_&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:q}),gridSize:d,minOrMaxFb:f[m],combineMaxMin:x}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(R.a)(c,s,function(){c.clear(16384)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,f=this.gl,h=this.gridAggregationModel,d=l[t].operation;s[t].bind(),f.viewport(0,0,a[0],a[1]);var v=d===N.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(R.a)(f,{clearColor:v},function(){f.clear(16384)});var g={weights:c[t]};if(h.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:g}),s[t].unbind(),d===N.MEAN){var p=this.state,m=p.meanTextures,y=p.textures,b={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(b).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(P()({},36064,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,f=t.equations,h=t.weights,d={width:n,height:i};for(var v in h){var g=h[v],p=g.needMin,m=g.needMax,y=g.combineMaxMin,b=g.operation;r[v]=h[v].aggregationTexture||r[v]||te(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var _=r[v];b===N.MEAN&&(l[v]=l[v]||te(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),_=l[v]),a[v]?a[v].attach(P()({},36064,_)):a[v]=ne(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:_}),a[v].resize(d),f[v]=Y[b],(p||m)&&(p&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=te(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=ne(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(p&&(s[v]||(c["".concat(v,"-min")]=te(this.gl,{id:"".concat(v,"-minTex")}),s[v]=ne(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=te(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=ne(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof T.a?n[o].setData(u):(a["".concat(o,"-buffer")]=new T.a(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof T.a),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],h()(l()(t.prototype),"getShaders",this).call(this,e)}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:N.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new se(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&((n.cellSizeChanged||n.viewportChanged)&&this._updateGridParams(),this.state.pointCount>0&&this._updateAggregation(n))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||le,o=this.props.maxColor||fe,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,f=u.cellScale,h=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,g={minColor:a,maxColor:o,cellScale:f,colorRange:d,colorDomain:s,shouldUseMinMax:h};Object(C.d)(n)?l.bind({target:35345}):g.maxWeight=v,t=Object.assign(g,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(C.d)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=se.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new ue.a({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new T.a(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=ce(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(p.a)(t),c=u.iterable,l=u.objectInfo,f=!0,h=!1,d=void 0;try{for(var v,g=c[Symbol.iterator]();!(f=(v=g.next()).done);f=!0){var m=v.value;l.index++;var y=n(m,l),b=i(m,l),_=l.index;a[2*_]=y[0],a[2*_+1]=y[1],Array.isArray(b)?(o[3*_]=b[0],o[3*_+1]=b[1],o[3*_+2]=b[2]):o[3*_]=b}}catch(e){h=!0,d=e}finally{try{f||null==g.return||g.return()}finally{if(h)throw d}}s.color.values=o,this.setState({positions:a,pointCount:r})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(C.d)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager(),n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=N[this.props.aggregation.toUpperCase()]||N.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var f=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),h=f.color.maxData&&Number.isFinite(f.color.maxData[0])?f.color.maxData[0]:0;this.setState({maxWeight:h}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if(he.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,f=c>l?l:0;r.cellScale=new Float32Array([(c-f)/o*2,-(c-f)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){this.getAttributeManager().invalidateAll();var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new T.a(r,{byteLength:u,accessor:{size:4,type:5126,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(b.a);ve.layerName="ScreenGridLayer",ve.defaultProps=de;var ge=n(192),pe=n(193),me=n(217),ye=function(e){return e.length},be=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=j()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,P()({},t.i,t))},{})}}]),e}();function _e(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function xe(e,t){return function(n){return _e(e,t,n)}}function we(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var Oe=6378e3;function Pe(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(p.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,f=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,f=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw f}}var g=function(e,t){var n=(o=e,o/Oe*(180/Math.PI)),i=(r=t,a=e,a/Oe*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(g.xOffset<=0||g.yOffset<=0)return{gridHash:{},gridOffset:g};var m={};u.index=-1;var y=!0,b=!1,_=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;u.index++;var P=i(O,u),S=j()(P,2),k=S[0],C=S[1];if(Number.isFinite(C)&&Number.isFinite(k)){var E=Math.floor((C+90)/g.yOffset),A=Math.floor((k+180)/g.xOffset),T="".concat(E,"-").concat(A);m[T]=m[T]||{count:0,points:[]},m[T].count+=1,m[T].points.push(O)}}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}return{gridHash:m,gridOffset:g}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function Se(){}var je={colorDomain:null,colorRange:_,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:Se,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:Se,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,material:new ge.a},ke=["getColorValue","colorAggregation","getColorWeight"],Ce=["getElevationValue","elevationAggregation","getElevationWeight"],Ee=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:Se,elevationScaleFunc:Se,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=Pe(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.transitions;return new(this.getSubLayerClass("grid-cell",me.a))({cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(pe.a);Ee.layerName="CPUGridLayer",Ee.defaultProps=je;var Ae=n(170),Te=Math.PI/3,Me=[0,Te,2*Te,3*Te,4*Te,5*Te];function Le(e){return e[0]}function Ie(e){return e[1]}var Re=function(){var e,t,n,i=0,r=0,a=1,o=1,s=Le,u=Ie;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var g=l-d,p=d+(ly*y+b*b&&(d=p+(1&h?1:-1)/2,h=m)}var _=d+"-"+h,x=r[_];x?x.push(c):(a.push(x=r[_]=[c]),x.x=(d+(1&h)/2)*t,x.y=h*n)}return a}function l(e){var t=0,n=0;return Me.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.transitions,o=this.state,s=o.angle,u=o.radius;return new(this.getSubLayerClass("hexagon-cell",Ae.a))({radius:u,diskResolution:6,elevationScale:t,angle:s,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(pe.a);Be.layerName="HexagonLayer",Be.defaultProps=De;var Ue,Ve=n(22),Ge=n(222),We=n(131),He={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Xe=[He.W,He.SW,He.S],qe=[He.S,He.SE,He.E],Ze=[He.E,He.NE,He.N],Ye=[He.NW,He.W,He.N],Ke=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],Qe=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Je=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],$e=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],et=[He.W,He.SW,He.SE,He.E],tt=[He.S,He.SE,He.NE,He.N],nt=[He.NW,He.W,He.E,He.NE],it=[He.NW,He.SW,He.S,He.N],rt=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],at=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],ot=[He.NW,He.SW,He.SE,He.NE],st=[He.NW,He.SW,He.SE,He.E,He.N],ut=[He.W,He.SW,He.SE,He.NE,He.N],ct=[He.NW,He.W,He.S,He.SE,He.NE],lt=[He.NW,He.SW,He.S,He.E,He.NE],ft=[He.NW,He.W,[.5,-1/6],[.5,1/6],He.N],ht=[[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],dt=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E],vt=[He.W,He.SW,He.S,[1/6,.5],[-1/6,.5]],gt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.N],pt=[[-.5,1/6],[-.5,-1/6],He.E,He.NE,He.N],mt=[He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],yt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6]],bt=[He.W,He.SW,He.SE,He.E,[1/6,.5],[-1/6,.5]],_t=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.NE,He.N],xt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.E,He.NE],wt=[He.NW,He.SW,He.S,[.5,-1/6],[.5,1/6],He.N],Ot=[He.W,He.SW,He.S,He.E,He.NE,He.N],Pt=[He.NW,He.W,He.S,He.SE,He.E,He.N],St=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],jt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],kt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],He.N],Ct=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],Et=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],At={0:[],1:[[He.W,He.S]],2:[[He.S,He.E]],3:[[He.W,He.E]],4:[[He.N,He.E]],5:{0:[[He.W,He.S],[He.N,He.E]],1:[[He.W,He.N],[He.S,He.E]]},6:[[He.N,He.S]],7:[[He.W,He.N]],8:[[He.W,He.N]],9:[[He.N,He.S]],10:{0:[[He.W,He.N],[He.S,He.E]],1:[[He.W,He.S],[He.N,He.E]]},11:[[He.N,He.E]],12:[[He.W,He.E]],13:[[He.S,He.E]],14:[[He.W,He.S]],15:[]};function Tt(e){return parseInt(e,4)}var Mt=(Ue={},P()(Ue,Tt("0000"),[]),P()(Ue,Tt("2222"),[]),P()(Ue,Tt("2221"),[Xe]),P()(Ue,Tt("2212"),[qe]),P()(Ue,Tt("2122"),[Ze]),P()(Ue,Tt("1222"),[Ye]),P()(Ue,Tt("0001"),[Xe]),P()(Ue,Tt("0010"),[qe]),P()(Ue,Tt("0100"),[Ze]),P()(Ue,Tt("1000"),[Ye]),P()(Ue,Tt("2220"),[Ke]),P()(Ue,Tt("2202"),[Qe]),P()(Ue,Tt("2022"),[Je]),P()(Ue,Tt("0222"),[$e]),P()(Ue,Tt("0002"),[Ke]),P()(Ue,Tt("0020"),[Qe]),P()(Ue,Tt("0200"),[Je]),P()(Ue,Tt("2000"),[$e]),P()(Ue,Tt("0011"),[et]),P()(Ue,Tt("0110"),[tt]),P()(Ue,Tt("1100"),[nt]),P()(Ue,Tt("1001"),[it]),P()(Ue,Tt("2211"),[et]),P()(Ue,Tt("2112"),[tt]),P()(Ue,Tt("1122"),[nt]),P()(Ue,Tt("1221"),[it]),P()(Ue,Tt("2200"),[rt]),P()(Ue,Tt("2002"),[at]),P()(Ue,Tt("0022"),[rt]),P()(Ue,Tt("0220"),[at]),P()(Ue,Tt("1111"),[ot]),P()(Ue,Tt("1211"),[st]),P()(Ue,Tt("2111"),[ut]),P()(Ue,Tt("1112"),[ct]),P()(Ue,Tt("1121"),[lt]),P()(Ue,Tt("1011"),[st]),P()(Ue,Tt("0111"),[ut]),P()(Ue,Tt("1110"),[ct]),P()(Ue,Tt("1101"),[lt]),P()(Ue,Tt("1200"),[ft]),P()(Ue,Tt("0120"),[ht]),P()(Ue,Tt("0012"),[dt]),P()(Ue,Tt("2001"),[vt]),P()(Ue,Tt("1022"),[ft]),P()(Ue,Tt("2102"),[ht]),P()(Ue,Tt("2210"),[dt]),P()(Ue,Tt("0221"),[vt]),P()(Ue,Tt("1002"),[gt]),P()(Ue,Tt("2100"),[pt]),P()(Ue,Tt("0210"),[mt]),P()(Ue,Tt("0021"),[yt]),P()(Ue,Tt("1220"),[gt]),P()(Ue,Tt("0122"),[pt]),P()(Ue,Tt("2012"),[mt]),P()(Ue,Tt("2201"),[yt]),P()(Ue,Tt("0211"),[bt]),P()(Ue,Tt("2110"),[_t]),P()(Ue,Tt("1102"),[xt]),P()(Ue,Tt("1021"),[wt]),P()(Ue,Tt("2011"),[bt]),P()(Ue,Tt("0112"),[_t]),P()(Ue,Tt("1120"),[xt]),P()(Ue,Tt("1201"),[wt]),P()(Ue,Tt("2101"),[Ot]),P()(Ue,Tt("0121"),[Ot]),P()(Ue,Tt("1012"),[Pt]),P()(Ue,Tt("1210"),[Pt]),P()(Ue,Tt("0101"),{0:[Xe,Ze],1:[Ot],2:[Ot]}),P()(Ue,Tt("1010"),{0:[Ye,qe],1:[Pt],2:[Pt]}),P()(Ue,Tt("2121"),{0:[Ot],1:[Ot],2:[Xe,Ze]}),P()(Ue,Tt("1212"),{0:[Pt],1:[Pt],2:[Ye,qe]}),P()(Ue,Tt("2120"),{0:[St],1:[St],2:[Ke,Ze]}),P()(Ue,Tt("2021"),{0:[jt],1:[jt],2:[Xe,Je]}),P()(Ue,Tt("1202"),{0:[kt],1:[kt],2:[Ye,Qe]}),P()(Ue,Tt("0212"),{0:[Ct],1:[Ct],2:[qe,$e]}),P()(Ue,Tt("0102"),{0:[Ke,Ze],1:[St],2:[St]}),P()(Ue,Tt("0201"),{0:[Xe,Je],1:[jt],2:[jt]}),P()(Ue,Tt("1020"),{0:[Ye,Qe],1:[kt],2:[kt]}),P()(Ue,Tt("2010"),{0:[qe,$e],1:[Ct],2:[Ct]}),P()(Ue,Tt("2020"),{0:[$e,Qe],1:[Et],2:[Ke,Je]}),P()(Ue,Tt("0202"),{0:[Je,Ke],1:[Et],2:[$e,Qe]}),Ue),Lt={ISO_LINES:1,ISO_BANDS:2},It={zIndex:0,zOffset:.005};function Rt(e,t){return Array.isArray(t)?e=t?1:0}function Ft(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,f=s||u||c||l,h={},d={};s||l?d.top=0:(h.top=t[(i+1)*r+n],d.top=Rt(h.top,o)),u||l?d.topRight=0:(h.topRight=t[(i+1)*r+n+1],d.topRight=Rt(h.topRight,o)),u||c?d.right=0:(h.right=t[i*r+n+1],d.right=Rt(h.right,o)),s||c?d.current=0:(h.current=t[i*r+n],d.current=Rt(h.current,o));var v=d.top,g=d.topRight,p=d.right,y=d.current,b=-1;Number.isFinite(o)&&(b=v<<3|g<<2|p<<1|y),Array.isArray(o)&&(b=v<<6|g<<4|p<<2|y);var _=0;return f||(_=Rt((h.top+h.topRight+h.right+h.current)/4,o)),{code:b,meanCode:_}}function Dt(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?Lt.ISO_LINES:s,c=Object.assign({},It,e.thresholdData),l=u===Lt.ISO_BANDS?Mt[a]:At[a];Array.isArray(l)||(l=l[o]);var f=c.zIndex*c.zOffset,h=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+h,g=t[1]+d;if(u===Lt.ISO_BANDS){var p=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=g+e[1]*n[1];t.push([i,r,f])}),p.push(t)}),p}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=g+e[1]*n[1];m.push([t,i,f])})}),m}var Nt=n(64),zt=n(31),Bt=g.experimental.count,Ut=k.a.fp64LowPart,Vt=6378e3;function Gt(e){return Number.isFinite(e)?e:0}function Wt(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,f=void 0===l?zt.a.LNGLAT:l,h=e.viewport,d=void 0===h?null:h,v=e.boundingBox,g=void 0===v?null:v,y={};o.dataChanged&&(g=(y=function(e,t,n){var i,r,a=Bt(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,f=-1/0,h={};for(var d in n)h[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(p.a)(e),g=v.iterable,m=v.objectInfo,y=!0,b=!1,_=void 0;try{for(var x,w=g[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;m.index++;var P=t(O,m),S=m.index;for(var j in r=P[0],i=P[1],o[2*S]=r,o[2*S+1]=i,s[2*S]=Ut(r),s[2*S+1]=Ut(i),n){var k=n[j].getWeight(O);Array.isArray(k)?(h[j].values[3*S]=k[0],h[j].values[3*S+1]=k[1],h[j].values[3*S+2]=k[2]):h[j].values[3*S]=k}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rf?r:f)}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var C={xMin:Gt(l),xMax:Gt(f),yMin:Gt(u),yMax:Gt(c)};return{positions:o,positions64xyLow:s,weights:h,boundingBox:C}}(t,n,s)).boundingBox);var b=[i,i],_=[0,0];switch(m.a.assert(f===zt.a.LNGLAT||f===zt.a.IDENTITY),f){case zt.a.LNGLAT:case zt.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/Vt*(180/Math.PI)),i=(r=t,a=e,a/Vt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(g,i);b=[x.xOffset,x.yOffset],_=[-180,-90];break;case zt.a.IDENTITY:_=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=Ht(o-i[0],n[0])+i[0],c=Ht(r-i[1],n[1])+i[1],l=(new Nt.a).translate([-1*u,-1*c,0]),f=[u,c],h=s-o+n[0],d=a-r+n[1],v=[Math.ceil(h/n[0]),Math.ceil(d/n[1])];return{gridOrigin:f,gridSize:v,width:h,height:d,gridTransformMatrix:l}}({boundingBox:g,cellSize:b,worldOrigin:_});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:b,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:b,boundingBox:g}}function Ht(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Xt=[255,255,255,255],qt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},Zt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new se(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ge.a(this._getLineLayerProps()),r&&new We.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:f,gridOrigin:h,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking",k.a]})}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new Kt.a,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,f=n.gridOffset,h=n.elevationRange,d=[Object(Yt.c)(l[0]),Object(Yt.c)(l[1])],v=[Object(Yt.c)(f[0]),Object(Yt.c)(f[1])],g=this.getDomainUniforms(),p={colorMaxMinBuffer:i.color.maxMinBuffer,elevationMaxMinBuffer:i.elevation.maxMinBuffer},m=x(this.props.colorRange);this.bindUniformBuffers(p),this.state.model.setUniforms(Object.assign({},t,g,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:d,gridOffset:f,gridOffsetLow:v,colorRange:m,elevationRange:h})).draw(),this.unbindUniformBuffers(p)}},{key:"bindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.bind({target:35345,index:0}),n.bind({target:35345,index:1})}},{key:"unbindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.unbind({target:35345,index:0}),n.unbind({target:35345,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(b.a);$t.layerName="GPUGridCellLayer",$t.defaultProps=Jt;var en={colorDomain:null,colorRange:_,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new ge.a,gpuAggregation:!0},tn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=se.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new se(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,f=c.getPosition,h=this.state.gridHash;if(!h)h=Pe(l,this.props.cellSize,f).gridHash,this.setState({gridHash:h});var d=h[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,f=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:N[s]||N[en.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:N[c]||N[en.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),h=f.weights,d=f.gridSize,v=f.gridOrigin,g=f.cellSize,p=f.boundingBox;this.setState({weights:h,gridSize:d,gridOrigin:v,cellSize:g,boundingBox:p})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.elevationRange,s=e.colorDomain,u=e.elevationDomain,c=this.state,l=c.weights,f=c.gridSize,h=c.gridOrigin,d=c.cellSize,v=x(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",$t))({gridSize:f,gridOrigin:h,gridOffset:d,colorRange:v,elevationRange:o,colorDomain:s,elevationDomain:u,cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:l,numInstances:f[0]*f[1]})}}]),t}(pe.a);tn.layerName="GPUGridLayer",tn.defaultProps=en;var nn=Object.assign({},tn.defaultProps,Ee.defaultProps,{gpuAggregation:!1}),rn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",tn):this.getSubLayerClass("CPU",Ee))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!se.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(pe.a);rn.layerName="GridLayer",rn.defaultProps=nn;var an=new Float32Array(12);function on(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=0,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0)for(var u=o.value,c=0;c 0.5) {\n discard;\n }\n gl_FragColor.rgb = weightsTexture.rgb * gaussianKDE(2. * dist);\n gl_FragColor.a = 1.0;\n}\n",modules:["project32"],elementCount:1,_targetTexture:n,_targetTextureVarying:"weightsTexture"});this.setState({weightsTexture:n,maxWeightsTexture:i,weightsTransform:r,model:r.model,maxWeightTransform:new I.a(e,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:n},_targetTexture:i,_targetTextureVarying:"outTexture",vs:"#version 300 es\nin vec4 inTexture;\nout vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\n}\n",elementCount:t*t}),zoom:null,triPositionBuffer:new T.a(e,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new T.a(e,{byteLength:48,accessor:{size:2}})})}},{key:"_updateMaxWeightValue",value:function(){this.state.maxWeightTransform.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}},{key:"_updateBounds",value:function(){var e,t,n,i,r,a,o,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0],u=this.state.textureSize,c=this.context.viewport,l=[c.unproject([0,0]),c.unproject([c.width,0]),c.unproject([c.width,c.height]),c.unproject([0,c.height])],f=(t=(e=l).map(function(e){return e[0]}),n=e.map(function(e){return e[1]}),i=Math.min.apply(null,t),r=Math.max.apply(null,t),[i,Math.min.apply(null,n),r,Math.max.apply(null,n)]),h=this._worldToCommonBounds(f),d={visibleWorldBounds:f,viewportCorners:l},v=!1;if(s||!this.state.worldBounds||(a=this.state.worldBounds,!((o=f)[0]>=a[0]&&o[2]<=a[2]&&o[1]>=a[1]&&o[3]<=a[3]))){var g=sn(h,2*u,2*u),p=this._commonToWorldBounds(g);this.props.coordinateSystem===zt.a.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 m=this._worldToCommonBounds(p,{scaleToAspect:!0,normalize:!0,width:2*u,height:2*u});d.worldBounds=p,d.normalizedCommonBounds=m,v=!0}return this.setState(d),v}},{key:"_updateTextureRenderingBounds",value:function(){var e=this.state,t=e.triPositionBuffer,n=e.triTexCoordBuffer,i=e.normalizedCommonBounds,r=e.viewportCorners,a=this.context.viewport,o=i.map(function(e){return e*a.scale});t.subData(on(r,3));var s=r.map(function(e){return t=a.projectPosition(e),n=o,i=j()(n,4),r=i[0],s=i[1],u=i[2],c=i[3],[(t[0]-r)/(u-r),(t[1]-s)/(c-s)];var t,n,i,r,s,u,c});n.subData(on(s,2))}},{key:"_updateColorTexture",value:function(e){var t=e.props.colorRange,n=this.state.colorTexture,i=x(t,!0);n?n.setImageData({data:i,width:t.length}):n=te(this.context.gl,{data:i,width:t.length,parameters:hn}),this.setState({colorTexture:n})}},{key:"_updateWeightmap",value:function(){var e=this.props.radiusPixels,t=this.state,n=t.weightsTransform,i=t.worldBounds,r=t.textureSize;this._updateAttributes(this.props);var a=Object.assign(Object.create(this.props),{viewport:this.context.viewport,pickingActive:0}),o=this._worldToCommonBounds(i,{useLayerCoordinateSystem:!0,scaleToAspect:!0,width:2*r,height:2*r}),s=Object.assign({},n.model.getModuleUniforms(a),{radiusPixels:e,commonBounds:o,textureWidth:r});n.update({elementCount:this.getNumInstances()}),n.run({uniforms:s,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0}),this._updateMaxWeightValue(),this.setState({lastUpdate:Date.now()})}},{key:"_debouncedUpdateWeightmap",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.state.updateTimer,n=Date.now()-this.state.lastUpdate;e&&(t=null),n>=500?(this._updateBounds(!0),this._updateWeightmap(),this._updateTextureRenderingBounds()):t||(t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),500-n)),this.setState({updateTimer:t})}},{key:"_worldToCommonBounds",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.useLayerCoordinateSystem,a=void 0!==r&&r,o=i.scaleToAspect,s=void 0!==o&&o,u=i.width,c=i.height,l=j()(e,4),f=l[0],h=l[1],d=l[2],v=l[3],g=this.context.viewport;a?(t=this.projectPosition([f,v,0]),n=this.projectPosition([d,h,0])):(t=g.projectPosition([f,v,0]),n=g.projectPosition([d,h,0]));var p=t.slice(0,2).concat(n.slice(0,2));return s&&(p=sn(p,u,c)),i.normalize&&(p=p.map(function(e){return e/g.scale})),p}},{key:"_commonToWorldBounds",value:function(e){var t=j()(e,4),n=t[0],i=t[1],r=t[2],a=t[3],o=this.context.viewport,s=o.unprojectPosition([n,a]),u=o.unprojectPosition([r,i]);return s.slice(0,2).concat(u.slice(0,2))}}]),t}(pe.a);vn.layerName="HeatmapLayer",vn.defaultProps=dn,n.d(t,"experimental",function(){return gn}),n.d(t,"ScreenGridLayer",function(){return ve}),n.d(t,"CPUGridLayer",function(){return Ee}),n.d(t,"HexagonLayer",function(){return Be}),n.d(t,"ContourLayer",function(){return Zt}),n.d(t,"GridLayer",function(){return rn}),n.d(t,"GPUGridLayer",function(){return tn}),n.d(t,"AGGREGATION_OPERATION",function(){return N}),n.d(t,"HeatmapLayer",function(){return vn}),n.d(t,"_GPUGridAggregator",function(){return se});var gn={BinSorter:be,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:we,quantizeScale:_e,getQuantizeScale:xe,defaultColorRange:_}},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),f=n(13),h=n.n(f),d=n(7),v=n.n(d),g=n(72),p=n(85),m=n(130),y=n(126),b=n(58),_=n(192),x=n(30),w=n(93),O=Math.PI/180,P=new Float32Array(16),S=new Float32Array(12);function j(e,t,n){var i=t[0]*O,r=t[1]*O,a=t[2]*O,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),f=Math.cos(r),h=n[0],d=n[1],v=n[2];e[0]=h*f*l,e[1]=h*u*l,e[2]=h*-s,e[3]=d*(-u*c+f*s*o),e[4]=d*(f*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+f*s*c),e[7]=v*(-f*o+u*s*c),e[8]=v*l*c}function k(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var C={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),f=l&&16===c.length,h=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),p=f||!l&&Boolean(c(a[0]));e.constant=p?f:d&&h&&v;var m=e.value;if(e.constant){var y;if(p)P.set(c),y=k(P);else j(y=S,o,s),y.set(u,9);e.value=new Float32Array(y)}else{var b=n*e.size,_=Object(g.a)(a,n,i),x=_.iterable,w=_.objectInfo,O=!0,C=!1,E=void 0;try{for(var A,T=x[Symbol.iterator]();!(O=(A=T.next()).done);O=!0){var M=A.value;w.index++;var L=void 0;if(p)P.set(f?c:c(M,w)),L=k(P);else j(L=S,d?o:o(M,w),h?s:s(M,w)),L.set(v?u:u(M,w),9);m[b++]=L[0],m[b++]=L[1],m[b++]=L[2],m[b++]=L[3],m[b++]=L[4],m[b++]=L[5],m[b++]=L[6],m[b++]=L[7],m[b++]=L[8],m[b++]=L[9],m[b++]=L[10],m[b++]=L[11]}}catch(e){C=!0,E=e}finally{try{O||null==T.return||T.return()}finally{if(C)throw E}}}}};function E(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function A(e){if(e.attributes)return E(e.attributes),e instanceof b.a?e:new b.a(e);if(e.positions||e.POSITION)return E(e),new b.a({attributes:e});throw Error("Invalid mesh")}var T={mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},wireframe:!1,material:new _.a,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},M=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=Object(x.d)(this.context.gl),n=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xy;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xy;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xy, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n",i=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor, color.a);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";return h()(l()(t.prototype),"getShaders",this).call(this,{vs:n,fs:i,modules:["project32","phong-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,size:3,accessor:"getPosition"},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:C}),this.setState({emptyTexture:new y.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(h()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||r.extensionsChanged){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new w.a(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:A(e),isInstanced:!0,shaderCache:this.context.shaderCache})),n=this.state,i=n.texture,r=n.emptyTexture;return t.setUniforms({sampler:i||r,hasTexture:Boolean(i)}),t}},{key:"setTexture",value:function(e){var t=this.context.gl,n=this.state,i=n.emptyTexture,r=n.model;this.state.texture&&this.state.texture.delete();var a=e?function(e,t,n){return t instanceof y.a?t:new y.a(e,Object.assign({data:t},n))}(t,e):null;this.setState({texture:a}),r&&r.setUniforms({sampler:a||i,hasTexture:Boolean(a)})}},{key:"calculateInstancePositions64xyLow",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.use64bitPositions();if(e.constant=!r,r){var a=this.props,o=a.data,s=a.getPosition,u=e.value,c=n*e.size,l=Object(g.a)(o,n,i),f=l.iterable,h=l.objectInfo,d=!0,v=!1,m=void 0;try{for(var y,b=f[Symbol.iterator]();!(d=(y=b.next()).done);d=!0){var _=y.value;h.index++;var x=s(_,h);u[c++]=Object(p.c)(x[0]),u[c++]=Object(p.c)(x[1])}}catch(e){v=!0,m=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}}else e.value=new Float32Array(2)}}]),t}(m.a);M.layerName="SimpleMeshLayer",M.defaultProps=T;var L=n(35),I=n.n(L),R=n(92),F=n(26),D=n(219),N=n(4),z=n(5),B=n(64),U=n(212),V=n(43),G=n(59),W=n(19),H=n(10),X=n(9),q=n(11),Z=n(134),Y=n(22),K=n(12);var Q=n(40),J=n(37);function $(){var e=new K.a(4);return K.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ee(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function te(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=i*l+o*s+r*c-a*u,e[1]=r*l+o*u+a*s-i*c,e[2]=a*l+o*c+i*u-r*s,e[3]=o*l-i*s-r*u-a*c,e}function ne(e,t,n,i){var r,a,o,s,u,c=t[0],l=t[1],f=t[2],h=t[3],d=n[0],v=n[1],g=n[2],p=n[3];return(a=c*d+l*v+f*g+h*p)<0&&(a=-a,d=-d,v=-v,g=-g,p=-p),1-a>K.b?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,u=Math.sin(i*r)/o):(s=1-i,u=i),e[0]=s*c+u*d,e[1]=s*l+u*v,e[2]=s*f+u*g,e[3]=s*h+u*p,e}function ie(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*n,n=.5/n,e[3]=(t[3*a+o]-t[3*o+a])*n,e[a]=(t[3*a+r]+t[3*r+a])*n,e[o]=(t[3*o+r]+t[3*r+o])*n}return e}J.b,J.g,J.c;var re,ae,oe,se,ue,ce,le,fe=J.l,he=J.a,de=J.k,ve=J.d,ge=J.i,pe=J.h,me=J.m,ye=J.j,be=(J.f,J.e,re=Q.b(),ae=Q.e(1,0,0),oe=Q.e(0,1,0),function(e,t,n){var i=Q.d(t,n);return i<-.999999?(Q.c(re,ae,t),Q.f(re)<1e-6&&Q.c(re,oe,t),Q.i(re,re),ee(e,re,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Q.c(re,t,n),e[0]=re[0],e[1]=re[1],e[2]=re[2],e[3]=1+i,ye(e,e))}),_e=(se=$(),ue=$(),ce=new K.a(9),K.a!=Float32Array&&(ce[1]=0,ce[2]=0,ce[3]=0,ce[5]=0,ce[6]=0,ce[7]=0),ce[0]=1,ce[4]=1,ce[8]=1,le=ce,[0,0,0,1]);var xe=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(N.a)(this,t),e=Object(H.a)(this,Object(X.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,a),e}return Object(q.a)(t,e),Object(z.a)(t,[{key:"fromMatrix3",value:function(e){return ie(this,e),this.check()}},{key:"fromValues",value:function(e,t,n,i){return this.set(e,t,n,i)}},{key:"identity",value:function(){var e;return(e=this)[0]=0,e[1]=0,e[2]=0,e[3]=1,this.check()}},{key:"length",value:function(){return pe(this)}},{key:"squaredLength",value:function(e){return me(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ve(this,e)}},{key:"rotationTo",value:function(e,t){return be(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return he(this,e),this.check()}},{key:"calculateW",value:function(){var e,t,n,i,r;return e=this,n=(t=this)[0],i=t[1],r=t[2],e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),this.check()}},{key:"conjugate",value:function(){var e,t;return t=this,(e=this)[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],this.check()}},{key:"invert",value:function(){var e,t,n,i,r,a,o,s;return e=this,n=(t=this)[0],i=t[1],r=t[2],a=t[3],s=(o=n*n+i*i+r*r+a*a)?1/o:0,e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=a*s,this.check()}},{key:"lerp",value:function(e,t,n){return ge(this,e,t,n),this.check()}},{key:"multiply",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.multiply only takes one argument");return te(this,this,e),this.check()}},{key:"normalize",value:function(){return ye(this,this),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+o*s,e[1]=r*u+a*s,e[2]=a*u-r*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u-a*s,e[1]=r*u+o*s,e[2]=a*u+i*s,e[3]=o*u-r*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return de(this,this,e),this.check()}},{key:"set",value:function(e,t,n,i){return fe(this,e,t,n,i),this.check()}},{key:"setAxisAngle",value:function(e,t){return ee(this,e,t),this.check()}},{key:"slerp",value:function(e){var t=e.start;return ne(this,void 0===t?_e:t,e.target,e.ratio),this.check()}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=Object(Y.a)(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=Object(Y.a)(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(Y.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(Y.a)(e)}}]),t}(Z.a),we={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Oe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Pe(e){if(!e._animation){var t=Oe[e.componentType],n=we[e.type],i=n*e.count,r=e.bufferView.data,a=new t(r.buffer,r.byteOffset+(e.byteOffset||0),i);if(1===n)e._animation=Array.from(a);else{for(var o=[],s=0;s=s}),c=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:F.a.warn("Bad animation path ".concat(i))()}Object(W.a)(n[i].length===o[c].length);var l=r[c],f=r[u];switch(a){case"STEP":!function(e,t,n){for(var i=0;il){var h=(s-l)/(f-l);!function(e,t,n,i,r){if("rotation"===t){je.slerp({start:n,target:i,ratio:r});for(var a=0;al){var d=(s-l)/(f-l),v=f-l;!function(e,t,n){for(var i=n.p0,r=n.outTangent0,a=n.inTangent1,o=n.p1,s=n.tDiff,u=n.ratio,c=0;c2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},r=new y.a(this.gl,{id:e.name||e.id,parameters:i,pixelStore:Object(Me.a)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1),data:e.texture.source.getImageAsync()});this.uniforms[t]=r,this.defineIfPresent(n,n),this.generatedTextures.push(r)}},{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 t=e.metallicFactor,n=void 0===t?1:t,i=e.roughnessFactor,r=void 0===i?1:i;this.uniforms.u_MetallicRoughnessValues=[n,r]}},{key:"parseMaterial",value:function(e){if(e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,n=void 0===t?1:t;this.uniforms.u_NormalScale=n}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,r=void 0===i?1:i;this.uniforms.u_OcclusionStrength=r}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(F.a.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]}))}}]),e}(),Ie="\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n",Re="\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n";function Fe(e,t){return Object(x.d)(e)?"#version 300 es\n".concat(t):t}var De={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ne={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},ze=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(N.a)(this,e),this.gl=t,this.options=Object.assign({},Ne,n)}return Object(z.a)(e,[{key:"instantiate",value:function(e){var t=this;return this.gltf=e,(e.scenes||[]).map(function(e){return t.createScene(e)})}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new Ee(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new U.a({id:e.name||e.id,children:n})}},{key:"createNode",value:function(e){var t=this;if(!e._node){var n=(e.children||[]).map(function(e){return t.createNode(e)});e.mesh&&n.push(this.createMesh(e.mesh));var i=new U.a({id:e.name||e.id,children:n});if(e.matrix)i.setMatrix(e.matrix);else{if(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation){var r=(new B.a).fromQuaternion(e.rotation);i.matrix.multiplyRight(r)}e.scale&&i.matrix.scale(e.scale)}e._node=i}return e._node}},{key:"createMesh",value:function(e){var t=this;if(!e._mesh){var n=(e.primitives||[]).map(function(n,i){return t.createPrimitive(n,i,e)}),i=new U.a({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){F.a.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,t,n){return function(e,t){var n=t.id,i=t.drawMode,r=t.vertexCount,a=t.attributes,o=t.modelOptions,s=new Le(e,t);F.a.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,Object(Ae.a)(s.generatedTextures)),u.push.apply(u,Object(Ae.a)(Object.values(a).map(function(e){return e.buffer})));var c=new Te.a(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[D.a],defines:s.defines,parameters:s.parameters,vs:Fe(e,Ie),fs:Fe(e,Re),managedResources:u},o));return c.setProps({attributes:a}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:e.name||"".concat(n.name||n.id,"-primitive-").concat(t),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))}},{key:"createAttributes",value:function(e,t){var n=this,i={};return Object.keys(e).forEach(function(t){i[t]=n.createAccessor(e[t],n.createBuffer(e[t],n.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),F.a.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}},{key:"createBuffer",value:function(e,t){e.bufferView||(e.bufferView={});var n=e.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new V.a(this.gl,{id:"from-".concat(n.id),data:n.data||e.value,target:t})),n.lumaBuffers[t]}},{key:"createAccessor",value:function(e,t){return new G.a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:De[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();var Be=n(50),Ue=n.n(Be),Ve=n(153),Ge=n.n(Ve);function We(){return(We=Ge()(Ue.a.mark(function e(t){var n;return Ue.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach(function(e){e.traverse(function(e){Object.values(e.model.program.uniforms).forEach(function(e){!1===e.loaded&&n.push(e)})})}),e.next=4,He(function(){return n.some(function(e){return!e.loaded})});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function He(e){return Xe.apply(this,arguments)}function Xe(){return(Xe=Ge()(Ue.a.mark(function e(t){return Ue.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise(function(e){return requestAnimationFrame(e)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}var qe=[255,255,255,255],Ze={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"===I()(e.scene)?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:qe},_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:[]}},Ye=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,accessor:"getPosition",transition:!0},instancePositions64xy:{size:2,accessor:"getPosition",update:this.calculateInstancePositions64xyLow},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:qe,transition:!0},instanceModelMatrix:C})}},{key:"updateState",value:function(e){h()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;n.scenegraph!==i.scenegraph?this._updateScenegraph(n):n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){h()(l()(t.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t,n=this,i=this.context.gl;if(e.scenegraph instanceof R.a)t={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,a=function(e,t,n){var i=new ze(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(i,r,this.getLoadOptions());t=Object.assign({gltf:r},a),function(e){return We.apply(this,arguments)}(a).then(function(){return n.setNeedsRedraw()})}else F.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader"),t=e.scenegraph;var o={layer:this,gl:i},s=e.getScene(t,o),u=e.getAnimator(t,o);s instanceof R.a?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&F.a.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).sort().forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r0)return e;e=function(e){var t=e.padEnd(16,"0");return O.a.fromString(t,16)}(e)}return x.S2.S2Cell.toHilbertQuadkey(e.toString())}function k(e){var t=j(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],f=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,S*Math.pow(2,-c)),d=0;d<4;d++)for(var v=f[d].slice(0),g=f[d+1],p=(g[0]-v[0])/h,m=(g[1]-v[1])/h,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(L.g)([r[0],r[3]],e.scale).map(R),o=_()(a,2),s=o[0],u=o[1],c=Object(L.g)([r[2],r[1]],e.scale).map(R),l=_()(c,2),f=l[0],h=l[1];s=Math.max(0,Math.floor(s)),f=Math.min(e.scale,Math.ceil(f)),u=Math.max(0,Math.floor(u)),h=Math.min(e.scale,Math.ceil(h));for(var d=[],v=s;vt?d.push(F({x:v,y:g,z:i},t)):d.push({x:v,y:g,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),N={renderSubLayers:{type:"function",value:function(e){return new A.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},z=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new D({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new D({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var f=i.viewport,h=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==f.id&&this.state.tileCache.update(f,function(e){var n=e.filter(function(e){return e.z===h}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"color.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){h()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),h()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),f=Object(U.a)(a,n,i),h=f.iterable,d=f.objectInfo,v=0,g=0;g180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function Q(e,t,n){var i=e(t,n),r=Object(G.h3ToGeo)(i),a=_()(r,2),o=a[0];return[a[1],o]}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(G.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(G.h3ToGeo)(e),r=_()(i,2),a=r[0],o=r[1],s=t.length;K(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(G.edgeLength)(i,G.UNITS.km):0,hasPentagon:r})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(G.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(G.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=J(a),u=Object(G.h3ToGeo)(a),c=_()(u,2),l=c[0],f=c[1],h=e.projectFlat([f,l]),d=_()(h,2),v=d[0],g=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-g)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.material,i=e.coverage,r=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,f=e.lineWidthMaxPixels,h=e.getColor,d=e.getFillColor,v=e.getElevation,g=e.getLineColor,p=e.getLineWidth,m=e.updateTriggers;return{elevationScale:t,extruded:r,coverage:i,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:f,material:n,getElevation:v,getFillColor:h||d,getLineColor:g,getLineWidth:p,updateTriggers:{getFillColor:m.getColor||m.getFillColor,getElevation:m.getElevation,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===q()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return J(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",Y.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Q.bind(null,n)})}}]),t}(m.a);ee.defaultProps=$,ee.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return p}),n.d(t,"S2Layer",function(){return E}),n.d(t,"TileLayer",function(){return z}),n.d(t,"TripsLayer",function(){return V}),n.d(t,"H3ClusterLayer",function(){return H}),n.d(t,"H3HexagonLayer",function(){return ee})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(35),u=n.n(s);var c=n(164),l=n(214),f=n(215),h=n(216),d=n(6),v=n.n(d),g=n(3),p=n.n(g),m=n(7),y=n.n(m),b={fetch:function(e){return JSON.parse(e)},configuration:[]},_=function(e){function t(){return r()(this,t),v()(this,p()(t).apply(this,arguments))}return y()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layers:[]}}},{key:"updateState",value:function(e){var t=e.props,n=e.oldProps;(e.changeFlags.dataChanged||t.configuration!==n.configuration)&&(this.state.layers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t){var n={};for(var i in e){var r=e[i];i.startsWith("get")?n[i]=D(r,t):n[i]=r}return n}(e,t);return r.fetch=N,i&&new i(r)})}(t.data,t.configuration))}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(193).a);function x(e,t){var n=function(e){if("string"==typeof e){var t=O[e];return t||(t=e.split("."),O[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=w(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function w(e){return null!==e&&"object"===u()(e)}_.layerName="JSONLayer",_.defaultProps=b;var O={};var P={},S={},j=34,k=10,C=13;function E(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var A=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return S;if(c)return c=!1,P;var t,i,r=o;if(e.charCodeAt(r)===j){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===k?c=!0:i===C&&(c=!0,e.charCodeAt(o)===k&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u]);Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var z=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=F(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return z}),n.d(t,"_JSONLayer",function(){return _})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(194);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},f=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":t="pointermove",i=e._onPointerMove;break;case"mouseout":t="pointerleave",i=e._onPointerMove;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv().firstChild,i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),f=new google.maps.Point(0,0),h=a.fromContainerPixelToLatLng(f),d=a.fromLatLngToDivPixel(h),v=(c.x-l.x)/i,g=Math.log2(v)+e.getZoom()-1,p=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(p),y=m.lat(),b=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:g,pitch:e.getTilt(),latitude:y,longitude:b}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,f=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:f?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return f})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(194),u=n(165);function c(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[770,771,1,771],blendEquation:32774},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:l(t)}),i=new s.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:l(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=h(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[f(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function l(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function f(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new u.a(Object.assign({x:0,y:0,width:e.width,height:e.height},l(t),n?{nearZMultiplier:e.height?1/e.height:1,farZMultiplier:1}:{nearZMultiplier:.1,farZMultiplier:10}))}function h(e,t){return e.layerManager.getLayers().filter(t)}function d(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function v(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var g=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=c({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),v(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),v(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&v(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=f(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:h(n,function(e){return d(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return g})},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(86),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()}])}); +!function(r,a,o,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=a.createElement("div"),h="function",f=Math.round,d=Math.abs,v=Date.now;function p(e,t,n){return setTimeout(w(e,n),t)}function g(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=r.console&&(r.console.warn||r.console.log);return a&&a.call(r.console,i,n),e.apply(this,arguments)}}u="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function T(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function L(e,t){for(var n,i,r=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=ne(t):1===r&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,u=o?o.center:a.center,c=t.center=ie(i);t.timeStamp=v(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=se(u,c),t.distance=oe(u,c),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},a=e.prevInput||{};t.eventType!==B&&a.eventType!==V||(r=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ae(t.deltaX,t.deltaY);var l=re(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=d(l.x)>d(l.y)?l.x:l.y,t.scale=o?(h=o.pointers,f=i,oe(f[0],f[1],$)/oe(h[0],h[1],$)):1,t.rotation=o?function(e,t){return se(t[1],t[0],$)+se(e[1],e[0],$)}(o.pointers,i):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,i,r,a,o=e.lastInterval||t,u=t.timeStamp-o.timeStamp;if(t.eventType!=G&&(u>z||o.velocity===s)){var c=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,h=re(u,c,l);i=h.x,r=h.y,n=d(h.x)>d(h.y)?h.x:h.y,a=ae(c,l),e.lastInterval=t}else n=o.velocity,i=o.velocityX,r=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=i,t.velocityY=r,t.direction=a}(n,t);var h,f;var p=e.element;k(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ne(e){for(var t=[],n=0;n=d(t)?e<0?H:X:t<0?q:Z}function oe(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function se(e,t,n){n||(n=J);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}ee.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(R(this.element),this.evWin,this.domHandler)}};var ue={mousedown:B,mousemove:U,mouseup:V},ce="mousedown",le="mousemove mouseup";function he(){this.evEl=ce,this.evWin=le,this.pressed=!1,ee.apply(this,arguments)}x(he,ee,{handler:function(e){var t=ue[e.type];t&B&&0===e.button&&(this.pressed=!0),t&U&&1!==e.which&&(t=V),this.pressed&&(t&V&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var fe={pointerdown:B,pointermove:U,pointerup:V,pointercancel:G,pointerout:G},de={2:"touch",3:"pen",4:"mouse",5:"kinect"},ve="pointerdown",pe="pointermove pointerup pointercancel";function ge(){this.evEl=ve,this.evWin=pe,ee.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ve="MSPointerDown",pe="MSPointerMove MSPointerUp MSPointerCancel"),x(ge,ee,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=fe[i],a=de[e.pointerType]||e.pointerType,o="touch"==a,s=T(t,e.pointerId,"pointerId");r&B&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):r&(V|G)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var me={touchstart:B,touchmove:U,touchend:V,touchcancel:G},ye="touchstart",be="touchstart touchmove touchend touchcancel";function _e(){this.evTarget=ye,this.evWin=be,this.started=!1,ee.apply(this,arguments)}x(_e,ee,{handler:function(e){var t=me[e.type];if(t===B&&(this.started=!0),this.started){var n=function(e,t){var n=A(e.touches),i=A(e.changedTouches);t&(V|G)&&(n=M(n.concat(i),"identifier",!0));return[n,i]}.call(this,e,t);t&(V|G)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:e})}}});var xe={touchstart:B,touchmove:U,touchend:V,touchcancel:G},we="touchstart touchmove touchend touchcancel";function Oe(){this.evTarget=we,this.targetIds={},ee.apply(this,arguments)}x(Oe,ee,{handler:function(e){var t=xe[e.type],n=function(e,t){var n=A(e.touches),i=this.targetIds;if(t&(B|U)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,a,o=A(e.changedTouches),s=[],u=this.target;if(a=n.filter(function(e){return k(e.target,u)}),t===B)for(r=0;r-1&&i.splice(e,1)},Pe)}}x(je,ee,{handler:function(e,t,n){var i="touch"==n.pointerType,r="mouse"==n.pointerType;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,ke.call(this,t)):e&(V|G)&&ke.call(this,t)}).call(this,t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function i(n){t.manager.emit(n,e)}n=Be&&i(t.options.event+We(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return qe.prototype.attrTest.call(this,e)&&(this.state&Ne||!(this.state&Ne)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(Ye,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ne)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Ke,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(V|G)&&!r)this.reset();else if(e.eventType&B)this.reset(),this._timer=p(function(){this.state=Ue,this.tryEmit()},t.time,this);else if(e.eventType&V)return Ue;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ue&&(e&&e.eventType&V?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=v(),this.manager.emit(this.options.event,this._input)))}}),x(Qe,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ne)}}),x(Je,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return Ze.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|K)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&e.eventType&V},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x($e,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;j(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:C(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=i}catch(e){Function("r","regeneratorRuntime = r")(i)}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return o});var i=n(232),r=n(197);const a={position:"absolute",left:0,top:0,width:"100%",height:"100%"};class o extends r.a{constructor(e={}){if("undefined"==typeof document)throw Error("Deck can only be used in the browser");const{mapCanvas:t,deckCanvas:n}=function(e){let{container:t=document.body}=e;if("string"==typeof t&&(t=document.getElementById(t)),!t)throw Error("Deck: container not found");"static"===window.getComputedStyle(t).position&&(t.style.position="relative");const n=document.createElement("div");t.appendChild(n),Object.assign(n.style,a);const i=document.createElement("canvas");return t.appendChild(i),Object.assign(i.style,a),{container:t,mapCanvas:n,deckCanvas:i}}(e),r=e.initialViewState||function(e){if(!e.viewState&&"latitude"in e&&"longitude"in e&&"zoom"in e){const{latitude:t,longitude:n,zoom:i,pitch:r=0,bearing:a=0}=e;return{latitude:t,longitude:n,zoom:i,pitch:r,bearing:a}}return e.viewState}(e),o=Number.isFinite(r.latitude),{map:s=window.mapboxgl,controller:u=!0}=e;super(Object.assign({},e,{width:"100%",height:"100%",canvas:n,controller:u,initialViewState:r})),s&&s.Map?this._map=o&&new i.a(Object.assign({},e,{viewState:r,container:t,mapboxgl:s})):this._map=s,this._onBeforeRender=(e=>{if(this.onBeforeRender(e),this._map){const e=this.getViewports()[0];this._map.setProps({width:e.width,height:e.height,viewState:e})}})}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"onBeforeRender"in e&&this._onBeforeRender&&e.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=e.onBeforeRender,e.onBeforeRender=this._onBeforeRender),super.setProps(e)}}},function(e,t,n){"use strict";var i=n(263);function r(){}e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){!function(n){"use strict";var i=function(e,t){var n=new Error(e+" at character "+t);throw n.index=t,n.description=e,n},r={"-":!0,"!":!0,"~":!0,"+":!0},a={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},o=function(e){var t,n=0;for(var i in e)(t=i.length)>n&&e.hasOwnProperty(i)&&(n=t);return n},s=o(r),u=o(a),c={true:!0,false:!1,null:null},l=function(e){return a[e]||0},h=function(e,t,n){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:n}},f=function(e){return e>=48&&e<=57},d=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&!a[String.fromCharCode(e)]},v=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e>=128&&!a[String.fromCharCode(e)]},p=function(e){for(var t,n,o=0,p=e.charAt,g=e.charCodeAt,m=function(t){return p.call(e,t)},y=function(t){return g.call(e,t)},b=e.length,_=function(){for(var e=y(o);32===e||9===e||10===e||13===e;)e=y(++o)},x=function(){var e,t,n=O();return _(),63!==y(o)?n:(o++,(e=x())||i("Expected expression",o),_(),58===y(o)?(o++,(t=x())||i("Expected expression",o),{type:"ConditionalExpression",test:n,consequent:e,alternate:t}):void i("Expected :",o))},w=function(){_();for(var t=e.substr(o,u),n=t.length;n>0;){if(a.hasOwnProperty(t)&&(!d(y(o))||o+t.length2&&n<=r[r.length-2].prec;)u=r.pop(),t=r.pop().value,s=r.pop(),e=h(t,s,u),r.push(e);(e=P())||i("Expected expression after "+t,o),r.push(a,e)}for(e=r[c=r.length-1];c>1;)e=h(r[c-1].value,r[c-2],e),c-=2;return e},P=function(){var t,n,i;if(_(),t=y(o),f(t)||46===t)return S();if(39===t||34===t)return j();if(91===t)return A();for(i=(n=e.substr(o,s)).length;i>0;){if(r.hasOwnProperty(n)&&(!d(y(o))||o+n.length1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(Number.isFinite(e[0]))t=new i(e);else{t=new i(4*e.length);for(var r=0,a=0;ae?t:e}function U(e,t){return t1&&void 0!==arguments[1]?arguments[1]:{},n=t.width,i=void 0===n?1:n,r=t.height,a=void 0===r?1:r,o=t.data,s=void 0===o?null:o,u=t.unpackFlipY,c=void 0===u||u,l=t.parameters,h=void 0===l?ee:l;return new J.a(e,{data:s,format:34836,type:5126,border:0,mipmaps:!1,parameters:h,dataFormat:6408,width:i,height:a,unpackFlipY:c})}function ne(e,t){var n=t.id,i=t.width,r=void 0===i?1:i,a=t.height,o=void 0===a?1:a,s=t.texture;return new $.a(e,{id:n,width:r,height:o,attachments:P()({},36064,s)})}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return!e||e.length1&&void 0!==arguments[1]?arguments[1]:{};r()(this,e),this.id=n.id||"gpu-grid-aggregator",this.shaderCache=n.shaderCache||null,this.gl=t,this.state={weights:null,gridPositions:null,positionsBuffer:null,positions64xyLowBuffer:null,vertexCount:0,fp64:null,useGPU:null,numCol:0,numRow:0,windowSize:null,cellSize:null,weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(C.d)(t)&&Object(E.c)(this.gl,T.a.BLEND_EQUATION_MINMAX,T.a.COLOR_ATTACHMENT_RGBA32F,T.a.TEXTURE_FLOAT)}return o()(e,null,[{key:"getAggregationData",value:function(e){var t=e.aggregationData,n=e.maxData,i=e.minData,r=e.maxMinData,a=4*e.pixelIndex,o={};return t&&(o.cellCount=t[a+3],o.cellWeight=t[a]),r?(o.maxCellWieght=r[0],o.minCellWeight=r[3]):(n&&(o.maxCellWieght=n[0],o.totalCount=n[3]),i&&(o.minCellWeight=i[0],o.totalCount=n[3])),o}},{key:"getCellData",value:function(e){for(var t=e.countsData,n=e.size,i=void 0===n?1:n,r=t.length/4,a=new Float32Array(r*i),o=new Uint32Array(r),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var t=this.getAggregationParams(e);this.updateGridSize(t);var n=t.useGPU;return this._hasGPUSupport&&n?this.runAggregationOnGPU(t):(n&&m.a.warn("GPUGridAggregator: GPU Aggregation not supported, falling back to CPU")(),this.runAggregationOnCPU(t))}},{key:"getData",value:function(e){var t={},n=this.state.results;for(var i in n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData,oe){var r=oe[i];(n[e][i]||n[e][r])&&(n[e][i]=n[e][i]||n[e][r].getData(),t[i]=n[e][i])}return t}},{key:"deleteResources",value:function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){for(var t in e)e[t].delete()})}},{key:"getAggregationParams",value:function(e){var t=Object.assign({},H,e),n=t.useGPU,i=t.gridTransformMatrix,r=t.viewport,a=t.weights,o=t.projectPoints,s=t.cellSize;return this.state.useGPU!==n&&(t.changeFlags=Object.assign({},t.changeFlags,W)),!s||this.state.cellSize&&this.state.cellSize[0]===s[0]&&this.state.cellSize[1]===s[1]||(t.changeFlags.cellSizeChanged=!0,this.setState({cellSize:s})),this.validateProps(t,e),this.setState({useGPU:n}),t.gridTransformMatrix=(o?r.viewportMatrix:i)||Q,a&&(t.weights=this.normalizeWeightParams(a),this.setState({weights:t.weights})),t}},{key:"normalizeWeightParams",value:function(e){var t={};for(var n in e)t[n]=Object.assign({},K,e[n]);return t}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"shouldTransformToGrid",value:function(e){var t=e.projectPoints,n=e.changeFlags;return!!(!this.state.gridPositions||n.dataChanged||t&&n.viewportChanged)}},{key:"updateGridSize",value:function(e){var t=e.viewport,n=e.cellSize,i=e.width||t.width,r=e.height||t.height,a=Math.ceil(i/n[0]),o=Math.ceil(r/n[1]);this.setState({numCol:a,numRow:o,windowSize:[i,r]})}},{key:"validateProps",value:function(e,t){var n=e.changeFlags,i=e.projectPoints,r=e.gridTransformMatrix;m.a.assert(n.dataChanged||n.viewportChanged||n.cellSizeChanged),m.a.assert(!n.dataChanged||t.positions&&t.weights&&(!t.projectPositions||t.viewport)&&t.cellSize),m.a.assert(!n.cellSizeChanged||t.cellSize),m.a.assert(!(n.viewportChanged&&i)||t.viewport),i&&r&&m.a.warn("projectPoints is true, gridTransformMatrix is ignored")()}},{key:"calculateAggregationData",value:function(e){var t=e.weights,n=e.results,i=e.cellIndex,r=e.posIndex;for(var a in t){for(var o=t[a],s=o.values,u=o.size,c=o.operation,l=n[a].aggregationData,h=0;h=0&&P=0&&S0&&void 0!==arguments[0]&&arguments[0],t=this.gl,n=this.shaderCache;return new L.a(t,{id:"Gird-Aggregation-Model",vs:e?"#define SHADER_NAME gpu-aggregation-to-grid-vs-64\n\nattribute vec2 positions;\nattribute vec2 positions64xyLow;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform vec2 uProjectionMatrixFP64[16];\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvoid project_to_pixel(vec2 pos, vec2 pos64xyLow, out vec2 pixelXY64[2]) {\n\n vec2 result64[4];\n vec2 position64[4];\n position64[0] = vec2(pos.x, pos64xyLow.x);\n position64[1] = vec2(pos.y, pos64xyLow.y);\n position64[2] = vec2(0., 0.);\n position64[3] = vec2(1., 0.);\n mat4_vec4_mul_fp64(uProjectionMatrixFP64, position64,\n result64);\n\n pixelXY64[0] = div_fp64(result64[0], result64[3]);\n pixelXY64[1] = div_fp64(result64[1], result64[3]);\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec2 windowPos = positions;\n vec2 windowPos64xyLow = positions64xyLow;\n if (projectPoints) {\n vec2 projectedXY[2];\n project_position_fp64(windowPos, windowPos64xyLow, projectedXY);\n windowPos.x = projectedXY[0].x;\n windowPos.y = projectedXY[1].x;\n windowPos64xyLow.x = projectedXY[0].y;\n windowPos64xyLow.y = projectedXY[1].y;\n }\n\n vec2 pixelXY64[2];\n project_to_pixel(windowPos, windowPos64xyLow, pixelXY64);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n vec2 pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n":"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec2 positions;\nattribute vec3 weights;\nuniform vec2 windowSize;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform mat4 uProjectionMatrix;\nuniform bool projectPoints;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result = uProjectionMatrix * pos;\n return result.xy/result.w;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 0, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(vec3(positions, 0), vec2(0, 0), vec3(0, 0, 0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n pos = floor(pos / cellSize);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n}\n",modules:e?[F.a]:["project32"],shaderCache:n,vertexCount:0,drawMode:0})}},{key:"getAllAggregationModel",value:function(){var e=this.gl,t=this.shaderCache,n=this.state,i=n.numCol,r=n.numRow;return new L.a(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:[k.a],shaderCache:t,vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:i*r,attributes:{position:[0,0]}})}},{key:"getMeanTransform",value:function(e){return this.meanTransform?this.meanTransform.update(e):this.meanTransform=new I.a(this.gl,Object.assign({},{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n}\n",_targetTextureVarying:"meanValues"},e)),this.meanTransform}},{key:"renderAggregateData",value:function(e){var t=e.cellSize,n=e.viewport,i=e.gridTransformMatrix,r=e.projectPoints,a=this.state,o=a.numCol,s=a.numRow,u=a.windowSize,c=a.maxMinFramebuffers,l=a.minFramebuffers,h=a.maxFramebuffers,f=a.weights,d=[o,s],v={blend:!0,depthTest:!1,blendFunc:[1,1]},p={viewport:n},g={windowSize:u,cellSize:t,gridSize:d,uProjectionMatrix:i,uProjectionMatrixFP64:re(i),projectPoints:r};for(var m in f){var y=f[m],b=y.needMin,_=y.needMax,x=b&&_&&f[m].combineMaxMin;this.renderToWeightsTexture({id:m,parameters:v,moduleSettings:p,uniforms:g,gridSize:d}),x?this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:Z}),gridSize:d,minOrMaxFb:c[m],clearParams:{clearColor:[0,0,0,3.402823466e38]},combineMaxMin:x}):(b&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:X}),gridSize:d,minOrMaxFb:l[m],clearParams:{clearColor:[3.402823466e38,3.402823466e38,3.402823466e38,0]},combineMaxMin:x}),_&&this.renderToMaxMinTexture({id:m,parameters:Object.assign({},v,{blendEquation:q}),gridSize:d,minOrMaxFb:h[m],combineMaxMin:x}))}}},{key:"renderToMaxMinTexture",value:function(e){var t=e.id,n=e.parameters,i=e.gridSize,r=e.minOrMaxFb,a=e.combineMaxMin,o=e.clearParams,s=void 0===o?{}:o,u=this.state.framebuffers,c=this.gl,l=this.allAggregationModel;r.bind(),c.viewport(0,0,i[0],i[1]),Object(R.a)(c,s,function(){c.clear(16384)}),l.draw({parameters:n,uniforms:{uSampler:u[t].texture,gridSize:i,combineMaxMin:a}}),r.unbind()}},{key:"renderToWeightsTexture",value:function(e){var t=e.id,n=e.parameters,i=e.moduleSettings,r=e.uniforms,a=e.gridSize,o=this.state,s=o.framebuffers,u=o.equations,c=o.weightAttributes,l=o.weights,h=this.gl,f=this.gridAggregationModel,d=l[t].operation;s[t].bind(),h.viewport(0,0,a[0],a[1]);var v=d===N.MIN?[3.402823466e38,3.402823466e38,3.402823466e38,0]:[0,0,0,0];Object(R.a)(h,{clearColor:v},function(){h.clear(16384)});var p={weights:c[t]};if(f.draw({parameters:Object.assign({},n,{blendEquation:u[t]}),moduleSettings:i,uniforms:r,attributes:p}),s[t].unbind(),d===N.MEAN){var g=this.state,m=g.meanTextures,y=g.textures,b={_sourceTextures:{aggregationValues:m[t]},_targetTexture:y[t],elementCount:y[t].width*y[t].height};this.getMeanTransform(b).run({parameters:{blend:!1,depthTest:!1}}),s[t].attach(P()({},36064,y[t]))}}},{key:"runAggregationOnGPU",value:function(e){this.updateModels(e),this.setupFramebuffers(e),this.renderAggregateData(e);var t=this.getAggregateData(e);return this.setState({results:t}),t}},{key:"setupFramebuffers",value:function(e){var t=this.state,n=t.numCol,i=t.numRow,r=t.textures,a=t.framebuffers,o=t.maxMinFramebuffers,s=t.minFramebuffers,u=t.maxFramebuffers,c=t.resources,l=t.meanTextures,h=t.equations,f=t.weights,d={width:n,height:i};for(var v in f){var p=f[v],g=p.needMin,m=p.needMax,y=p.combineMaxMin,b=p.operation;r[v]=f[v].aggregationTexture||r[v]||te(this.gl,{id:"".concat(v,"-texture"),width:n,height:i}),r[v].resize(d);var _=r[v];b===N.MEAN&&(l[v]=l[v]||te(this.gl,{id:"".concat(v,"-mean-texture"),width:n,height:i}),l[v].resize(d),_=l[v]),a[v]?a[v].attach(P()({},36064,_)):a[v]=ne(this.gl,{id:"".concat(v,"-fb"),width:n,height:i,texture:_}),a[v].resize(d),h[v]=Y[b],(g||m)&&(g&&m&&y?o[v]||(c["".concat(v,"-maxMin")]=te(this.gl,{id:"".concat(v,"-maxMinTex")}),o[v]=ne(this.gl,{id:"".concat(v,"-maxMinFb"),texture:c["".concat(v,"-maxMin")]})):(g&&(s[v]||(c["".concat(v,"-min")]=te(this.gl,{id:"".concat(v,"-minTex")}),s[v]=ne(this.gl,{id:"".concat(v,"-minFb"),texture:c["".concat(v,"-min")]}))),m&&(u[v]||(c["".concat(v,"-max")]=te(this.gl,{id:"".concat(v,"-maxTex")}),u[v]=ne(this.gl,{id:"".concat(v,"-maxFb"),texture:c["".concat(v,"-max")]})))))}}},{key:"setupModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gridAggregationModel&&this.gridAggregationModel.delete(),this.gridAggregationModel=this.getAggregationModel(e),this.allAggregationModel||(this.allAggregationModel=this.getAllAggregationModel())}},{key:"setupWeightAttributes",value:function(e){var t=this.state,n=t.weightAttributes,i=t.vertexCount,r=t.weights,a=t.resources;for(var o in r){var s=r[o].values;if(Array.isArray(s)||s.constructor===Float32Array){m.a.assert(s.length/3===i);var u=Array.isArray(s)?new Float32Array(s):s;n[o]instanceof A.a?n[o].setData(u):(a["".concat(o,"-buffer")]=new A.a(this.gl,u),n[o]=a["".concat(o,"-buffer")])}else m.a.assert(s instanceof A.a),n[o]=s}}},{key:"trackGPUResultBuffers",value:function(e,t){var n=this.state.resources;for(var i in e)if(e[i])for(var r=0;r= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r ;\n float maxWeight = aggregationData.maxCount.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\nin float vSampleCount;\nout vec4 fragColor;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n fragColor = vColor;\n\n fragColor = picking_filterColor(fragColor);\n}\n"}:{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader-webgl1\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform float maxWeight;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader-webgl1\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n gl_FragColor = picking_filterColor(gl_FragColor);\n}\n"};return e.modules=["picking"],f()(l()(t.prototype),"getShaders",this).call(this,e)}},{key:"initializeState",value:function(){var e=this.getAttributeManager(),t=this.context.gl;e.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,transition:!0,accessor:["getPosition","getWeight"],update:this.calculateInstanceCounts,noAlloc:!0}});var n={id:"".concat(this.id,"-aggregator"),shaderCache:this.context.shaderCache},i=this._getMaxCountBuffer(t),r={color:{size:1,operation:N.SUM,needMax:!0,maxBuffer:i}};this.setState({model:this._getModel(t),gpuGridAggregator:new se(t,n),maxBuffer:i,weights:r}),this._setupUniformBuffer()}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){f()(l()(t.prototype),"updateState",this).call(this,e),this._updateUniforms(e),e.changeFlags.dataChanged&&this._processData();var n=this._getAggregationChangeFlags(e);n&&((n.cellSizeChanged||n.viewportChanged)&&this._updateGridParams(),this.state.pointCount>0&&this._updateAggregation(n))}},{key:"finalizeState",value:function(){f()(l()(t.prototype),"finalizeState",this).call(this);var e=this.state,n=e.aggregationBuffer,i=e.maxBuffer;e.gpuGridAggregator.delete(),n&&n.delete(),i&&i.delete()}},{key:"draw",value:function(e){var t=e.uniforms,n=this.context.gl,i=this.props.parameters,r=void 0===i?{}:i,a=this.props.minColor||le,o=this.props.maxColor||he,s=this.props.colorDomain||[1,0],u=this.state,c=u.model,l=u.maxBuffer,h=u.cellScale,f=u.shouldUseMinMax,d=u.colorRange,v=u.maxWeight,p={minColor:a,maxColor:o,cellScale:h,colorRange:d,colorDomain:s,shouldUseMinMax:f};Object(C.d)(n)?l.bind({target:35345}):p.maxWeight=v,t=Object.assign(p,t),c.draw({uniforms:t,parameters:Object.assign({depthTest:!1,depthMask:!1},r)}),Object(C.d)(n)&&l.unbind()}},{key:"calculateInstancePositions",value:function(e,t){for(var n=t.numInstances,i=this.context.viewport,r=i.width,a=i.height,o=this.props.cellSizePixels,s=this.state.numCol,u=e.value,c=e.size,l=0;l=0){var i=this.state.gpuGridAggregator.getData("color");t.object=se.getAggregationData(Object.assign({pixelIndex:n},i))}return t}},{key:"_getAggregationChangeFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=n.cellSizePixels!==t.cellSizePixels||n.cellMarginPixels!==t.cellMarginPixels,a=i.dataChanged||n.aggregation!==t.aggregation,o=i.viewportChanged;return r||a||o?{cellSizeChanged:r,dataChanged:a,viewportChanged:o}:null}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new ue.a({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"_getMaxCountBuffer",value:function(e){return new A.a(e,{byteLength:16,index:0,accessor:{size:4}})}},{key:"_processData",value:function(){var e=this.props,t=e.data,n=e.getPosition,i=e.getWeight,r=ce(t),a=new Float64Array(2*r),o=new Float32Array(3*r),s=this.state.weights,u=Object(g.a)(t),c=u.iterable,l=u.objectInfo,h=!0,f=!1,d=void 0;try{for(var v,p=c[Symbol.iterator]();!(h=(v=p.next()).done);h=!0){var m=v.value;l.index++;var y=n(m,l),b=i(m,l),_=l.index;a[2*_]=y[0],a[2*_+1]=y[1],Array.isArray(b)?(o[3*_]=b[0],o[3*_+1]=b[1],o[3*_+2]=b[2]):o[3*_]=b}}catch(e){f=!0,d=e}finally{try{h||null==p.return||p.return()}finally{if(f)throw d}}s.color.values=o,this.setState({positions:a,pointCount:r})}},{key:"_setupUniformBuffer",value:function(){var e=this.context.gl;if(Object(C.d)(e)){var t=this.state.model.program.handle,n=e.getUniformBlockIndex(t,"AggregationData");e.uniformBlockBinding(t,n,0)}}},{key:"_shouldUseMinMax",value:function(){var e=this.props,t=e.minColor,n=e.maxColor,i=e.colorDomain,r=e.colorRange;return t||n?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!r}},{key:"_updateAggregation",value:function(e){var t=this.getAttributeManager(),n=this.props,i=n.cellSizePixels,r=n.gpuAggregation,a=this.state,o=a.positions,s=a.weights,u=this.context.viewport;s.color.operation=N[this.props.aggregation.toUpperCase()]||N.SUM;var c=!1,l=null;this.context.viewport instanceof y.a?c=!0:(c=!1,l=u.pixelProjectionMatrix);var h=this.state.gpuGridAggregator.run({positions:o,weights:s,cellSize:[i,i],viewport:u,changeFlags:e,useGPU:r,projectPoints:c,gridTransformMatrix:l}),f=h.color.maxData&&Number.isFinite(h.color.maxData[0])?h.color.maxData[0]:0;this.setState({maxWeight:f}),t.invalidate("instanceCounts")}},{key:"_updateUniforms",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r={};if(fe.some(function(e){return t[e]!==n[e]})&&(r.shouldUseMinMax=this._shouldUseMinMax()),t.colorRange!==n.colorRange&&(r.colorRange=x(n.colorRange)),t.cellMarginPixels!==n.cellMarginPixels||t.cellSizePixels!==n.cellSizePixels||i.viewportChanged){var a=this.context.viewport,o=a.width,s=a.height,u=this.props,c=u.cellSizePixels,l=u.cellMarginPixels,h=c>l?l:0;r.cellScale=new Float32Array([(c-h)/o*2,-(c-h)/s*2,1])}this.setState(r)}},{key:"_updateGridParams",value:function(){this.getAttributeManager().invalidateAll();var e=this.context.viewport,t=e.width,n=e.height,i=this.props.cellSizePixels,r=this.context.gl,a=Math.ceil(t/i),o=Math.ceil(n/i),s=a*o,u=4*s*4,c=this.state.aggregationBuffer;c&&c.delete(),c=new A.a(r,{byteLength:u,accessor:{size:4,type:5126,divisor:1}}),this.state.weights.color.aggregationBuffer=c,this.setState({numCol:a,numRow:o,numInstances:s,aggregationBuffer:c})}}]),t}(b.a);ve.layerName="ScreenGridLayer",ve.defaultProps=de;var pe=n(195),ge=n(196),me=n(221),ye=function(e){return e.length},be=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;r()(this,e),this.sortedBins=this.getSortedBins(t,n),this.maxCount=this.getMaxCount(),this.binMap=this.getBinMap()}return o()(e,[{key:"getSortedBins",value:function(e,t){return e.reduce(function(e,n,i){var r=t(n.points);return null!=r&&e.push({i:Number.isFinite(n.index)?n.index:i,value:r,counts:n.points.length}),e},[]).sort(function(e,t){return e.value-t.value})}},{key:"getValueRange",value:function(e){var t=j()(e,2),n=t[0],i=t[1],r=this.sortedBins.length;if(!r)return[0,0];var a=Math.ceil(n/100*(r-1)),o=Math.floor(i/100*(r-1));return[this.sortedBins[a].value,this.sortedBins[o].value]}},{key:"getMaxCount",value:function(){var e=0;return this.sortedBins.forEach(function(t){return e=e>t.counts?e:t.counts}),e}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,P()({},t.i,t))},{})}}]),e}();function _e(e,t,n){var i=e[1]-e[0];if(i<=0)return m.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];var r=i/t.length,a=Math.floor((n-e[0])/r);return t[Math.max(Math.min(a,t.length-1),0)]}function xe(e,t){return function(n){return _e(e,t,n)}}function we(e,t){return function(n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}}var Oe=6378e3;function Pe(e,t,n){var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=1/0,a=-1/0,o=Object(g.a)(t),s=o.iterable,u=o.objectInfo,c=!0,l=!1,h=void 0;try{for(var f,d=s[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var v=f.value;u.index++,e=i(v,u)[1],Number.isFinite(e)&&(r=ea?e:a)}}catch(e){l=!0,h=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw h}}var p=function(e,t){var n=(o=e,o/Oe*(180/Math.PI)),i=(r=t,a=e,a/Oe*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(n,(r+a)/2);if(p.xOffset<=0||p.yOffset<=0)return{gridHash:{},gridOffset:p};var m={};u.index=-1;var y=!0,b=!1,_=void 0;try{for(var x,w=s[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;u.index++;var P=i(O,u),S=j()(P,2),k=S[0],C=S[1];if(Number.isFinite(C)&&Number.isFinite(k)){var E=Math.floor((C+90)/p.yOffset),T=Math.floor((k+180)/p.xOffset),A="".concat(E,"-").concat(T);m[A]=m[A]||{count:0,points:[]},m[A].count+=1,m[A].points.push(O)}}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}return{gridHash:m,gridOffset:p}}(e,t,n),r=i.gridHash,a=i.gridOffset;return{gridHash:r,gridOffset:a,layerData:function(e,t){return Object.keys(e).reduce(function(n,i,r){var a=i.split("-"),o=parseInt(a[0],10),s=parseInt(a[1],10);return n.push(Object.assign({index:r,position:[t.xOffset*s-180,t.yOffset*o-90]},e[i])),n},[])}(r,a)}}function Se(){}var je={colorDomain:null,colorRange:_,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},onSetColorDomain:Se,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:1,onSetElevationDomain:Se,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,material:new pe.a},ke=["getColorValue","colorAggregation","getColorWeight"],Ce=["getElevationValue","elevationAggregation","getElevationWeight"],Ee=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={layerData:[],sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:Se,elevationScaleFunc:Se,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,i=e.props,r=e.changeFlags;this.updateGetValueFuncs(n,i);var a=this.needsReProjectPoints(n,i,r);r.dataChanged||a?this.getLayerData():(this.getDimensionChanges(n,i)||[]).forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"colorElevationPropsChanged",value:function(e,t){for(var n=!1,i=!1,r=0;r-1){var o=this.state.layerData[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"getLayerData",value:function(){var e=this.props,t=Pe(e.data,e.cellSize,e.getPosition).layerData;this.setState({layerData:t}),this.getSortedBins()}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.layerData||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.layerData||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.transitions;return new(this.getSubLayerClass("grid-cell",me.a))({cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.layerData})}}]),t}(ge.a);Ee.layerName="CPUGridLayer",Ee.defaultProps=je;var Te=n(171),Ae=Math.PI/3,Me=[0,Ae,2*Ae,3*Ae,4*Ae,5*Ae];function Le(e){return e[0]}function Ie(e){return e[1]}var Re=function(){var e,t,n,i=0,r=0,a=1,o=1,s=Le,u=Ie;function c(e){var i,r={},a=[],o=e.length;for(i=0;i1){var p=l-d,g=d+(ly*y+b*b&&(d=g+(1&f?1:-1)/2,f=m)}var _=d+"-"+f,x=r[_];x?x.push(c):(a.push(x=r[_]=[c]),x.x=(d+(1&f)/2)*t,x.y=f*n)}return a}function l(e){var t=0,n=0;return Me.map(function(i){var r=Math.sin(i)*e,a=-Math.cos(i)*e,o=r-t,s=a-n;return t=r,n=a,[o,s]})}return c.hexagon=function(t){return"m"+l(null==t?e:+t).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(r/n),c=Math.round(i/t),l=u*n;l-1){var o=this.state.hexagons[t.index],s=i.binMap[o.index]&&i.binMap[o.index].value,u=r.binMap[o.index]&&r.binMap[o.index].value;a=Object.assign({colorValue:s,elevationValue:u},o)}return Object.assign(t,{picked:Boolean(a),object:a})}},{key:"getUpdateTriggers",value:function(){var e=this,t=this.state.dimensionUpdaters,n={},i=function(i){n[i]={};var r=!0,a=!1,o=void 0;try{for(var s,u=t[i][Symbol.iterator]();!(r=(s=u.next()).done);r=!0){s.value.triggers.forEach(function(t){n[i][t]=e.props[t]})}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}};for(var r in t)i(r);return n}},{key:"updateRadiusAngle",value:function(e){var t=this.props.radius,n=90;if(Array.isArray(e)){e.length<6&&m.a.error("HexagonCellLayer: hexagonVertices needs to be an array of 6 points")();var i=e[0],r=e[3],a=this.context.viewport.getDistanceScales().pixelsPerMeter,o=this.projectFlat(i),s=this.projectFlat(r),u=o[0]-s[0],c=o[1]-s[1],l=Math.sqrt(u*u+c*c);n=Math.acos(u/l)*-Math.sign(c)/Math.PI*180+90,t=l/2/a[0]}this.setState({angle:n,radius:t})}},{key:"getValueDomain",value:function(){this.getColorValueDomain(),this.getElevationValueDomain()}},{key:"getSortedBins",value:function(){this.getSortedColorBins(),this.getSortedElevationBins()}},{key:"getSortedColorBins",value:function(){var e=this.state.getColorValue,t=new be(this.state.hexagons||[],e);this.setState({sortedColorBins:t}),this.getColorValueDomain()}},{key:"getSortedElevationBins",value:function(){var e=this.state.getElevationValue,t=new be(this.state.hexagons||[],e);this.setState({sortedElevationBins:t}),this.getElevationValueDomain()}},{key:"getColorValueDomain",value:function(){var e=this.props,t=e.lowerPercentile,n=e.upperPercentile,i=e.onSetColorDomain;t>n&&m.a.warn("HexagonLayer: lowerPercentile is bigger than upperPercentile")(),this.state.colorValueDomain=this.state.sortedColorBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.colorValueDomain),this.getColorScale()}},{key:"getElevationValueDomain",value:function(){var e=this.props,t=e.elevationLowerPercentile,n=e.elevationUpperPercentile,i=e.onSetElevationDomain;this.state.elevationValueDomain=this.state.sortedElevationBins.getValueRange([t,n]),"function"==typeof i&&i(this.state.elevationValueDomain),this.getElevationScale()}},{key:"getColorScale",value:function(){var e=this.props.colorRange,t=this.props.colorDomain||this.state.colorValueDomain;this.state.colorScaleFunc=xe(t,e)}},{key:"getElevationScale",value:function(){var e=this.props.elevationRange,t=this.props.elevationDomain||this.state.elevationValueDomain;this.state.elevationScaleFunc=we(t,e)}},{key:"_onGetSublayerColor",value:function(e){var t=this.state,n=t.sortedColorBins,i=t.colorScaleFunc,r=t.colorValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.colorDomain||r,s=a>=o[0]&&a<=o[o.length-1]?i(a):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,i=t.elevationScaleFunc,r=t.elevationValueDomain,a=n.binMap[e.index]&&n.binMap[e.index].value,o=this.props.elevationDomain||r;return a>=o[0]&&a<=o[o.length-1]?i(a):-1}},{key:"renderLayers",value:function(){var e=this.props,t=e.elevationScale,n=e.extruded,i=e.coverage,r=e.material,a=e.transitions,o=this.state,s=o.angle,u=o.radius;return new(this.getSubLayerClass("hexagon-cell",Te.a))({radius:u,diskResolution:6,elevationScale:t,angle:s,extruded:n,coverage:i,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:this.getUpdateTriggers()}),{data:this.state.hexagons})}}]),t}(ge.a);Be.layerName="HexagonLayer",Be.defaultProps=De;var Ue,Ve=n(22),Ge=n(226),We=n(133),He={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Xe=[He.W,He.SW,He.S],qe=[He.S,He.SE,He.E],Ze=[He.E,He.NE,He.N],Ye=[He.NW,He.W,He.N],Ke=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],Qe=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Je=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],$e=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],et=[He.W,He.SW,He.SE,He.E],tt=[He.S,He.SE,He.NE,He.N],nt=[He.NW,He.W,He.E,He.NE],it=[He.NW,He.SW,He.S,He.N],rt=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],at=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],ot=[He.NW,He.SW,He.SE,He.NE],st=[He.NW,He.SW,He.SE,He.E,He.N],ut=[He.W,He.SW,He.SE,He.NE,He.N],ct=[He.NW,He.W,He.S,He.SE,He.NE],lt=[He.NW,He.SW,He.S,He.E,He.NE],ht=[He.NW,He.W,[.5,-1/6],[.5,1/6],He.N],ft=[[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],dt=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E],vt=[He.W,He.SW,He.S,[1/6,.5],[-1/6,.5]],pt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.N],gt=[[-.5,1/6],[-.5,-1/6],He.E,He.NE,He.N],mt=[He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],yt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6]],bt=[He.W,He.SW,He.SE,He.E,[1/6,.5],[-1/6,.5]],_t=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.NE,He.N],xt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.E,He.NE],wt=[He.NW,He.SW,He.S,[.5,-1/6],[.5,1/6],He.N],Ot=[He.W,He.SW,He.S,He.E,He.NE,He.N],Pt=[He.NW,He.W,He.S,He.SE,He.E,He.N],St=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],jt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],kt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],He.N],Ct=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],Et=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Tt={0:[],1:[[He.W,He.S]],2:[[He.S,He.E]],3:[[He.W,He.E]],4:[[He.N,He.E]],5:{0:[[He.W,He.S],[He.N,He.E]],1:[[He.W,He.N],[He.S,He.E]]},6:[[He.N,He.S]],7:[[He.W,He.N]],8:[[He.W,He.N]],9:[[He.N,He.S]],10:{0:[[He.W,He.N],[He.S,He.E]],1:[[He.W,He.S],[He.N,He.E]]},11:[[He.N,He.E]],12:[[He.W,He.E]],13:[[He.S,He.E]],14:[[He.W,He.S]],15:[]};function At(e){return parseInt(e,4)}var Mt=(Ue={},P()(Ue,At("0000"),[]),P()(Ue,At("2222"),[]),P()(Ue,At("2221"),[Xe]),P()(Ue,At("2212"),[qe]),P()(Ue,At("2122"),[Ze]),P()(Ue,At("1222"),[Ye]),P()(Ue,At("0001"),[Xe]),P()(Ue,At("0010"),[qe]),P()(Ue,At("0100"),[Ze]),P()(Ue,At("1000"),[Ye]),P()(Ue,At("2220"),[Ke]),P()(Ue,At("2202"),[Qe]),P()(Ue,At("2022"),[Je]),P()(Ue,At("0222"),[$e]),P()(Ue,At("0002"),[Ke]),P()(Ue,At("0020"),[Qe]),P()(Ue,At("0200"),[Je]),P()(Ue,At("2000"),[$e]),P()(Ue,At("0011"),[et]),P()(Ue,At("0110"),[tt]),P()(Ue,At("1100"),[nt]),P()(Ue,At("1001"),[it]),P()(Ue,At("2211"),[et]),P()(Ue,At("2112"),[tt]),P()(Ue,At("1122"),[nt]),P()(Ue,At("1221"),[it]),P()(Ue,At("2200"),[rt]),P()(Ue,At("2002"),[at]),P()(Ue,At("0022"),[rt]),P()(Ue,At("0220"),[at]),P()(Ue,At("1111"),[ot]),P()(Ue,At("1211"),[st]),P()(Ue,At("2111"),[ut]),P()(Ue,At("1112"),[ct]),P()(Ue,At("1121"),[lt]),P()(Ue,At("1011"),[st]),P()(Ue,At("0111"),[ut]),P()(Ue,At("1110"),[ct]),P()(Ue,At("1101"),[lt]),P()(Ue,At("1200"),[ht]),P()(Ue,At("0120"),[ft]),P()(Ue,At("0012"),[dt]),P()(Ue,At("2001"),[vt]),P()(Ue,At("1022"),[ht]),P()(Ue,At("2102"),[ft]),P()(Ue,At("2210"),[dt]),P()(Ue,At("0221"),[vt]),P()(Ue,At("1002"),[pt]),P()(Ue,At("2100"),[gt]),P()(Ue,At("0210"),[mt]),P()(Ue,At("0021"),[yt]),P()(Ue,At("1220"),[pt]),P()(Ue,At("0122"),[gt]),P()(Ue,At("2012"),[mt]),P()(Ue,At("2201"),[yt]),P()(Ue,At("0211"),[bt]),P()(Ue,At("2110"),[_t]),P()(Ue,At("1102"),[xt]),P()(Ue,At("1021"),[wt]),P()(Ue,At("2011"),[bt]),P()(Ue,At("0112"),[_t]),P()(Ue,At("1120"),[xt]),P()(Ue,At("1201"),[wt]),P()(Ue,At("2101"),[Ot]),P()(Ue,At("0121"),[Ot]),P()(Ue,At("1012"),[Pt]),P()(Ue,At("1210"),[Pt]),P()(Ue,At("0101"),{0:[Xe,Ze],1:[Ot],2:[Ot]}),P()(Ue,At("1010"),{0:[Ye,qe],1:[Pt],2:[Pt]}),P()(Ue,At("2121"),{0:[Ot],1:[Ot],2:[Xe,Ze]}),P()(Ue,At("1212"),{0:[Pt],1:[Pt],2:[Ye,qe]}),P()(Ue,At("2120"),{0:[St],1:[St],2:[Ke,Ze]}),P()(Ue,At("2021"),{0:[jt],1:[jt],2:[Xe,Je]}),P()(Ue,At("1202"),{0:[kt],1:[kt],2:[Ye,Qe]}),P()(Ue,At("0212"),{0:[Ct],1:[Ct],2:[qe,$e]}),P()(Ue,At("0102"),{0:[Ke,Ze],1:[St],2:[St]}),P()(Ue,At("0201"),{0:[Xe,Je],1:[jt],2:[jt]}),P()(Ue,At("1020"),{0:[Ye,Qe],1:[kt],2:[kt]}),P()(Ue,At("2010"),{0:[qe,$e],1:[Ct],2:[Ct]}),P()(Ue,At("2020"),{0:[$e,Qe],1:[Et],2:[Ke,Je]}),P()(Ue,At("0202"),{0:[Je,Ke],1:[Et],2:[$e,Qe]}),Ue),Lt={ISO_LINES:1,ISO_BANDS:2},It={zIndex:0,zOffset:.005};function Rt(e,t){return Array.isArray(t)?e=t?1:0}function Ft(e){var t=e.cellWeights,n=e.x,i=e.y,r=e.width,a=e.height,o=e.threshold;e.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),o=e.thresholdValue);var s=n<0,u=n>=r-1,c=i<0,l=i>=a-1,h=s||u||c||l,f={},d={};s||l?d.top=0:(f.top=t[(i+1)*r+n],d.top=Rt(f.top,o)),u||l?d.topRight=0:(f.topRight=t[(i+1)*r+n+1],d.topRight=Rt(f.topRight,o)),u||c?d.right=0:(f.right=t[i*r+n+1],d.right=Rt(f.right,o)),s||c?d.current=0:(f.current=t[i*r+n],d.current=Rt(f.current,o));var v=d.top,p=d.topRight,g=d.right,y=d.current,b=-1;Number.isFinite(o)&&(b=v<<3|p<<2|g<<1|y),Array.isArray(o)&&(b=v<<6|p<<4|g<<2|y);var _=0;return h||(_=Rt((f.top+f.topRight+f.right+f.current)/4,o)),{code:b,meanCode:_}}function Dt(e){var t=e.gridOrigin,n=e.cellSize,i=e.x,r=e.y,a=e.code,o=e.meanCode,s=e.type,u=void 0===s?Lt.ISO_LINES:s,c=Object.assign({},It,e.thresholdData),l=u===Lt.ISO_BANDS?Mt[a]:Tt[a];Array.isArray(l)||(l=l[o]);var h=c.zIndex*c.zOffset,f=(i+1)*n[0],d=(r+1)*n[1],v=t[0]+f,p=t[1]+d;if(u===Lt.ISO_BANDS){var g=[];return l.forEach(function(e){var t=[];e.forEach(function(e){var i=v+e[0]*n[0],r=p+e[1]*n[1];t.push([i,r,h])}),g.push(t)}),g}var m=[];return l.forEach(function(e){e.forEach(function(e){var t=v+e[0]*n[0],i=p+e[1]*n[1];m.push([t,i,h])})}),m}var Nt=n(68),zt=n(32),Bt=p.experimental.count,Ut=k.a.fp64LowPart,Vt=6378e3;function Gt(e){return Number.isFinite(e)?e:0}function Wt(e){var t=e.data,n=e.getPosition,i=e.cellSizeMeters,r=e.gpuGridAggregator,a=e.gpuAggregation,o=e.aggregationFlags,s=e.weightParams,u=e.fp64,c=void 0!==u&&u,l=e.coordinateSystem,h=void 0===l?zt.a.LNGLAT:l,f=e.viewport,d=void 0===f?null:f,v=e.boundingBox,p=void 0===v?null:v,y={};o.dataChanged&&(p=(y=function(e,t,n){var i,r,a=Bt(e),o=new Float64Array(2*a),s=new Float32Array(2*a),u=1/0,c=-1/0,l=1/0,h=-1/0,f={};for(var d in n)f[d]=Object.assign({},n[d],{values:new Float32Array(3*a)});var v=Object(g.a)(e),p=v.iterable,m=v.objectInfo,y=!0,b=!1,_=void 0;try{for(var x,w=p[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var O=x.value;m.index++;var P=t(O,m),S=m.index;for(var j in r=P[0],i=P[1],o[2*S]=r,o[2*S+1]=i,s[2*S]=Ut(r),s[2*S+1]=Ut(i),n){var k=n[j].getWeight(O);Array.isArray(k)?(f[j].values[3*S]=k[0],f[j].values[3*S+1]=k[1],f[j].values[3*S+2]=k[2]):f[j].values[3*S]=k}Number.isFinite(i)&&Number.isFinite(r)&&(u=ic?i:c,l=rh?r:h)}}catch(e){b=!0,_=e}finally{try{y||null==w.return||w.return()}finally{if(b)throw _}}var C={xMin:Gt(l),xMax:Gt(h),yMin:Gt(u),yMax:Gt(c)};return{positions:o,positions64xyLow:s,weights:f,boundingBox:C}}(t,n,s)).boundingBox);var b=[i,i],_=[0,0];switch(m.a.assert(h===zt.a.LNGLAT||h===zt.a.IDENTITY),h){case zt.a.LNGLAT:case zt.a.LNGLAT_DEPRECATED:var x=function(e,t){var n=e.yMin,i=e.yMax;return function(e,t){var n=(o=e,o/Vt*(180/Math.PI)),i=(r=t,a=e,a/Vt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,a;var o;return{yOffset:n,xOffset:i}}(t,(n+i)/2)}(p,i);b=[x.xOffset,x.yOffset],_=[-180,-90];break;case zt.a.IDENTITY:_=[-d.width/2,-d.height/2];break;default:m.a.assert(!1)}var w=function(e){var t=e.boundingBox,n=e.cellSize,i=e.worldOrigin,r=t.yMin,a=t.yMax,o=t.xMin,s=t.xMax,u=Ht(o-i[0],n[0])+i[0],c=Ht(r-i[1],n[1])+i[1],l=(new Nt.a).translate([-1*u,-1*c,0]),h=[u,c],f=s-o+n[0],d=a-r+n[1],v=[Math.ceil(f/n[0]),Math.ceil(d/n[1])];return{gridOrigin:h,gridSize:v,width:f,height:d,gridTransformMatrix:l}}({boundingBox:p,cellSize:b,worldOrigin:_});return{weights:r.run({positions:y.positions,positions64xyLow:y.positions64xyLow,weights:y.weights,cellSize:b,width:w.width,height:w.height,gridTransformMatrix:w.gridTransformMatrix,useGPU:a,changeFlags:o,fp64:c}),gridSize:w.gridSize,gridOrigin:w.gridOrigin,cellSize:b,boundingBox:p}}function Ht(e,t){var n=e<0?-1:1,i=n<0?Math.abs(e)+t:Math.abs(e);return(i=Math.floor(i/t)*t)*n}var Xt=[255,255,255,255],qt={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(e){return e.position}},getWeight:{type:"accessor",value:function(e){return 1}},contours:[{threshold:1}],fp64:!1,zOffset:.005},Zt=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={contourData:{},gridAggregator:new se(e,t),colorTrigger:0,strokeWidthTrigger:0}}},{key:"updateState",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=!1,a=!1,o=this._getAggregationFlags({oldProps:t,props:n,changeFlags:i});o&&(r=!0,this.setState({countsData:null}),this._aggregateData(o)),this._shouldRebuildContours({oldProps:t,props:n})&&(a=!0,this._updateThresholdData(n)),r||a?this._generateContours():this._updateSubLayerTriggers(t,n)}},{key:"finalizeState",value:function(){f()(l()(t.prototype),"finalizeState",this).call(this),this.state.gridAggregator.delete()}},{key:"renderLayers",value:function(){var e=this.state.contourData,t=e.contourSegments,n=e.contourPolygons,i=t&&t.length>0,r=n&&n.length>0;return[i&&new Ge.a(this._getLineLayerProps()),r&&new We.a(this._getSolidPolygonLayerProps())]}},{key:"_aggregateData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.getWeight,o=t.gpuAggregation,s=t.fp64,u=t.coordinateSystem,c=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{count:{getWeight:a}},gpuAggregation:o,gpuGridAggregator:this.state.gridAggregator,fp64:s,coordinateSystem:u,viewport:this.context.viewport,boundingBox:this.state.boundingBox,aggregationFlags:e}),l=c.weights,h=c.gridSize,f=c.gridOrigin,d=c.cellSize,v=c.boundingBox;this.setState({countsData:l.count.aggregationData,countsBuffer:l.count.aggregationBuffer,gridSize:h,gridOrigin:f,cellSize:d,boundingBox:v})}},{key:"_generateContours",value:function(){var e=this.state,t=e.gridSize,n=e.gridOrigin,i=e.cellSize,r=e.thresholdData,a=this.state.countsData;a||(a=this.state.countsBuffer.getData(),this.setState({countsData:a}));var o=function(e){var t=e.thresholdData,n=(e.colors,e.cellWeights),i=e.gridSize,r=e.gridOrigin,a=e.cellSize,o=[],s=[],u=i[0],c=i[1];return t.forEach(function(e,t){for(var i=e.threshold,l=-1;l= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec2 centroidPosition64xyLow = vec2(instancePositionXFP64[1], instancePositionYFP64[1]);\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n vec4 position_commonspace;\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64xyLow, pos, position_commonspace);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, position_commonspace.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:["project32","gouraud-lighting","picking",k.a]})}},{key:"initializeState",value:function(){var e=this.context.gl;this.getAttributeManager().addInstanced({colors:{size:4,update:this.calculateColors,noAlloc:!0},elevations:{size:4,update:this.calculateElevations,noAlloc:!0}});var t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}},{key:"_getModel",value:function(e){return new L.a(e,Object.assign({},this.getShaders(),{id:this.props.id,geometry:new Kt.a,isInstanced:!0,shaderCache:this.context.shaderCache}))}},{key:"draw",value:function(e){var t=e.uniforms,n=this.props,i=n.data,r=n.cellSize,a=n.offset,o=n.extruded,s=n.elevationScale,u=n.coverage,c=n.gridSize,l=n.gridOrigin,h=n.gridOffset,f=n.elevationRange,d=[Object(Yt.c)(l[0]),Object(Yt.c)(l[1])],v=[Object(Yt.c)(h[0]),Object(Yt.c)(h[1])],p=this.getDomainUniforms(),g={colorMaxMinBuffer:i.color.maxMinBuffer,elevationMaxMinBuffer:i.elevation.maxMinBuffer},m=x(this.props.colorRange);this.bindUniformBuffers(g),this.state.model.setUniforms(Object.assign({},t,p,{cellSize:r,offset:a,extruded:o,elevationScale:s,coverage:u,gridSize:c,gridOrigin:l,gridOriginLow:d,gridOffset:h,gridOffsetLow:v,colorRange:m,elevationRange:f})).draw(),this.unbindUniformBuffers(g)}},{key:"bindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.bind({target:35345,index:0}),n.bind({target:35345,index:1})}},{key:"unbindUniformBuffers",value:function(e){var t=e.colorMaxMinBuffer,n=e.elevationMaxMinBuffer;t.unbind({target:35345,index:0}),n.unbind({target:35345,index:1})}},{key:"calculateColors",value:function(e){var t=this.props.data;e.update({buffer:t.color.aggregationBuffer})}},{key:"calculateElevations",value:function(e){var t=this.props.data;e.update({buffer:t.elevation.aggregationBuffer})}},{key:"getDomainUniforms",value:function(){var e=this.props,t=e.colorDomain,n=e.elevationDomain,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==n?(i.elevationDomainValid=!0,i.elevationDomain=n):i.elevationDomainValid=!1,i}},{key:"_setupUniformBuffer",value:function(e){var t=this.context.gl,n=e.program.handle,i=t.getUniformBlockIndex(n,"ColorData"),r=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,i,0),t.uniformBlockBinding(n,r,1)}}]),t}(b.a);$t.layerName="GPUGridCellLayer",$t.defaultProps=Jt;var en={colorDomain:null,colorRange:_,getColorWeight:{type:"accessor",value:function(e){return 1}},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:function(e){return 1}},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(e){return e.position}},extruded:!1,fp64:!1,material:new pe.a,gpuAggregation:!0},tn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.context.gl,t=se.isSupported(e);t||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")();var n={id:"".concat(this.id,"-gpu-aggregator"),shaderCache:this.context.shaderCache};this.state={gpuGridAggregator:new se(e,n),isSupported:t}}},{key:"updateState",value:function(e){var t=this.getAggregationFlags(e);t&&(this.getLayerData(t),this.setState({gridHash:null}))}},{key:"finalizeState",value:function(){f()(l()(t.prototype),"finalizeState",this).call(this),this.state.gpuGridAggregator.delete()}},{key:"getAggregationFlags",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags,r=null;return!!this.state.isSupported&&(this.isDataChanged({oldProps:t,props:n,changeFlags:i})&&(r=Object.assign({},r,{dataChanged:!0})),t.cellSize!==n.cellSize&&(r=Object.assign({},r,{cellSizeChanged:!0})),r)}},{key:"isDataChanged",value:function(e){var t=e.oldProps,n=e.props,i=e.changeFlags;return!!i.dataChanged||(t.gpuAggregation!==n.gpuAggregation||(t.colorAggregation!==n.colorAggregation||t.elevationAggregation!==n.elevationAggregation||!(!i.updateTriggersChanged||!(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition||i.updateTriggersChanged.getColorWeight||i.updateTriggersChanged.getElevationWeight))))}},{key:"getHashKeyForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=Math.floor((a*r[1]+i[1]+90+r[1]/2)/r[1]),u=Math.floor((o*r[0]+i[0]+180+r[0]/2)/r[0]);return"".concat(s,"-").concat(u)}},{key:"getPositionForIndex",value:function(e){var t=this.state,n=t.gridSize,i=t.gridOrigin,r=t.cellSize,a=Math.floor(e/n[0]),o=e-a*n[0],s=a*r[1]+i[1];return[o*r[0]+i[0],s]}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.mode,i=t.index,r=null;if(i>=0){var a=this.state.gpuGridAggregator,o=this.getPositionForIndex(i),s=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("color"))),u=se.getAggregationData(Object.assign({pixelIndex:i},a.getData("elevation")));if(r={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:o,totalCount:s.totalCount||u.totalCount},"hover"!==n){var c=this.props,l=c.data,h=c.getPosition,f=this.state.gridHash;if(!f)f=Pe(l,this.props.cellSize,h).gridHash,this.setState({gridHash:f});var d=f[this.getHashKeyForIndex(i)];Object.assign(r,d)}}return Object.assign(t,{picked:Boolean(r),object:r})}},{key:"getLayerData",value:function(e){var t=this.props,n=t.data,i=t.cellSize,r=t.getPosition,a=t.gpuAggregation,o=t.getColorWeight,s=t.colorAggregation,u=t.getElevationWeight,c=t.elevationAggregation,l=t.fp64,h=Wt({data:n,cellSizeMeters:i,getPosition:r,weightParams:{color:{getWeight:o,operation:N[s]||N[en.colorAggregation],needMin:!0,needMax:!0,combineMaxMin:!0},elevation:{getWeight:u,operation:N[c]||N[en.elevationAggregation],needMin:!0,needMax:!0,combineMaxMin:!0}},gpuAggregation:a,gpuGridAggregator:this.state.gpuGridAggregator,boundingBox:this.state.boundingBox,aggregationFlags:e,fp64:l}),f=h.weights,d=h.gridSize,v=h.gridOrigin,p=h.cellSize,g=h.boundingBox;this.setState({weights:f,gridSize:d,gridOrigin:v,cellSize:p,boundingBox:g})}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var e=this.props,t=e.elevationScale,n=e.extruded,i=e.cellSize,r=e.coverage,a=e.material,o=e.elevationRange,s=e.colorDomain,u=e.elevationDomain,c=this.state,l=c.weights,h=c.gridSize,f=c.gridOrigin,d=c.cellSize,v=x(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",$t))({gridSize:h,gridOrigin:f,gridOffset:d,colorRange:v,elevationRange:o,colorDomain:s,elevationDomain:u,cellSize:i,coverage:r,material:a,elevationScale:t,extruded:n},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:l,numInstances:h[0]*h[1]})}}]),t}(ge.a);tn.layerName="GPUGridLayer",tn.defaultProps=en;var nn=Object.assign({},tn.defaultProps,Ee.defaultProps,{gpuAggregation:!1}),rn=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(e){e.oldProps;var t=e.props,n=(e.changeFlags,{});n.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(n)}},{key:"renderLayers",value:function(){var e=this.props,t=e.data,n=e.updateTriggers,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",tn):this.getSubLayerClass("CPU",Ee))(this.props,this.getSubLayerProps({id:i,updateTriggers:n}),{data:t})}},{key:"canUseGPUAggregation",value:function(e){var t=e.gpuAggregation,n=e.lowerPercentile,i=e.upperPercentile,r=e.getColorValue,a=e.getElevationValue;return!!t&&(!!se.isSupported(this.context.gl)&&(0===n&&100===i&&(null===r&&null===a)))}}]),t}(ge.a);rn.layerName="GridLayer",rn.defaultProps=nn;var an=new Float32Array(12);function on(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=0,i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done);i=!0)for(var u=o.value,c=0;c 0.5) {\n discard;\n }\n gl_FragColor.rgb = weightsTexture.rgb * gaussianKDE(2. * dist);\n gl_FragColor.a = 1.0;\n}\n",modules:["project32"],elementCount:1,_targetTexture:n,_targetTextureVarying:"weightsTexture"});this.setState({weightsTexture:n,maxWeightsTexture:i,weightsTransform:r,model:r.model,maxWeightTransform:new I.a(e,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:n},_targetTexture:i,_targetTextureVarying:"outTexture",vs:"#version 300 es\nin vec4 inTexture;\nout vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\n}\n",elementCount:t*t}),zoom:null,triPositionBuffer:new A.a(e,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new A.a(e,{byteLength:48,accessor:{size:2}})})}},{key:"_updateMaxWeightValue",value:function(){this.state.maxWeightTransform.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}},{key:"_updateBounds",value:function(){var e,t,n,i,r,a,o,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0],u=this.state.textureSize,c=this.context.viewport,l=[c.unproject([0,0]),c.unproject([c.width,0]),c.unproject([c.width,c.height]),c.unproject([0,c.height])],h=(t=(e=l).map(function(e){return e[0]}),n=e.map(function(e){return e[1]}),i=Math.min.apply(null,t),r=Math.max.apply(null,t),[i,Math.min.apply(null,n),r,Math.max.apply(null,n)]),f=this._worldToCommonBounds(h),d={visibleWorldBounds:h,viewportCorners:l},v=!1;if(s||!this.state.worldBounds||(a=this.state.worldBounds,!((o=h)[0]>=a[0]&&o[2]<=a[2]&&o[1]>=a[1]&&o[3]<=a[3]))){var p=sn(f,2*u,2*u),g=this._commonToWorldBounds(p);this.props.coordinateSystem===zt.a.LNGLAT&&(g[1]=Math.max(g[1],-85.051129),g[3]=Math.min(g[3],85.051129),g[0]=Math.max(g[0],-360),g[2]=Math.min(g[2],360));var m=this._worldToCommonBounds(g,{scaleToAspect:!0,normalize:!0,width:2*u,height:2*u});d.worldBounds=g,d.normalizedCommonBounds=m,v=!0}return this.setState(d),v}},{key:"_updateTextureRenderingBounds",value:function(){var e=this.state,t=e.triPositionBuffer,n=e.triTexCoordBuffer,i=e.normalizedCommonBounds,r=e.viewportCorners,a=this.context.viewport,o=i.map(function(e){return e*a.scale});t.subData(on(r,3));var s=r.map(function(e){return t=a.projectPosition(e),n=o,i=j()(n,4),r=i[0],s=i[1],u=i[2],c=i[3],[(t[0]-r)/(u-r),(t[1]-s)/(c-s)];var t,n,i,r,s,u,c});n.subData(on(s,2))}},{key:"_updateColorTexture",value:function(e){var t=e.props.colorRange,n=this.state.colorTexture,i=x(t,!0);n?n.setImageData({data:i,width:t.length}):n=te(this.context.gl,{data:i,width:t.length,parameters:vn}),this.setState({colorTexture:n})}},{key:"_updateWeightmap",value:function(){var e=this.props.radiusPixels,t=this.state,n=t.weightsTransform,i=t.worldBounds,r=t.textureSize;this._updateAttributes(this.props);var a=Object.assign(Object.create(this.props),{viewport:this.context.viewport,pickingActive:0}),o=this._worldToCommonBounds(i,{useLayerCoordinateSystem:!0,scaleToAspect:!0,width:2*r,height:2*r}),s=Object.assign({},n.model.getModuleUniforms(a),{radiusPixels:e,commonBounds:o,textureWidth:r});n.update({elementCount:this.getNumInstances()}),n.run({uniforms:s,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0}),this._updateMaxWeightValue(),this.setState({lastUpdate:Date.now()})}},{key:"_debouncedUpdateWeightmap",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.state.updateTimer,n=Date.now()-this.state.lastUpdate;e&&(t=null),n>=500?(this._updateBounds(!0),this._updateWeightmap(),this._updateTextureRenderingBounds()):t||(t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),500-n)),this.setState({updateTimer:t})}},{key:"_worldToCommonBounds",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.useLayerCoordinateSystem,a=void 0!==r&&r,o=i.scaleToAspect,s=void 0!==o&&o,u=i.width,c=i.height,l=j()(e,4),h=l[0],f=l[1],d=l[2],v=l[3],p=this.context.viewport;a?(t=this.projectPosition([h,v,0]),n=this.projectPosition([d,f,0])):(t=p.projectPosition([h,v,0]),n=p.projectPosition([d,f,0]));var g=t.slice(0,2).concat(n.slice(0,2));return s&&(g=sn(g,u,c)),i.normalize&&(g=g.map(function(e){return e/p.scale})),g}},{key:"_commonToWorldBounds",value:function(e){var t=j()(e,4),n=t[0],i=t[1],r=t[2],a=t[3],o=this.context.viewport,s=o.unprojectPosition([n,a]),u=o.unprojectPosition([r,i]);return s.slice(0,2).concat(u.slice(0,2))}}]),t}(ge.a);gn.layerName="HeatmapLayer",gn.defaultProps=pn,n.d(t,"experimental",function(){return mn}),n.d(t,"ScreenGridLayer",function(){return ve}),n.d(t,"CPUGridLayer",function(){return Ee}),n.d(t,"HexagonLayer",function(){return Be}),n.d(t,"ContourLayer",function(){return Zt}),n.d(t,"GridLayer",function(){return rn}),n.d(t,"GPUGridLayer",function(){return tn}),n.d(t,"AGGREGATION_OPERATION",function(){return N}),n.d(t,"HeatmapLayer",function(){return gn}),n.d(t,"_GPUGridAggregator",function(){return se});var mn={BinSorter:be,linearScale:function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},getLinearScale:we,quantizeScale:_e,getQuantizeScale:xe,defaultColorRange:_}},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(13),f=n.n(h),d=n(7),v=n.n(d),p=n(132),g=n(128),m=n(59),y=n(195),b=n(30),_=n(92),x=n(74),w=Math.PI/180,O=new Float32Array(16),P=new Float32Array(12);function S(e,t,n){var i=t[0]*w,r=t[1]*w,a=t[2]*w,o=Math.sin(a),s=Math.sin(i),u=Math.sin(r),c=Math.cos(a),l=Math.cos(i),h=Math.cos(r),f=n[0],d=n[1],v=n[2];e[0]=f*h*l,e[1]=f*u*l,e[2]=f*-s,e[3]=d*(-u*c+h*s*o),e[4]=d*(h*c+u*s*o),e[5]=d*l*o,e[6]=v*(u*o+h*s*c),e[7]=v*(-h*o+u*s*c),e[8]=v*l*c}function j(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}var k={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,stride:48,offset:0},instanceModelMatrix__LOCATION_1:{size:3,stride:48,offset:12},instanceModelMatrix__LOCATION_2:{size:3,stride:48,offset:24},instanceTranslation:{size:3,stride:48,offset:36}},update:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getOrientation,s=r.getScale,u=r.getTranslation,c=r.getTransformMatrix,l=Array.isArray(c),h=l&&16===c.length,f=Array.isArray(s),d=Array.isArray(o),v=Array.isArray(u),p=h||!l&&Boolean(c(a[0]));e.constant=p?h:d&&f&&v;var g=e.value;if(e.constant){var m;if(p)O.set(c),m=j(O);else S(m=P,o,s),m.set(u,9);e.value=new Float32Array(m)}else{var y=n*e.size,b=Object(x.a)(a,n,i),_=b.iterable,w=b.objectInfo,k=!0,C=!1,E=void 0;try{for(var T,A=_[Symbol.iterator]();!(k=(T=A.next()).done);k=!0){var M=T.value;w.index++;var L=void 0;if(p)O.set(h?c:c(M,w)),L=j(O);else S(L=P,d?o:o(M,w),f?s:s(M,w)),L.set(v?u:u(M,w),9);g[y++]=L[0],g[y++]=L[1],g[y++]=L[2],g[y++]=L[3],g[y++]=L[4],g[y++]=L[5],g[y++]=L[6],g[y++]=L[7],g[y++]=L[8],g[y++]=L[9],g[y++]=L[10],g[y++]=L[11]}}catch(e){C=!0,E=e}finally{try{k||null==A.return||A.return()}finally{if(C)throw E}}}}};function C(e){!function(e,t){if(!e)throw new Error("deck.gl: ".concat(t))}(e.positions||e.POSITION,'SimpleMeshLayer requires "postions" or "POSITION" attribute in mesh property.')}function E(e){if(e.attributes)return C(e.attributes),e instanceof m.a?e:new m.a(e);if(e.positions||e.POSITION)return C(e),new m.a({attributes:e});throw Error("Invalid mesh")}var T={mesh:{value:null,type:"object",async:!0},texture:null,sizeScale:{type:"number",value:1,min:0},parameters:{depthTest:!0,depthFunc:515},opacity:1,wireframe:!1,material:new y.a,getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}},A=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){var e=Object(b.d)(this.context.gl),n=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nin vec3 positions;\nin vec3 normals;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec2 instancePositions64xyLow;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\n\n// Primitive attributes\nattribute vec3 positions;\nattribute vec3 normals;\nattribute vec2 texCoords;\n\n// Instance attributes\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute mat3 instanceModelMatrix;\nattribute vec3 instanceTranslation;\n\n// Outputs to fragment shader\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = instanceColors;\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, pos, position_commonspace);\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n picking_setPickingColor(instancePickingColors);\n}\n",i=e?"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n":"\n#define SHADER_NAME simple-mesh-layer-fs\n\n// Note(Tarek): headless-gl supports derivatives, but doesn't report it via getExtension. Awesome!\n#ifdef DERIVATIVES\n#define FLAT_SHADE_NORMAL normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)))\n#else\n#define FLAT_SHADE_NORMAL vec3(0.0, 0.0, 1.0)\n#endif\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n normal = FLAT_SHADE_NORMAL;\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture2D(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";return f()(l()(t.prototype),"getShaders",this).call(this,{vs:n,fs:i,modules:["project32","phong-lighting","picking"]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:this.use64bitPositions()?5130:5126,size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:k}),this.setState({emptyTexture:new g.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(e){var n=e.props,i=e.oldProps,r=e.changeFlags;if(f()(l()(t.prototype),"updateState",this).call(this,{props:n,oldProps:i,changeFlags:r}),n.mesh!==i.mesh||r.extensionsChanged){if(this.state.model&&this.state.model.delete(),n.mesh){this.setState({model:this.getModel(n.mesh)});var a=n.mesh.attributes||n.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}n.texture!==i.texture&&this.setTexture(n.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(){f()(l()(t.prototype),"finalizeState",this).call(this),this.state.emptyTexture.delete(),this.state.texture&&this.state.texture.delete()}},{key:"draw",value:function(e){var t=e.uniforms;if(this.state.model){var n=this.props.sizeScale;this.state.model.draw({uniforms:Object.assign({},t,{sizeScale:n,flatShade:!this.state.hasNormals})})}}},{key:"getModel",value:function(e){var t=new _.a(this.context.gl,Object.assign({},this.getShaders(),{id:this.props.id,geometry:E(e),isInstanced:!0,shaderCache:this.context.shaderCache})),n=this.state,i=n.texture,r=n.emptyTexture;return t.setUniforms({sampler:i||r,hasTexture:Boolean(i)}),t}},{key:"setTexture",value:function(e){var t=this.context.gl,n=this.state,i=n.emptyTexture,r=n.model;this.state.texture&&this.state.texture.delete();var a=e?function(e,t,n){return t instanceof g.a?t:new g.a(e,Object.assign({data:t},n))}(t,e):null;this.setState({texture:a}),r&&r.setUniforms({sampler:a||i,hasTexture:Boolean(a)})}}]),t}(p.a);A.layerName="SimpleMeshLayer",A.defaultProps=T;var M=n(31),L=n.n(M),I=n(91),R=n(25),F=n(223),D=n(4),N=n(5),z=n(68),B=n(216),U=n(43),V=n(60),G=n(19),W=n(10),H=n(9),X=n(11),q=n(136),Z=n(22),Y=n(12);var K=n(40),Q=n(37);function J(){var e=new Y.a(4);return Y.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function $(e,t,n){n*=.5;var i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function ee(e,t,n){var i=t[0],r=t[1],a=t[2],o=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=i*l+o*s+r*c-a*u,e[1]=r*l+o*u+a*s-i*c,e[2]=a*l+o*c+i*u-r*s,e[3]=o*l-i*s-r*u-a*c,e}function te(e,t,n,i){var r,a,o,s,u,c=t[0],l=t[1],h=t[2],f=t[3],d=n[0],v=n[1],p=n[2],g=n[3];return(a=c*d+l*v+h*p+f*g)<0&&(a=-a,d=-d,v=-v,p=-p,g=-g),1-a>Y.b?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,u=Math.sin(i*r)/o):(s=1-i,u=i),e[0]=s*c+u*d,e[1]=s*l+u*v,e[2]=s*h+u*p,e[3]=s*f+u*g,e}function ne(e,t){var n,i=t[0]+t[4]+t[8];if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{var r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;n=Math.sqrt(t[3*r+r]-t[3*a+a]-t[3*o+o]+1),e[r]=.5*n,n=.5/n,e[3]=(t[3*a+o]-t[3*o+a])*n,e[a]=(t[3*a+r]+t[3*r+a])*n,e[o]=(t[3*o+r]+t[3*r+o])*n}return e}Q.b,Q.g,Q.c;var ie,re,ae,oe,se,ue,ce,le=Q.l,he=Q.a,fe=Q.k,de=Q.d,ve=Q.i,pe=Q.h,ge=Q.m,me=Q.j,ye=(Q.f,Q.e,ie=K.b(),re=K.e(1,0,0),ae=K.e(0,1,0),function(e,t,n){var i=K.d(t,n);return i<-.999999?(K.c(ie,re,t),K.f(ie)<1e-6&&K.c(ie,ae,t),K.i(ie,ie),$(e,ie,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(K.c(ie,t,n),e[0]=ie[0],e[1]=ie[1],e[2]=ie[2],e[3]=1+i,me(e,e))}),be=(oe=J(),se=J(),ue=new Y.a(9),Y.a!=Float32Array&&(ue[1]=0,ue[2]=0,ue[3]=0,ue[5]=0,ue[6]=0,ue[7]=0),ue[0]=1,ue[4]=1,ue[8]=1,ce=ue,[0,0,0,1]);var _e=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(D.a)(this,t),e=Object(W.a)(this,Object(H.a)(t).call(this)),Array.isArray(n)&&1===arguments.length?e.copy(n):e.set(n,i,r,a),e}return Object(X.a)(t,e),Object(N.a)(t,[{key:"fromMatrix3",value:function(e){return ne(this,e),this.check()}},{key:"fromValues",value:function(e,t,n,i){return this.set(e,t,n,i)}},{key:"identity",value:function(){var e;return(e=this)[0]=0,e[1]=0,e[2]=0,e[3]=1,this.check()}},{key:"length",value:function(){return pe(this)}},{key:"squaredLength",value:function(e){return ge(this)}},{key:"dot",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return de(this,e)}},{key:"rotationTo",value:function(e,t){return ye(this,e,t),this.check()}},{key:"add",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return he(this,e),this.check()}},{key:"calculateW",value:function(){var e,t,n,i,r;return e=this,n=(t=this)[0],i=t[1],r=t[2],e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),this.check()}},{key:"conjugate",value:function(){var e,t;return t=this,(e=this)[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],this.check()}},{key:"invert",value:function(){var e,t,n,i,r,a,o,s;return e=this,n=(t=this)[0],i=t[1],r=t[2],a=t[3],s=(o=n*n+i*i+r*r+a*a)?1/o:0,e[0]=-n*s,e[1]=-i*s,e[2]=-r*s,e[3]=a*s,this.check()}},{key:"lerp",value:function(e,t,n){return ve(this,e,t,n),this.check()}},{key:"multiply",value:function(e,t){if(void 0!==t)throw new Error("Quaternion.multiply only takes one argument");return ee(this,this,e),this.check()}},{key:"normalize",value:function(){return me(this,this),this.check()}},{key:"rotateX",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+o*s,e[1]=r*u+a*s,e[2]=a*u-r*s,e[3]=o*u-i*s}(this,this,e),this.check()}},{key:"rotateY",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u-a*s,e[1]=r*u+o*s,e[2]=a*u+i*s,e[3]=o*u-r*s}(this,this,e),this.check()}},{key:"rotateZ",value:function(e){return function(e,t,n){n*=.5;var i=t[0],r=t[1],a=t[2],o=t[3],s=Math.sin(n),u=Math.cos(n);e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=a*u+o*s,e[3]=o*u-a*s}(this,this,e),this.check()}},{key:"scale",value:function(e){return fe(this,this,e),this.check()}},{key:"set",value:function(e,t,n,i){return le(this,e,t,n,i),this.check()}},{key:"setAxisAngle",value:function(e,t){return $(this,e,t),this.check()}},{key:"slerp",value:function(e){var t=e.start;return te(this,void 0===t?be:t,e.target,e.ratio),this.check()}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(e){return this[0]=Object(Z.a)(e)}},{key:"y",get:function(){return this[1]},set:function(e){return this[1]=Object(Z.a)(e)}},{key:"z",get:function(){return this[2]},set:function(e){return this[2]=Object(Z.a)(e)}},{key:"w",get:function(){return this[3]},set:function(e){return this[3]=Object(Z.a)(e)}}]),t}(q.a),xe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},we={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Oe(e){if(!e._animation){var t=we[e.componentType],n=xe[e.type],i=n*e.count,r=e.bufferView.data,a=new t(r.buffer,r.byteOffset+(e.byteOffset||0),i);if(1===n)e._animation=Array.from(a);else{for(var o=[],s=0;s=s}),c=Math.max(0,u-1);if(!Array.isArray(n[i]))switch(i){case"translation":n[i]=[0,0,0];break;case"rotation":n[i]=[0,0,0,1];break;case"scale":n[i]=[1,1,1];break;default:R.a.warn("Bad animation path ".concat(i))()}Object(G.a)(n[i].length===o[c].length);var l=r[c],h=r[u];switch(a){case"STEP":!function(e,t,n){for(var i=0;il){var f=(s-l)/(h-l);!function(e,t,n,i,r){if("rotation"===t){Se.slerp({start:n,target:i,ratio:r});for(var a=0;al){var d=(s-l)/(h-l),v=h-l;!function(e,t,n){for(var i=n.p0,r=n.outTangent0,a=n.inTangent1,o=n.p1,s=n.tDiff,u=n.ratio,c=0;c2&&void 0!==arguments[2]?arguments[2]:null,i=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},r=new g.a(this.gl,{id:e.name||e.id,parameters:i,pixelStore:Object(Ae.a)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1),data:e.texture.source.getImageAsync()});this.uniforms[t]=r,this.defineIfPresent(n,n),this.generatedTextures.push(r)}},{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 t=e.metallicFactor,n=void 0===t?1:t,i=e.roughnessFactor,r=void 0===i?1:i;this.uniforms.u_MetallicRoughnessValues=[n,r]}},{key:"parseMaterial",value:function(e){if(e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var t=e.normalTexture.scale,n=void 0===t?1:t;this.uniforms.u_NormalScale=n}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var i=e.occlusionTexture.strength,r=void 0===i?1:i;this.uniforms.u_OcclusionStrength=r}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){var a=e.alphaCutoff,o=void 0===a?.5:a;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=o}else"BLEND"===e.alphaMode&&(R.a.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]}))}}]),e}(),Le="\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n",Ie="\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n";function Re(e,t){return Object(b.d)(e)?"#version 300 es\n".concat(t):t}var Fe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},Ne=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(D.a)(this,e),this.gl=t,this.options=Object.assign({},De,n)}return Object(N.a)(e,[{key:"instantiate",value:function(e){var t=this;return this.gltf=e,(e.scenes||[]).map(function(e){return t.createScene(e)})}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new Ce(this.gltf):null}},{key:"createScene",value:function(e){var t=this,n=(e.nodes||[]).map(function(e){return t.createNode(e)});return new B.a({id:e.name||e.id,children:n})}},{key:"createNode",value:function(e){var t=this;if(!e._node){var n=(e.children||[]).map(function(e){return t.createNode(e)});e.mesh&&n.push(this.createMesh(e.mesh));var i=new B.a({id:e.name||e.id,children:n});if(e.matrix)i.setMatrix(e.matrix);else{if(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation){var r=(new z.a).fromQuaternion(e.rotation);i.matrix.multiplyRight(r)}e.scale&&i.matrix.scale(e.scale)}e._node=i}return e._node}},{key:"createMesh",value:function(e){var t=this;if(!e._mesh){var n=(e.primitives||[]).map(function(n,i){return t.createPrimitive(n,i,e)}),i=new B.a({id:e.name||e.id,children:n});e._mesh=i}return e._mesh}},{key:"getVertexCount",value:function(e){R.a.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,t,n){return function(e,t){var n=t.id,i=t.drawMode,r=t.vertexCount,a=t.attributes,o=t.modelOptions,s=new Me(e,t);R.a.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,Object(Ee.a)(s.generatedTextures)),u.push.apply(u,Object(Ee.a)(Object.values(a).map(function(e){return e.buffer})));var c=new Te.a(e,Object.assign({id:n,drawMode:i,vertexCount:r,modules:[F.a],defines:s.defines,parameters:s.parameters,vs:Re(e,Le),fs:Re(e,Ie),managedResources:u},o));return c.setProps({attributes:a}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:e.name||"".concat(n.name||n.id,"-primitive-").concat(t),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))}},{key:"createAttributes",value:function(e,t){var n=this,i={};return Object.keys(e).forEach(function(t){i[t]=n.createAccessor(e[t],n.createBuffer(e[t],n.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),R.a.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}},{key:"createBuffer",value:function(e,t){e.bufferView||(e.bufferView={});var n=e.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new U.a(this.gl,{id:"from-".concat(n.id),data:n.data||e.value,target:t})),n.lumaBuffers[t]}},{key:"createAccessor",value:function(e,t){return new V.a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Fe[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),e}();var ze=n(51),Be=n.n(ze),Ue=n(154),Ve=n.n(Ue);function Ge(){return(Ge=Ve()(Be.a.mark(function e(t){var n;return Be.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t.scenes.forEach(function(e){e.traverse(function(e){Object.values(e.model.program.uniforms).forEach(function(e){!1===e.loaded&&n.push(e)})})}),e.next=4,We(function(){return n.some(function(e){return!e.loaded})});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function We(e){return He.apply(this,arguments)}function He(){return(He=Ve()(Be.a.mark(function e(t){return Be.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=5;break}return e.next=3,new Promise(function(e){return requestAnimationFrame(e)});case 3:e.next=0;break;case 5:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}var Xe=[255,255,255,255],qe={scenegraph:{type:"object",value:null,async:!0},getScene:function(e){return e&&e.scenes?"object"===L()(e.scene)?e.scene:e.scenes[e.scene||0]:e},getAnimator:function(e){return e&&e.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},getPosition:{type:"accessor",value:function(e){return e.position}},getColor:{type:"accessor",value:Xe},opacity:{type:"number",min:0,max:1,value:1},_lighting:"flat",_enableOffsetModelMatrix:!1,_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:[]}},Ze=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:this.use64bitPositions()?5130:5126,accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:Xe,transition:!0},instanceModelMatrix:k})}},{key:"updateState",value:function(e){f()(l()(t.prototype),"updateState",this).call(this,e);var n=e.props,i=e.oldProps;n.scenegraph!==i.scenegraph?this._updateScenegraph(n):n._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,n._animations)}},{key:"finalizeState",value:function(){f()(l()(t.prototype),"finalizeState",this).call(this),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(e){var t,n=this,i=this.context.gl;if(e.scenegraph instanceof I.a)t={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var r=e.scenegraph,a=function(e,t,n){var i=new Ne(e,n);return{scenes:i.instantiate(t),animator:i.createAnimator()}}(i,r,this.getLoadOptions());t=Object.assign({gltf:r},a),function(e){return Ge.apply(this,arguments)}(a).then(function(){return n.setNeedsRedraw()})}else R.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader"),t=e.scenegraph;var o={layer:this,gl:i},s=e.getScene(t,o),u=e.getAnimator(t,o);s instanceof I.a?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&R.a.warn("invalid scenegraph:",s)()}},{key:"_applyAllAttributes",value:function(e){var t=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();e.traverse(function(e){t._setModelAttributes(e.model,n)})}}},{key:"_applyAnimationsProp",value:function(e,t,n){if(e&&t&&n){var i=t.getAnimations();Object.keys(n).sort().forEach(function(e){var t=n[e];if("*"===e)i.forEach(function(e){Object.assign(e,t)});else if(Number.isFinite(Number(e))){var r=Number(e);r>=0&&r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=t.layers||{};return e.map(function(e){var i=n[e.type],r=function(e,t,n){var i={};for(var r in t){var a=t[r];if("string"==typeof a){var o=e&&e._propTypes&&e._propTypes[r],s="object"===u()(o)&&o.type;switch(r.startsWith("get")&&(s="accessor"),s){case"accessor":a=C(a,n,!0);break;case"function":a=C(a,n)}}a&&(i[r]=a)}return i}(i,e,t);return r.fetch=z,i&&new i(r)})}(t.data,t.configuration))}},{key:"renderLayers",value:function(){return this.state.layers}}]),t}(n(196).a);function w(e,t){var n=function(e){if("string"==typeof e){var t=P[e];return t||(t=e.split("."),P[e]=t),t}return Array.isArray(e)?e:[e]}(t),i=e,r=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){var c=s.value;i=O(i)?i[c]:void 0}}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return i}function O(e){return null!==e&&"object"===u()(e)}x.layerName="JSONLayer",x.defaultProps=_;var P={};var S=n(189),j=n.n(S),k={"-":function(e){return e}};function C(e,t,n){if(e in k)return k[e];var i,r=j.a.parse(e);return r.right||r.left||"Identifier"!==r.type?(!function e(t,n){if(Array.isArray(t))t.forEach(function(t){return e(t,n)});else if(t&&"object"===u()(t))for(var i in t.type&&n(t),t)e(t[i],n)}(r,function(e){if("CallExpression"===e.type)throw new Error("Function calls not allowed in JSON expressions")}),i=n?function(e){return j.a.eval(r,e)}:function(e){return j.a.eval(r,{args:e})}):i=function(t){return w(t,e)},k[e]=i,i}var E={},T={},A=34,M=10,L=13;function I(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")}var R=function(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],a=e.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return T;if(c)return c=!1,E;var t,i,r=o;if(e.charCodeAt(r)===A){for(;o++=a?u=!0:(i=e.charCodeAt(o++))===M?c=!0:i===L&&(c=!0,e.charCodeAt(o)===M&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o0&&t.shift();var n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;for(var u in s){var c=parseFloat(s[u]);Number.isNaN(c)||(s[u]=c)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t}(e)}})}var B={MapView:l.a,FirstPersonView:h.a,OrbitView:f.a,OrthographicView:d.a},U={style:"mapbox://styles/mapbox/light-v9"};function V(e,t){var n=e;return n.layers&&(n.layers=function(e,t){var n=!0,i=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;t.layers[s.type]||c.a.warn("Unknown layer ".concat(s.type))()}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return[new x({data:e,configuration:t})]}(e.layers,t)),n.views&&(n.views=function(e,t){if(!e)return e;var n=t.views||{};return(e=Array.isArray(e)?e:[e]).map(function(e){var t=n[e.type]||B[e.type];if(t){var i=Object.assign({},e);return delete i.type,new t(i)}return null}).filter(Boolean)}(e.views,t)),"initialViewState"in n&&(n.viewState=n.viewState||n.initialViewState),function(e,t){(e.map||e.mapStyle)&&(e.map=Object.assign({},U,e.map));if(!e.map)return;"mapStyle"in e&&(e.map.style=e.mapStyle,e.map.mapStyle=e.mapStyle,delete e.mapStyle);"viewState"in e&&(e.map.viewState=e.viewState)}(n),n}var G=function(){function e(t){r()(this,e),this.configuration={},this.onJSONChange=function(){},this.setProps(t)}return o()(e,[{key:"finalize",value:function(){}},{key:"setProps",value:function(e){"configuration"in e&&(this.configuration=e.configuration),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}},{key:"convertJsonToDeckProps",value:function(e){if(!e||e===this.json)return this.deckProps;this.json=e;var t=V(function(e){return"string"==typeof e?JSON.parse(e):Object.assign({},e)}(e),this.configuration);"initialViewState"in t&&((!this.initialViewState||!function(e,t){if(e===t)return!0;if("object"!==u()(e)||null===e||"object"!==u()(t)||null===t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}(t.initialViewState,this.initialViewState))&&(t.viewState=t.initialViewState,this.initialViewState=t.initialViewState),delete t.initialViewState);return this.deckProps=t,t}}]),e}();n.d(t,"_JSONConverter",function(){return G}),n.d(t,"_JSONLayer",function(){return x})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(6),u=n.n(s),c=n(3),l=n.n(c),h=n(13),f=n.n(h),d=n(7),v=n.n(d),p=n(225),g=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"getShaders",value:function(){return Object.assign({},f()(l()(t.prototype),"getShaders",this).call(this),{vs:"#define SHADER_NAME great-circle-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec4 instancePositions;\nattribute vec4 instancePositions64xyLow;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) *\n sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\n if(abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n}\n\nvoid main(void) {\n geometry.worldPosition = vec3(instancePositions.xy, 0.0);\n geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0);\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n \n vec2 source = radians(instancePositions.xy);\n vec2 target = radians(instancePositions.zw);\n \n float angularDist = getAngularDist(source, target);\n\n vec3 currPos = vec3(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0);\n vec3 nextPos = vec3(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0);\n\n vec2 currPos64Low = mix(instancePositions64xyLow.xy, instancePositions64xyLow.zw, segmentRatio);\n vec2 nextPos64Low = mix(instancePositions64xyLow.xy, instancePositions64xyLow.zw, nextSegmentRatio);\n\n vec4 curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\n vec4 next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale),\n widthMinPixels, widthMaxPixels\n );\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n picking_setPickingColor(instancePickingColors);\n}\n",modules:["picking","project32"]})}}]),t}(p.a);g.layerName="GreatCircleLayer";var m=n(196),y=n(222),b=n(16),_=n.n(b),x=n(144),w=n(235),O=n.n(w);var P=180/Math.PI,S=100;function j(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){var t=e.padEnd(16,"0");return O.a.fromString(t,16)}(e)}return x.S2.S2Cell.toHilbertQuadkey(e.toString())}function k(e){var t=j(e);return function(e){for(var t,n,i,r,a,o,s=e.face,u=e.ij,c=e.level,l=[],h=[[0,0],[0,1],[1,1],[1,0],[0,0]],f=Math.max(1,S*Math.pow(2,-c)),d=0;d<4;d++)for(var v=h[d].slice(0),p=h[d+1],g=(p[0]-v[0])/f,m=(p[1]-v[1])/f,y=0;yt[0]?e:t[0]},-180),t.reduce(function(e,t){return e>t[1]?e:t[1]},-90)]}(e=new e.constructor(Object.assign({},e,{zoom:i}))),a=Object(L.g)([r[0],r[3]],e.scale).map(R),o=_()(a,2),s=o[0],u=o[1],c=Object(L.g)([r[2],r[1]],e.scale).map(R),l=_()(c,2),h=l[0],f=l[1];s=Math.max(0,Math.floor(s)),h=Math.min(e.scale,Math.ceil(h)),u=Math.max(0,Math.floor(u)),f=Math.min(e.scale,Math.ceil(f));for(var d=[],v=s;vt?d.push(F({x:v,y:p,z:i},t)):d.push({x:v,y:p,z:i});return d}(e,a,o);if(s&&0!==s.length){var u=new Set;n.forEach(function(e){s.some(function(t){return e.isOverlapped(t)})&&(e.isVisible=!0,u.add(e))});for(var c=0;ce){var n=t[Symbol.iterator](),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var u=o.value;if(t.size<=e)break;var c=u[0];u[1].isVisible||t.delete(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}}}},{key:"_markOldTiles",value:function(){this._cache.forEach(function(e){e.isVisible=!1})}},{key:"_getTile",value:function(e,t,n){var i=this._getTileId(e,t,n);return this._cache.get(i)}},{key:"_getTileId",value:function(e,t,n){return"".concat(n,"-").concat(e,"-").concat(t)}}]),e}(),N={renderSubLayers:{type:"function",value:function(e){return new T.a(e)}},getTileData:{type:"function",value:function(e){e.x,e.y,e.z;return Promise.resolve(null)}},onViewportLoaded:{type:"function",value:function(){}},onTileError:{type:"function",value:function(e){return console.error(e)}},maxZoom:null,minZoom:0,maxCacheSize:null},z=function(e){function t(){return r()(this,t),u()(this,l()(t).apply(this,arguments))}return v()(t,e),o()(t,[{key:"initializeState",value:function(){var e=this.props,t=e.maxZoom,n=e.minZoom,i=e.getTileData,r=e.onTileError;this.state={tiles:[],tileCache:new D({getTileData:i,maxZoom:t,minZoom:n,onTileError:r}),isLoaded:!1}}},{key:"shouldUpdateState",value:function(e){return e.changeFlags.somethingChanged}},{key:"updateState",value:function(e){var t=this,n=e.props,i=(e.oldProps,e.context),r=e.changeFlags,a=n.onViewportLoaded,o=n.onTileError;if(r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getTileData)){var s=n.getTileData,u=n.maxZoom,c=n.minZoom,l=n.maxCacheSize;this.state.tileCache.finalize(),this.setState({tileCache:new D({getTileData:s,maxSize:l,maxZoom:u,minZoom:c,onTileError:o})})}if(r.viewportChanged){var h=i.viewport,f=this.getLayerZoomLevel();"DEFAULT-INITIAL-VIEWPORT"!==h.id&&this.state.tileCache.update(h,function(e){var n=e.filter(function(e){return e.z===f}),i=n.every(function(e){return e.isLoaded});t.setState({tiles:e,isLoaded:i}),i?a(n.filter(function(e){return e._data}).map(function(e){return e._data})):Promise.all(n.map(function(e){return e.data})).then(function(){t.setState({isLoaded:!0}),a(n.filter(function(e){return e._data}).map(function(e){return e._data}))})})}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=e.sourceLayer;return t.sourceLayer=n,t.tile=n.props.tile,t}},{key:"getLayerZoomLevel",value:function(){var e=Math.floor(this.context.viewport.zoom),t=this.props,n=t.maxZoom,i=t.minZoom;return n&&parseInt(n,10)===n&&e>n?n:i&&parseInt(i,10)===i&&e currentTime || vTime < currentTime - trailLength) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"color.a *= 1.0 - (currentTime - vTime) / trailLength;"},e}},{key:"initializeState",value:function(e){f()(l()(t.prototype),"initializeState",this).call(this,e),this.getAttributeManager().addInstanced({instanceTimestamps:{size:2,update:this.calculateInstanceTimestamps}})}},{key:"draw",value:function(e){var n=this.props,i=n.trailLength,r=n.currentTime,a=n.getTimestamps;e.uniforms=Object.assign({},e.uniforms,{trailLength:i,currentTime:r,isPath3D:Boolean(a)}),f()(l()(t.prototype),"draw",this).call(this,e)}},{key:"calculateInstanceTimestamps",value:function(e,t){var n=t.startRow,i=t.endRow,r=this.props,a=r.data,o=r.getTimestamps;if(!o)return e.constant=!0,void(e.value=new Float32Array(2));for(var s=this.state.pathTesselator,u=s.bufferLayout,c=s.instanceCount,l=new Float32Array(2*c),h=Object(U.a)(a,n,i),f=h.iterable,d=h.objectInfo,v=0,p=0;p180?s[0]-=360:u<-180&&(s[0]+=360)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}function Q(e,t,n){var i=e(t,n),r=Object(G.h3ToGeo)(i),a=_()(r,2),o=a[0];return[a[1],o]}function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(G.h3ToGeoBoundary)(e,!0);return 1!==t?function(e,t,n){var i=Object(G.h3ToGeo)(e),r=_()(i,2),a=r[0],o=r[1],s=t.length;K(t,o);for(var u=t[0]===t[s-1]?s-1:s,c=0;c=0?Object(G.edgeLength)(i,G.UNITS.km):0,hasPentagon:r})}this._updateVertices(this.context.viewport)}},{key:"_shouldUseHighPrecision",value:function(){var e=this.state,t=e.resolution,n=e.hasPentagon;return this.props.highPrecision||n||t>=0&&t<=5}},{key:"_updateVertices",value:function(e){if(!this._shouldUseHighPrecision()){var t=this.state,n=t.resolution,i=t.edgeLengthKM,r=t.centerHex;if(!(n<0)){var a=Object(G.geoToH3)(e.latitude,e.longitude,n);if(!(r===a||r&&Object(G.h3Distance)(r,a)*i<10)){var o=e.distanceScales.pixelsPerMeter,s=J(a),u=Object(G.h3ToGeo)(a),c=_()(u,2),l=c[0],h=c[1],f=e.projectFlat([h,l]),d=_()(f,2),v=d[0],p=d[1];s=s.map(function(t){var n=e.projectFlat(t);return n[0]=(n[0]-v)/o[0],n[1]=(n[1]-p)/o[1],n}),this.setState({centerHex:a,vertices:s})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var e=this.props,t=e.elevationScale,n=e.material,i=e.coverage,r=e.extruded,a=e.wireframe,o=e.stroked,s=e.filled,u=e.lineWidthUnits,c=e.lineWidthScale,l=e.lineWidthMinPixels,h=e.lineWidthMaxPixels,f=e.getColor,d=e.getFillColor,v=e.getElevation,p=e.getLineColor,g=e.getLineWidth,m=e.updateTriggers;return{elevationScale:t,extruded:r,coverage:i,wireframe:a,stroked:o,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:h,material:n,getElevation:v,getFillColor:f||d,getLineColor:p,getLineWidth:g,updateTriggers:{getFillColor:m.getColor||m.getFillColor,getElevation:m.getElevation,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=e.coverage,a=this.getSubLayerClass("hexagon-cell-hifi",y.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){return null==e?t:"object"===q()(e)?Object.assign({},e,{coverage:t}):{getHexagon:e,coverage:t}}(i.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,getPolygon:function(e,t){return J(n(e,t),r)}})}},{key:"_renderColumnLayer",value:function(){var e=this.props,t=e.data,n=e.getHexagon,i=e.updateTriggers,r=this.getSubLayerClass("hexagon-cell",Y.a),a=this._getForwardProps();return a.updateTriggers.getPosition=i.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:a.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Q.bind(null,n)})}}]),t}(m.a);ee.defaultProps=$,ee.layerName="H3HexagonLayer",n.d(t,"GreatCircleLayer",function(){return g}),n.d(t,"S2Layer",function(){return E}),n.d(t,"TileLayer",function(){return z}),n.d(t,"TripsLayer",function(){return V}),n.d(t,"H3ClusterLayer",function(){return H}),n.d(t,"H3HexagonLayer",function(){return ee})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(197);function u(e){var t=e.getPanes().overlayLayer,n=document.createElement("canvas");return Object.assign(n.style,{position:"absolute"}),t.appendChild(n),n}function c(e){var t=e.props.userData._eventListeners;for(var n in t)t[n].remove();e.finalize(),e.canvas.parentNode.removeChild(e.canvas)}var l=function(){return!1},h=function(){function e(t){r()(this,e),this.props={},this._map=null;var n=new google.maps.OverlayView;n.onAdd=this._onAdd.bind(this),n.onRemove=this._onRemove.bind(this),n.draw=this._draw.bind(this),this._overlay=n,this.setProps(t)}return o()(e,[{key:"setMap",value:function(e){e!==this._map&&(this._map&&(this._overlay.setMap(null),this._map=null),e&&(this._map=e,this._overlay.setMap(e)))}},{key:"setProps",value:function(e){Object.assign(this.props,e),this._deck&&this._deck.setProps(this.props)}},{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&&(c(this._deck),this._deck=null)}},{key:"_onAdd",value:function(){this._deck=function(e,t,n){if(n){if(n.props.userData._googleMap===e)return n;c(n)}var i={click:null,mousemove:null,mouseout:null};n=new s.a({canvas:u(t),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1,userData:{_googleMap:e,_eventListeners:i}});var r=function(t){i[t]=e.addListener(t,function(e){return function(e,t,n){var i;switch(t){case"click":e._lastPointerDownInfo=e.pickObject({x:n.pixel.x,y:n.pixel.y}),i=e._onEvent;break;case"mousemove":t="pointermove",i=e._onPointerMove;break;case"mouseout":t="pointerleave",i=e._onPointerMove;break;default:return}i({type:t,offsetCenter:n.pixel,srcEvent:n})}(n,t,e)})};for(var a in i)r(a);return n}(this._map,this._overlay,this._deck),this._deck.setProps(this.props)}},{key:"_onRemove",value:function(){this._deck.setProps({layerFilter:l})}},{key:"_draw",value:function(){var e=this._deck,t=function(e,t){var n=e.getDiv().firstChild,i=n.offsetWidth,r=n.offsetHeight,a=t.getProjection(),o=e.getBounds(),s=o.getNorthEast(),u=o.getSouthWest(),c=a.fromLatLngToDivPixel(s),l=a.fromLatLngToDivPixel(u),h=new google.maps.Point(0,0),f=a.fromContainerPixelToLatLng(h),d=a.fromLatLngToDivPixel(f),v=(c.x-l.x)/i,p=Math.log2(v)+e.getZoom()-1,g=new google.maps.Point(i/2,r/2),m=a.fromContainerPixelToLatLng(g),y=m.lat(),b=m.lng();return{width:i,height:r,left:d.x,top:d.y,zoom:p,pitch:e.getTilt(),latitude:y,longitude:b}}(this._map,this._overlay),n=t.width,i=t.height,r=t.left,a=t.top,o=t.zoom,s=t.pitch,u=t.latitude,c=t.longitude,h=o>=0&&0===s;e.canvas.style.left="".concat(r,"px"),e.canvas.style.top="".concat(a,"px"),e.setProps({width:n,height:i,viewState:{latitude:u,longitude:c,zoom:o},layerFilter:h?this.props.layerFilter:l}),e.redraw()}}]),e}();n.d(t,"GoogleMapsOverlay",function(){return h})},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),a=n(2),o=n.n(a),s=n(16),u=n.n(s),c=n(197),l=n(166);function h(e){var t=e.map,n=e.gl,i=e.deck;if(t.__deck)return t.__deck;var r=i&&i.props._customRender,a={useDevicePixels:!0,_customRender:function(){t.triggerRepaint(),r&&r()},parameters:{depthMask:!0,depthTest:!0,blendFunc:[770,771,1,771],blendEquation:32774},userData:{isExternal:!1,mapboxLayers:new Set}};return i?(i.setProps(a),i.props.userData.isExternal=!0):(Object.assign(a,{gl:n,width:!1,height:!1,viewState:f(t)}),i=new c.a(a),t.on("move",function(){return function(e,t){e.setProps({viewState:f(t)}),e.needsRedraw({clearRedrawFlags:!0})}(i,t)}),t.on("remove",function(){i.finalize(),t.__deck=null})),i.props.userData.mapboxVersion=function(e){var t=0,n=0;if(e.version){var i=e.version.split(".").slice(0,2).map(Number),r=u()(i,2);t=r[0],n=r[1]}return{major:t,minor:n}}(t),t.__deck=i,t.on("render",function(){return function(e,t){var n=e.props.userData,i=n.mapboxLayers;if(n.isExternal){var r=Array.from(i,function(e){return e.id}),a=v(e,function(e){for(var t=0;t0&&e._drawLayers("mapbox-repaint",{viewports:[d(e,t,!1)],layers:a,clearCanvas:!1})}e.props.userData.currentViewport=null}(i,t)}),i}function f(e){var t=e.getCenter();return{longitude:t.lng,latitude:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}}function d(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=e.props.userData.mapboxVersion;return new l.a(Object.assign({x:0,y:0,width:e.width,height:e.height},f(t),n?{nearZMultiplier:1===i.major&&i.minor>=3||i.major>=2?.02:1/(e.height||1),farZMultiplier:1.01}:{nearZMultiplier:.1,farZMultiplier:10}))}function v(e,t){return e.layerManager.getLayers().filter(t)}function p(e,t){for(var n=t;n;){if(n.id===e)return!0;n=n.parent}return!1}function g(e){if(!e.props.userData.isExternal){var t=[];e.props.userData.mapboxLayers.forEach(function(e){var n=new(0,e.props.type)(e.props);t.push(n)}),e.setProps({layers:t})}}var m=function(){function e(t){if(r()(this,e),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}return o()(e,[{key:"onAdd",value:function(e,t){var n,i;this.map=e,this.deck=h({map:e,gl:t,deck:this.props.deck}),n=this.deck,i=this,n.props.userData.mapboxLayers.add(i),g(n)}},{key:"onRemove",value:function(){var e,t;e=this.deck,t=this,e.props.userData.mapboxLayers.delete(t),g(e)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&g(this.deck)}},{key:"render",value:function(e,t){var n,i,r,a;n=this.deck,i=this.map,r=this,(a=n.props.userData.currentViewport)||(a=d(n,i,!0),n.props.userData.currentViewport=a),n._drawLayers("mapbox-repaint",{viewports:[a],layers:v(n,function(e){return p(r.id,e)}),clearCanvas:!1})}}]),e}();n.d(t,"MapboxLayer",function(){return m})},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n(23),r=n(4),a=n(5),o=1,s=1,u=function(){function e(){Object(r.a)(this,e),this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}return Object(a.a)(e,[{key:"addChannel",value:function(e){var t=e.delay,n=void 0===t?0:t,i=e.duration,r=void 0===i?Number.POSITIVE_INFINITY:i,a=e.rate,s=void 0===a?1:a,u=e.repeat,c=o++,l={time:0,delay:n,duration:r,rate:s,repeat:void 0===u?1:u};return this._setChannelTime(l,this.time),this.channels.set(c,l),c}},{key:"removeChannel",value:function(e){this.channels.delete(e);var t=!0,n=!1,r=void 0;try{for(var a,o=this.animations[Symbol.iterator]();!(t=(a=o.next()).done);t=!0){var s=Object(i.a)(a.value,2),u=s[0];s[1].channel===e&&this.detachAnimation(u)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"isFinished",value:function(e){var t=this.channels.get(e);return void 0!==t&&this.time>=t.delay+t.duration*t.repeat}},{key:"getTime",value:function(e){if(void 0===e)return this.time;var t=this.channels.get(e);return void 0===t?-1:t.time}},{key:"setTime",value:function(e){this.time=Math.max(0,e);var t=this.channels.values(),n=!0,i=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;this._setChannelTime(s,this.time)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}var u=this.animations.values(),c=!0,l=!1,h=void 0;try{for(var f,d=u[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var v=f.value,p=v.animation,g=v.channel;p.setTime(this.getTime(g))}}catch(e){l=!0,h=e}finally{try{c||null==d.return||d.return()}finally{if(l)throw h}}}},{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,t){var n=s++;return this.animations.set(n,{animation:e,channel:t}),e.setTime(this.getTime(t)),n}},{key:"detachAnimation",value:function(e){this.animations.delete(e)}},{key:"update",value:function(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}},{key:"_setChannelTime",value:function(e,t){var n=t-e.delay;n>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,n)%e.duration,e.time*=e.rate)}}]),e}()},function(e,t,n){"use strict";var i=n(4),r=n(5),a=n(86),o=function(){function e(t){Object(i.a)(this,e),this.name=t,this.reset()}return Object(r.a)(e,[{key:"incrementCount",value:function(){this.addCount(1)}},{key:"decrementCount",value:function(){this.subtractCount(1)}},{key:"addCount",value:function(e){this.count+=e}},{key:"subtractCount",value:function(e){this.count-=e}},{key:"addTime",value:function(e){this.time+=e,this.lastTiming=e,this.count++}},{key:"timeStart",value:function(){this._startTime=Object(a.a)(),this._timerPending=!0}},{key:"timeEnd",value:function(){this._timerPending&&(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1)}},{key:"getAverageTime",value:function(){return this.count>0?this.time/this.count:0}},{key:"getHz",value:function(){return this.time>0?this.count/(this.time/1e3):0}},{key:"reset",value:function(){this.time=0,this.count=0,this.lastTiming=0,this._startTime=0,this._timerPending=!1}}]),e}();n.d(t,"a",function(){return s});var s=function(){function e(t){var n=t.id;Object(i.a)(this,e),this.id=n,this.stats={},Object.seal(this)}return Object(r.a)(e,[{key:"get",value:function(e){return this.stats[e]=this.stats[e]||new o(e),this.stats[e]}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}},{key:"forEach",value:function(e){for(var t in this.stats)e(this.stats[t])}},{key:"getTable",value:function(){var e={};return this.forEach(function(t){e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}}]),e}()}])}); From d6878c9f098993cc0d8bb34e80ba38a4a7405419 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Mon, 9 Sep 2019 10:27:56 +1000 Subject: [PATCH 16/24] close #201 --- R/map_layer_heatmap.R | 16 +++++++++++++++- inst/htmlwidgets/lib/heatmap/heatmap.js | 21 ++++++++++++--------- inst/wasm/wasm.cpp | 7 ------- man/add_heatmap.Rd | 15 +++++++++++++++ 4 files changed, 42 insertions(+), 17 deletions(-) delete mode 100644 inst/wasm/wasm.cpp diff --git a/R/map_layer_heatmap.R b/R/map_layer_heatmap.R index c7d32a59..200cf301 100644 --- a/R/map_layer_heatmap.R +++ b/R/map_layer_heatmap.R @@ -26,6 +26,17 @@ mapdeckHeatmapDependency <- function() { #' @param lat column containing latitude values #' @param weight the weight of each value. Default 1 #' @param colour_range vector of 6 hex colours +#' @param radius_pixels Radius of the circle in pixels, to which the weight of an object is distributed +#' @param intensity Value that is multiplied with the total weight at a pixel to +#' obtain the final weight. A value larger than 1 biases the output color towards +#' the higher end of the spectrum, and a value less than 1 biases the output +#' color towards the lower end of the spectrum +#' @param threshold The HeatmapLayer reduces the opacity of the pixels with relatively +#' low weight to create a fading effect at the edge. +#' A larger threshold smoothens the boundaries of color blobs, while making pixels +#' with low relative weight harder to spot (due to low alpha value). +#' Threshold is defined as the ratio of the fading weight to the max weight, between 0 and 1. +#' For example, 0.1 affects all pixels with weight under 10\% of the max. #' #' @inheritSection add_polygon data #' @@ -78,6 +89,9 @@ add_heatmap <- function( polyline = NULL, weight = NULL, colour_range = NULL, + radius_pixels = 30, + intensity = 1, + threshold = 0.05, layer_id = NULL, update_view = TRUE, focus_layer = FALSE, @@ -142,7 +156,7 @@ add_heatmap <- function( invoke_method( map, jsfunc, map_type( map ), shape[["data"]], layer_id, colour_range, - bbox, update_view, focus_layer + radius_pixels, intensity, threshold, bbox, update_view, focus_layer ) } diff --git a/inst/htmlwidgets/lib/heatmap/heatmap.js b/inst/htmlwidgets/lib/heatmap/heatmap.js index 33f92985..b2d78e24 100644 --- a/inst/htmlwidgets/lib/heatmap/heatmap.js +++ b/inst/htmlwidgets/lib/heatmap/heatmap.js @@ -1,4 +1,4 @@ -function add_heatmap_geo( map_id, map_type, heatmap_data, layer_id, colour_range, bbox, update_view, focus_layer ) { +function add_heatmap_geo( map_id, map_type, heatmap_data, layer_id, colour_range, radius_pixels, intensity, threshold, bbox, update_view, focus_layer , legend) { const heatmapLayer = new deck.HeatmapLayer({ map_id: map_id, @@ -6,15 +6,16 @@ function add_heatmap_geo( map_id, map_type, heatmap_data, layer_id, colour_range data: heatmap_data, //pickable: true, - radiusPixels: 30, - intensity: 1, - threshold: 0.05, + radiusPixels: radius_pixels || 30, + intensity: intensity || 1, + threshold: threshold || 0.05, colorRange: md_to_rgba( colour_range ), getPosition: d => md_get_point_coordinates( d ), - getWeight: d => d.properties.weight + getWeight: d => d.properties.weight, //onClick: info => md_layer_click( map_id, "heatmap", info ), + //onSetColorDomain: d => md_colour_domain( d, colour_range, map_id, map_type, layer_id, legend ) }); @@ -28,7 +29,7 @@ function add_heatmap_geo( map_id, map_type, heatmap_data, layer_id, colour_range md_layer_view( map_id, map_type, layer_id, focus_layer, bbox, update_view ); } -function add_heatmap_polyline( map_id, map_type, heatmap_data, layer_id, colour_range, bbox, update_view, focus_layer ) { +function add_heatmap_polyline( map_id, map_type, heatmap_data, layer_id, colour_range, radius_pixels, intensity, threshold, bbox, update_view, focus_layer, legend ) { const heatmapLayer = new deck.HeatmapLayer({ map_id: map_id, @@ -36,15 +37,17 @@ function add_heatmap_polyline( map_id, map_type, heatmap_data, layer_id, colour_ data: heatmap_data, //pickable: true, - radiusPixels: 30, - intensity: 1, - threshold: 0.05, + radiusPixels: radius_pixels || 30, + intensity: intensity || 1, + threshold: threshold || 0.05, colorRange: md_to_rgba( colour_range ), getPosition: d => md_get_point_coordinates( d ), getWeight: d => d.properties.weight, //onClick: info => md_layer_click( map_id, "heatmap", info ), + //onSetColorDomain: d => md_colour_domain( d, colour_range, map_id, map_type, layer_id, legend ) + }); if( map_type == "google_map") { md_update_overlay( map_id, 'heatmap-'+layer_id, heatmapLayer ); diff --git a/inst/wasm/wasm.cpp b/inst/wasm/wasm.cpp deleted file mode 100644 index f7b40df1..00000000 --- a/inst/wasm/wasm.cpp +++ /dev/null @@ -1,7 +0,0 @@ - - -// TODO -// cpp code to call wasm to call javascript -// .wasm file will be in /inst/htmlwidgets/lib -// compiler steps.... -// diff --git a/man/add_heatmap.Rd b/man/add_heatmap.Rd index 393f221b..3f83cef3 100644 --- a/man/add_heatmap.Rd +++ b/man/add_heatmap.Rd @@ -6,6 +6,7 @@ \usage{ add_heatmap(map, data = get_map_data(map), lon = NULL, lat = NULL, polyline = NULL, weight = NULL, colour_range = NULL, + radius_pixels = 30, intensity = 1, threshold = 0.05, layer_id = NULL, update_view = TRUE, focus_layer = FALSE, digits = 6) } @@ -25,6 +26,20 @@ EPSG:4326 (WGS 84) coordinate system} \item{colour_range}{vector of 6 hex colours} +\item{radius_pixels}{Radius of the circle in pixels, to which the weight of an object is distributed} + +\item{intensity}{Value that is multiplied with the total weight at a pixel to +obtain the final weight. A value larger than 1 biases the output color towards +the higher end of the spectrum, and a value less than 1 biases the output +color towards the lower end of the spectrum} + +\item{threshold}{The HeatmapLayer reduces the opacity of the pixels with relatively +low weight to create a fading effect at the edge. +A larger threshold smoothens the boundaries of color blobs, while making pixels +with low relative weight harder to spot (due to low alpha value). +Threshold is defined as the ratio of the fading weight to the max weight, between 0 and 1. +For example, 0.1 affects all pixels with weight under 10\% of the max.} + \item{layer_id}{single value specifying an id for the layer. Use this value to distinguish between shape layers of the same type. Layers with the same id are likely to conflict and not plot correctly} From 5325f15d177b758c2df221349b16ab8c10bc2b58 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Mon, 9 Sep 2019 11:42:26 +1000 Subject: [PATCH 17/24] trip updates --- R/map_layer_trips.R | 9 +++++---- inst/htmlwidgets/lib/scatterplot/scatterplot.js | 1 - inst/htmlwidgets/lib/trips/trips.js | 16 ++++++++-------- inst/htmlwidgets/mapdeck_location.js | 8 -------- man/add_trips.Rd | 7 ++++--- 5 files changed, 17 insertions(+), 24 deletions(-) diff --git a/R/map_layer_trips.R b/R/map_layer_trips.R index 320f5a04..3153b137 100644 --- a/R/map_layer_trips.R +++ b/R/map_layer_trips.R @@ -18,7 +18,8 @@ mapdeckTripsDependency <- function() { #' @inheritParams add_path #' @param data sf object with XYZM dimensions. #' @param stroke_colour variable of data or hex colour for the stroke. -#' @param trail_length length in metres of the trail +#' @param trail_length how long it takes for the trail to completely fade out +#' (in same units as timestamps ) #' @param opacity single value in [0,1] #' @param start_time the minimum timestamp #' @param end_time the maximum timestamp @@ -37,8 +38,8 @@ mapdeckTripsDependency <- function() { #' #' mapdeck( #' style = mapdeck_style("dark") -#' , location = c(145, -37.9) -#' , zoom = 8 +#' #, location = c(145, -37.9) +#' #, zoom = 8 #' ) %>% #' add_trips( #' data = sf @@ -80,7 +81,7 @@ add_trips <- function( l <- resolve_legend_options( l, legend_options ) l <- resolve_data( data, l, c("LINESTRING","MULTILINESTRING") ) - #bbox <- init_bbox() + # bbox <- init_bbox() #update_view <- force( update_view ) #focus_layer <- force( focus_layer ) diff --git a/inst/htmlwidgets/lib/scatterplot/scatterplot.js b/inst/htmlwidgets/lib/scatterplot/scatterplot.js index b1a3ed40..305bc736 100644 --- a/inst/htmlwidgets/lib/scatterplot/scatterplot.js +++ b/inst/htmlwidgets/lib/scatterplot/scatterplot.js @@ -33,7 +33,6 @@ function add_scatterplot_geo( map_id, map_type, scatter_data, layer_id, auto_hig if( map_type == "google_map") { md_update_overlay( map_id, 'scatterplot-'+layer_id, scatterLayer ); } else { - md_update_layer( map_id, 'scatterplot-'+layer_id, scatterLayer ); } diff --git a/inst/htmlwidgets/lib/trips/trips.js b/inst/htmlwidgets/lib/trips/trips.js index 852c5b0a..172c01b8 100644 --- a/inst/htmlwidgets/lib/trips/trips.js +++ b/inst/htmlwidgets/lib/trips/trips.js @@ -2,8 +2,6 @@ function add_trips_geo( map_id, map_type, trips_data, opacity, layer_id, trail_length, start_time, end_time, animation_speed, legend ) { - console.log( trips_data ); - var tripsLayer = new TripsLayer({ id: 'trips-'+layer_id, data: trips_data, @@ -23,21 +21,21 @@ trail_length, start_time, end_time, animation_speed, legend ) { if( map_type == "google_map") { md_update_overlay( map_id, 'trips-'+layer_id, tripsLayer ); - } else { - md_update_layer( map_id, 'trips-'+layer_id, tripsLayer ); - } + } else { + md_update_layer( map_id, 'trips-'+layer_id, tripsLayer ); + } if (legend !== false) { md_add_legend( map_id, map_type, layer_id, legend ); } - //md_layer_view( map_id, map_type, layer_id, focus_layer, bbox, update_view ); + //md_layer_view( map_id, map_type, layer_id, true, bbox, true ); animate_trips( map_id, map_type, trips_data, opacity, layer_id, trail_length, start_time, end_time, animation_speed, legend ); //function animate_trips( tripsLayer ) { function animate_trips( map_id, map_type, trips_data, opacity, layer_id, -trail_length, start_time, end_time, animation_speed, legend ) { +trail_length, start_time, end_time, animation_speed, legend) { var loopLength = end_time - start_time; // unit corresponds to the timestamp in source data var animationSpeed = animation_speed; // unit time per second @@ -66,7 +64,7 @@ trail_length, start_time, end_time, animation_speed, legend ) { if( map_type == "google_map") { - md_update_overlay( map_id, 'trips-'+layer_id, tripsLayer ); + md_update_overlay( map_id, 'trips-'+layer_id, tripsLayer ); } else { md_update_layer( map_id, 'trips-'+layer_id, tripsLayer ); } @@ -75,6 +73,8 @@ trail_length, start_time, end_time, animation_speed, legend ) { md_add_legend( map_id, map_type, layer_id, legend ); } + //md_layer_view( map_id, map_type, layer_id, false, bbox, false ); + window.requestAnimationFrame( function() { animate_trips( map_id, map_type, trips_data, opacity, layer_id, trail_length, start_time, end_time, animation_speed, legend ); diff --git a/inst/htmlwidgets/mapdeck_location.js b/inst/htmlwidgets/mapdeck_location.js index e37d686b..d399a264 100644 --- a/inst/htmlwidgets/mapdeck_location.js +++ b/inst/htmlwidgets/mapdeck_location.js @@ -1,6 +1,5 @@ function md_change_location( map_id, map_type, location, zoom, pitch, bearing, duration, transition ) { - var currentLon, currentLat, currentPitch, currentBearing, currentZoom; if( map_type == "google_map" ) { @@ -34,19 +33,12 @@ function md_change_location( map_id, map_type, location, zoom, pitch, bearing, d transitionDuration: duration }, }); - - - //window[ map_id + 'map' ].setProps({ - // viewState: null - //}); - } } function md_layer_view( map_id, map_type, layer_id, focus_layer, bbox, update_view ) { - if( focus_layer ) { md_clear_bounds( map_id ); update_view = true; // force this diff --git a/man/add_trips.Rd b/man/add_trips.Rd index 8d119ad1..29102bc3 100644 --- a/man/add_trips.Rd +++ b/man/add_trips.Rd @@ -28,7 +28,8 @@ where the 4th column represents the alpha. You can use a named list to specify a palette for different colour options (where available), e.g. list(fill_colour = "viridis", stroke_colour = "inferno")} -\item{trail_length}{length in metres of the trail} +\item{trail_length}{how long it takes for the trail to completely fade out +(in same units as timestamps )} \item{start_time}{the minimum timestamp} @@ -96,8 +97,8 @@ sf <- gpx::gpx_sf( gpx, time = "counter" ) mapdeck( style = mapdeck_style("dark") - , location = c(145, -37.9) - , zoom = 8 + #, location = c(145, -37.9) + #, zoom = 8 ) \%>\% add_trips( data = sf From 8f4d2fd5ccf2db7f8c3d1c49623f19aa5ac3e679 Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 14 Sep 2019 17:02:49 +1000 Subject: [PATCH 18/24] close #224 and geojson line dashes --- DESCRIPTION | 1 + NEWS.md | 1 + R/map_layer_geojson.R | 30 ++++++++++++++++++- R/map_layer_path.R | 6 ++++ README.Rmd | 1 + README.md | 1 + inst/htmlwidgets/lib/geojson/geojson.js | 38 +++++++++++++++++-------- inst/htmlwidgets/lib/path/path.js | 2 ++ inst/include/mapdeck_defaults.hpp | 5 ++++ man/add_geojson.Rd | 36 +++++++++++++++++++---- man/add_path.Rd | 7 ++++- src/geojson.cpp | 4 ++- src/path.cpp | 4 ++- 13 files changed, 114 insertions(+), 22 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 20d5708b..9277b522 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,4 +43,5 @@ LinkingTo: jsonify, rapidjsonr, Rcpp, + sfheaders, spatialwidget (>= 0.2.1005) diff --git a/NEWS.md b/NEWS.md index 9e4f3916..dd3cc354 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # mapdeck 0.3 +* `add_path()` accepts dashed lines * mapbox tokens are searched for in environement variables if one isn't provided [issue209](https://github.com/SymbolixAU/mapdeck/issues/209) * z-fighting [issue 199](https://github.com/SymbolixAU/mapdeck/issues/199) * factors correctly used in legends [issue #138](https://github.com/SymbolixAU/mapdeck/issues/138) diff --git a/R/map_layer_geojson.R b/R/map_layer_geojson.R index 5e393bd1..5514edec 100644 --- a/R/map_layer_geojson.R +++ b/R/map_layer_geojson.R @@ -22,11 +22,24 @@ mapdeckGeojsonDependency <- function() { #' @param stroke_colour column of an \code{sf} object, or field inside a GeoJSON \code{property} to use for colour #' @param stroke_opacity column of an \code{sf} object, or field inside a GeoJSON \code{property} to use for opacity #' @param stroke_width column of an \code{sf} object, or field inside a GeoJSON \code{property} to use for width (in meters) +#' @param dash_size size of each dash, relative to the width of the stroke +#' @param dash_gap size of the gap between dashes, relative to the width of the stroke #' @param fill_colour column of an \code{sf} object, or field inside a GeoJSON \code{property} to use for colour #' @param fill_opacity column of an \code{sf} object, or field inside a GeoJSON \code{property} to use for opacity #' @param radius radius of points in meters. Default 1. See details #' @param elevation elevation of polygons. Default 0. See details #' @param light_settings list of light setting parameters. See \link{light_settings} +#' @param line_width_units The units of the line width, one of 'meters', 'pixels'. +#' When zooming in and out, meter sizes scale with the base map, and pixel sizes remain the same on screen. +#' @param line_width_scale The line width multiplier that multiplied to all lines, +#' including the LineString and MultiLineString features and also the outline for +#' Polygon and MultiPolygon features if the stroked attribute is true +#' @param line_width_min_pixels The minimum line width in pixels. +#' @param elevation_scale Elevation multiplier. The final elevation is calculated by +#' elevationScale * getElevation(d). elevationScale is a handy property to scale +#' all polygon elevation without updating the data +#' @param point_radius_scale A global radius multiplier for all points. +#' @param point_radius_min_pixels The minimum radius in pixels. #' @param tooltip variable of \code{data} containing text or HTML to render as a tooltip. #' Only works on \code{sf} objects. #' @param legend either a logical indiciating if the legend(s) should be displayed, or @@ -188,6 +201,8 @@ add_geojson <- function( stroke_colour = NULL, stroke_opacity = NULL, stroke_width = NULL, + dash_size = NULL, + dash_gap = NULL, fill_colour = NULL, fill_opacity = NULL, radius = NULL, @@ -201,6 +216,12 @@ add_geojson <- function( highlight_colour = "#AAFFFFFF", palette = "viridis", na_colour = "#808080FF", + line_width_units = c("metres", "pixels"), + line_width_scale = 1, + line_width_min_pixels = 0, + elevation_scale = 1, + point_radius_scale = 1, + point_radius_min_pixels = 1, update_view = TRUE, focus_layer = FALSE, digits = 6, @@ -211,6 +232,8 @@ add_geojson <- function( l[["stroke_colour"]] <- force( stroke_colour ) l[["stroke_opacity"]] <- force( stroke_opacity ) l[["stroke_width"]] <- force( stroke_width ) + l[["dash_size"]] <- force(dash_size) + l[["dash_gap"]] <- force(dash_gap) l[["fill_colour"]] <- force( fill_colour ) l[["fill_opacity"]] <- force( fill_opacity ) l[["elevation"]] <- force( elevation ) @@ -227,6 +250,8 @@ add_geojson <- function( !is.null( l[["stroke_colour"]] ) | !is.null( l[["stroke_opacity"]] ) | !is.null( l[["stroke_width"]] ) | + !is.null( l[["dash_size"]] ) | + !is.null( l[["dash_gap"]] ) | !is.null( l[["fill_colour"]] ) | !is.null( l[["fill_opacity"]] ) | !is.null( l[["elevation"]] ) | @@ -243,6 +268,8 @@ add_geojson <- function( l <- resolve_legend_options( l, legend_options ) l <- resolve_geojson_data( data, l ) + line_width_units <- match.arg(line_width_units) + if( !is.null(l[["data"]] ) ) { data <- l[["data"]] l[["data"]] <- NULL @@ -282,7 +309,8 @@ add_geojson <- function( invoke_method( map, jsfunc, map_type( map ), shape[["data"]], layer_id, light_settings, auto_highlight, highlight_colour, shape[["legend"]], bbox, update_view, focus_layer, - js_transitions + js_transitions, line_width_units, line_width_scale, line_width_min_pixels, + elevation_scale, point_radius_scale, point_radius_min_pixels ) } diff --git a/R/map_layer_path.R b/R/map_layer_path.R index 07786491..4c237941 100644 --- a/R/map_layer_path.R +++ b/R/map_layer_path.R @@ -18,6 +18,8 @@ mapdeckPathDependency <- function() { #' #' @inheritParams add_polygon #' @param stroke_width width of the stroke in meters. Default 1. +#' @param dash_size size of each dash, relative to the width of the stroke +#' @param dash_gap size of the gap between dashes, relative to the width of the stroke #' @param billboard logical indicating if the path always faces the camera (TRUE) or #' if it always faces up (FALSE) #' @@ -75,6 +77,8 @@ add_path <- function( stroke_colour = NULL, stroke_width = NULL, stroke_opacity = NULL, + dash_size = NULL, + dash_gap = NULL, tooltip = NULL, billboard = FALSE, layer_id = NULL, @@ -97,6 +101,8 @@ add_path <- function( l[["stroke_colour"]] <- force( stroke_colour) l[["stroke_width"]] <- force( stroke_width ) l[["stroke_opacity"]] <- resolve_opacity( stroke_opacity ) + l[["dash_size"]] <- force(dash_size) + l[["dash_gap"]] <- force(dash_gap) l[["tooltip"]] <- force(tooltip) l[["id"]] <- force(id) l[["na_colour"]] <- force(na_colour) diff --git a/README.Rmd b/README.Rmd index 69ae37ca..f4924e1c 100644 --- a/README.Rmd +++ b/README.Rmd @@ -56,6 +56,7 @@ To use the development version you need some other development dependant librari ```r devtools::install_github("SymbolixAU/jsonify", force = TRUE) +devtools::install_github("dcooley/sfheaders", force = TRUE) devtools::install_github("SymbolixAU/geojsonsf", force = TRUE) devtools::install_github("SymbolixAU/colourvalues", force = TRUE) devtools::install_github("SymbolixAU/spatialwidget", force = TRUE) diff --git a/README.md b/README.md index 58f6b954..8488c77e 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ libraries ``` r devtools::install_github("SymbolixAU/jsonify", force = TRUE) +devtools::install_github("dcooley/sfheaders", force = TRUE) devtools::install_github("SymbolixAU/geojsonsf", force = TRUE) devtools::install_github("SymbolixAU/colourvalues", force = TRUE) devtools::install_github("SymbolixAU/spatialwidget", force = TRUE) diff --git a/inst/htmlwidgets/lib/geojson/geojson.js b/inst/htmlwidgets/lib/geojson/geojson.js index ae990b08..183acea9 100644 --- a/inst/htmlwidgets/lib/geojson/geojson.js +++ b/inst/htmlwidgets/lib/geojson/geojson.js @@ -1,6 +1,6 @@ -function add_geojson_sf( map_id, map_type, geojson, layer_id, light_settings, auto_highlight, highlight_colour, legend, bbox, update_view, focus_layer, js_transition ) { +function add_geojson_sf( map_id, map_type, geojson, layer_id, light_settings, auto_highlight, highlight_colour, legend, bbox, update_view, focus_layer, js_transition, line_width_units, line_width_scale, line_width_min_pixels, elevation_scale, point_radius_scale, point_radius_min_pixels ) { geojson = geojson.features; @@ -13,16 +13,22 @@ function add_geojson_sf( map_id, map_type, geojson, layer_id, light_settings, au filled: true, extruded: true, wireframe: false, - pointRadiusScale: 1, - pointRadiusMinPixels: 0.5, - lineWidthScale: 1, - lineWidthMinPixels: 1, + + pointRadiusMinPixels: point_radius_min_pixels, + pointRadiusScale: point_radius_scale, + lineWidthUnits: line_width_units, + lineWidthScale: line_width_scale, + lineWidthMinPixels: line_width_min_pixels, lineJointRounded: true, + elevationScale: elevation_scale, + getFillColor: g => md_hexToRGBA( g.properties.fill_colour ), getLineColor: g => md_hexToRGBA( g.properties.stroke_colour), getRadius: g => g.properties.radius, getLineWidth: g => g.properties.stroke_width, getElevation: g => g.properties.elevation, + getLineDashArray: d => [ d.properties.dash_size, d.properties.dash_gap ], + lightSettings: light_settings, onClick: info => md_layer_click( map_id, "geojson", info ), autoHighlight: auto_highlight, @@ -37,13 +43,14 @@ function add_geojson_sf( map_id, map_type, geojson, layer_id, light_settings, au md_update_layer( map_id, 'geojson-'+layer_id, geojsonLayer ); } - if (legend !== false) { + //console.log( legend ); + if (legend !== false && legend !== null ) { md_add_legend(map_id, map_type, layer_id, legend); } md_layer_view( map_id, map_type, layer_id, focus_layer, bbox, update_view ); } -function add_geojson( map_id, map_type, geojson, layer_id, light_settings, auto_highlight, highlight_colour, legend, bbox, update_view, focus_layer, js_transition ) { +function add_geojson( map_id, map_type, geojson, layer_id, light_settings, auto_highlight, highlight_colour, legend, bbox, update_view, focus_layer, js_transition, line_width_units, line_width_scale, line_width_min_pixels, elevation_scale, point_radius_scale, point_radius_min_pixels) { const geojsonLayer = new deck.GeoJsonLayer({ map_id: map_id, @@ -54,16 +61,22 @@ function add_geojson( map_id, map_type, geojson, layer_id, light_settings, auto_ filled: true, extruded: true, wireframe: false, - pointRadiusScale: 1, - pointRadiusMinPixels: 0.5, - lineWidthScale: 1, - lineWidthMinPixels: 1, + + pointRadiusMinPixels: point_radius_min_pixels, + pointRadiusScale: point_radius_scale, + lineWidthUnits: line_width_units, + lineWidthScale: line_width_scale, + lineWidthMinPixels: line_width_min_pixels, lineJointRounded: true, + elevationScale: elevation_scale, + getFillColor: g => md_hexToRGBA( geojson_fill_colour( g ) ), getLineColor: g => md_hexToRGBA( geojson_line_colour( g ) ), getRadius: g => geojson_radius( g ), getLineWidth: g => geojson_line_width( g ), getElevation: g => geojson_elevation( g ), + getLineDashArray: d => [ d.dash_size, d.dash_gap ], + lightSettings: light_settings, onClick: info => md_layer_click( map_id, "geojson", info ), autoHighlight: auto_highlight, @@ -78,7 +91,8 @@ function add_geojson( map_id, map_type, geojson, layer_id, light_settings, auto_ md_update_layer( map_id, 'geojson-'+layer_id, geojsonLayer ); } - if (legend !== false) { + //console.log( legend ); + if (legend !== false && legend !== null ) { md_add_legend(map_id, map_type, layer_id, legend); } diff --git a/inst/htmlwidgets/lib/path/path.js b/inst/htmlwidgets/lib/path/path.js index 01217f64..f48bb19b 100644 --- a/inst/htmlwidgets/lib/path/path.js +++ b/inst/htmlwidgets/lib/path/path.js @@ -18,6 +18,7 @@ legend, bbox, update_view, focus_layer, js_transition, billboard ) { getPath: d => md_get_line_coordinates( d ), getColor: d => md_hexToRGBA( d.properties.stroke_colour ), getWidth: d => d.properties.stroke_width, + getDashArray: d => [ d.properties.dash_size, d.properties.dash_gap ], onClick: info => md_layer_click( map_id, "path", info ), onHover: md_update_tooltip, autoHighlight: auto_highlight, @@ -54,6 +55,7 @@ function add_path_polyline( map_id, map_type, path_data, layer_id, auto_highligh getPath: d => md_decode_polyline( d.polyline ), // needs to be one row per polyline getColor: d => md_hexToRGBA( d.stroke_colour ), getWidth: d => d.stroke_width, + getDashArray: d => [ d.dash_size, d.dash_gap ], onClick: info => md_layer_click( map_id, "path", info ), onHover: md_update_tooltip, autoHighlight: auto_highlight, diff --git a/inst/include/mapdeck_defaults.hpp b/inst/include/mapdeck_defaults.hpp index 4d89210a..5be08589 100644 --- a/inst/include/mapdeck_defaults.hpp +++ b/inst/include/mapdeck_defaults.hpp @@ -92,6 +92,11 @@ namespace defaults { return nv; } + inline Rcpp::NumericVector default_dash( int n ) { + Rcpp::NumericVector nv(n, 0.0); + return nv; + } + } // namespace defaults } // namespace mapdeck diff --git a/man/add_geojson.Rd b/man/add_geojson.Rd index af78ebbb..942e01df 100644 --- a/man/add_geojson.Rd +++ b/man/add_geojson.Rd @@ -6,13 +6,16 @@ \usage{ add_geojson(map, data = get_map_data(map), layer_id = NULL, stroke_colour = NULL, stroke_opacity = NULL, stroke_width = NULL, - fill_colour = NULL, fill_opacity = NULL, radius = NULL, - elevation = NULL, light_settings = list(), legend = F, - legend_options = NULL, legend_format = NULL, - auto_highlight = FALSE, tooltip = NULL, + dash_size = NULL, dash_gap = NULL, fill_colour = NULL, + fill_opacity = NULL, radius = NULL, elevation = NULL, + light_settings = list(), legend = F, legend_options = NULL, + legend_format = NULL, auto_highlight = FALSE, tooltip = NULL, highlight_colour = "#AAFFFFFF", palette = "viridis", - na_colour = "#808080FF", update_view = TRUE, focus_layer = FALSE, - digits = 6, transitions = NULL) + na_colour = "#808080FF", line_width_units = c("metres", "pixels"), + line_width_scale = 1, line_width_min_pixels = 0, + elevation_scale = 1, point_radius_scale = 1, + point_radius_min_pixels = 1, update_view = TRUE, + focus_layer = FALSE, digits = 6, transitions = NULL) } \arguments{ \item{map}{a mapdeck map object} @@ -29,6 +32,10 @@ to conflict and not plot correctly} \item{stroke_width}{column of an \code{sf} object, or field inside a GeoJSON \code{property} to use for width (in meters)} +\item{dash_size}{size of each dash, relative to the width of the stroke} + +\item{dash_gap}{size of the gap between dashes, relative to the width of the stroke} + \item{fill_colour}{column of an \code{sf} object, or field inside a GeoJSON \code{property} to use for colour} \item{fill_opacity}{column of an \code{sf} object, or field inside a GeoJSON \code{property} to use for opacity} @@ -62,6 +69,23 @@ palette for different colour options (where available), \item{na_colour}{hex string colour to use for NA values} +\item{line_width_units}{The units of the line width, one of 'meters', 'pixels'. +When zooming in and out, meter sizes scale with the base map, and pixel sizes remain the same on screen.} + +\item{line_width_scale}{The line width multiplier that multiplied to all lines, +including the LineString and MultiLineString features and also the outline for +Polygon and MultiPolygon features if the stroked attribute is true} + +\item{line_width_min_pixels}{The minimum line width in pixels.} + +\item{elevation_scale}{Elevation multiplier. The final elevation is calculated by +elevationScale * getElevation(d). elevationScale is a handy property to scale +all polygon elevation without updating the data} + +\item{point_radius_scale}{A global radius multiplier for all points.} + +\item{point_radius_min_pixels}{The minimum radius in pixels.} + \item{update_view}{logical indicating if the map should update the bounds to include this layer} \item{focus_layer}{logical indicating if the map should update the bounds to only include this layer} diff --git a/man/add_path.Rd b/man/add_path.Rd index f691fdbc..f87c55b1 100644 --- a/man/add_path.Rd +++ b/man/add_path.Rd @@ -6,7 +6,8 @@ \usage{ add_path(map, data = get_map_data(map), polyline = NULL, stroke_colour = NULL, stroke_width = NULL, stroke_opacity = NULL, - tooltip = NULL, billboard = FALSE, layer_id = NULL, id = NULL, + dash_size = NULL, dash_gap = NULL, tooltip = NULL, + billboard = FALSE, layer_id = NULL, id = NULL, auto_highlight = FALSE, highlight_colour = "#AAFFFFFF", palette = "viridis", na_colour = "#808080FF", legend = FALSE, legend_options = NULL, legend_format = NULL, update_view = TRUE, @@ -25,6 +26,10 @@ EPSG:4326 (WGS 84) coordinate system} \item{stroke_width}{width of the stroke in meters. Default 1.} +\item{dash_size}{size of each dash, relative to the width of the stroke} + +\item{dash_gap}{size of the gap between dashes, relative to the width of the stroke} + \item{tooltip}{variable of \code{data} containing text or HTML to render as a tooltip} \item{billboard}{logical indicating if the path always faces the camera (TRUE) or diff --git a/src/geojson.cpp b/src/geojson.cpp index a06e08d6..8a748e07 100644 --- a/src/geojson.cpp +++ b/src/geojson.cpp @@ -9,7 +9,9 @@ Rcpp::List geojson_defaults(int n) { _["fill_colour"] = mapdeck::defaults::default_fill_colour( n ), _["stroke_colour"] = mapdeck::defaults::default_stroke_colour( n ), _["elevation"] = mapdeck::defaults::default_elevation( n ), - _["stroke_width"] = mapdeck::defaults::default_stroke_width( n ) + _["stroke_width"] = mapdeck::defaults::default_stroke_width( n ), + _["dash_size"] = mapdeck::defaults::default_dash( n ), + _["dash_gap"] = mapdeck::defaults::default_dash( n ) ); } diff --git a/src/path.cpp b/src/path.cpp index 3565cb3a..f3474ce9 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -7,7 +7,9 @@ Rcpp::List path_defaults(int n) { return Rcpp::List::create( _["stroke_colour"] = mapdeck::defaults::default_stroke_colour( n ), - _["stroke_width"] = mapdeck::defaults::default_stroke_width( n ) + _["stroke_width"] = mapdeck::defaults::default_stroke_width( n ), + _["dash_size"] = mapdeck::defaults::default_dash( n ), + _["dash_gap"] = mapdeck::defaults::default_dash( n ) ); } From 50ca6dc91844323f5625a54e34d6e40c1bf180a3 Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 14 Sep 2019 19:39:50 +1000 Subject: [PATCH 19/24] udpate style closes #206 --- NAMESPACE | 1 + R/map_styles.R | 1 + R/mapdeck_map.R | 13 +++++++++++++ inst/htmlwidgets/mapdeck.js | 4 ++++ inst/htmlwidgets/mapdeck_location.js | 12 ++++++++++++ man/update_style.Rd | 16 ++++++++++++++++ 6 files changed, 47 insertions(+) create mode 100644 man/update_style.Rd diff --git a/NAMESPACE b/NAMESPACE index 65d966bd..d6ff72e2 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -96,6 +96,7 @@ export(mapdeck_update) export(mapdeck_view) export(renderMapdeck) export(set_token) +export(update_style) import(htmlwidgets) importFrom(Rcpp,sourceCpp) importFrom(magrittr,"%>%") diff --git a/R/map_styles.R b/R/map_styles.R index 9539bda8..3a0c72ca 100644 --- a/R/map_styles.R +++ b/R/map_styles.R @@ -34,3 +34,4 @@ mapdeck_style <- function( ) ) } + diff --git a/R/mapdeck_map.R b/R/mapdeck_map.R index ff52dd72..fff0fa33 100644 --- a/R/mapdeck_map.R +++ b/R/mapdeck_map.R @@ -91,6 +91,19 @@ mapdeck <- function( } +#' update style +#' +#' @param map a mapdeck map object +#' @param style the style of the map (see \link{mapdeck_style}) +#' +#' @export +update_style <- function( map, style ) { + invoke_method( + map, "md_update_style", style + ) +} + + #' Shiny bindings for mapdeck #' #' Output and render functions for using mapdeck within Shiny diff --git a/inst/htmlwidgets/mapdeck.js b/inst/htmlwidgets/mapdeck.js index 2ecd48e8..5d784fbc 100644 --- a/inst/htmlwidgets/mapdeck.js +++ b/inst/htmlwidgets/mapdeck.js @@ -10,6 +10,9 @@ HTMLWidgets.widget({ renderValue: function(x) { + //console.log( "getting mapbox map??" ); + //console.log( mapboxgl ); + md_setup_window( el.id ); // INITIAL VIEW @@ -34,6 +37,7 @@ HTMLWidgets.widget({ } else { const deckgl = new deck.DeckGL({ mapboxApiAccessToken: x.access_token, + //map: mapboxgl, container: el.id, mapStyle: x.style, //initialViewState: window[el.id + 'INITIAL_VIEW_STATE'], diff --git a/inst/htmlwidgets/mapdeck_location.js b/inst/htmlwidgets/mapdeck_location.js index d399a264..8509b539 100644 --- a/inst/htmlwidgets/mapdeck_location.js +++ b/inst/htmlwidgets/mapdeck_location.js @@ -36,6 +36,18 @@ function md_change_location( map_id, map_type, location, zoom, pitch, bearing, d } } +function md_update_style( map_id, style ) { + + var vs = window[ map_id + 'map'].viewState; + var map = window[ map_id + 'map'].getMapboxMap(); + map.setStyle( style ); + + window[ map_id + 'map' ].setProps({ + layers: [...window[map_id + 'layers'] ], + map: map, + viewState: vs + }); +} function md_layer_view( map_id, map_type, layer_id, focus_layer, bbox, update_view ) { diff --git a/man/update_style.Rd b/man/update_style.Rd new file mode 100644 index 00000000..bfd90c5e --- /dev/null +++ b/man/update_style.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/mapdeck_map.R +\name{update_style} +\alias{update_style} +\title{update style} +\usage{ +update_style(map, style) +} +\arguments{ +\item{map}{a mapdeck map object} + +\item{style}{the style of the map (see \link{mapdeck_style})} +} +\description{ +update style +} From a5471b76d291a1b9a086b2c8e712ff6a5f032b1b Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 14 Sep 2019 19:54:42 +1000 Subject: [PATCH 20/24] close #217 --- R/map_layer_column.R | 1 + inst/htmlwidgets/lib/column/column.js | 46 --------------------------- man/add_column.Rd | 2 ++ 3 files changed, 3 insertions(+), 46 deletions(-) diff --git a/R/map_layer_column.R b/R/map_layer_column.R index 0bc63971..98148f59 100644 --- a/R/map_layer_column.R +++ b/R/map_layer_column.R @@ -24,6 +24,7 @@ mapdeckColumnDependency <- function() { #' The disk is a regular polygon that fits inside the given radius. #' A higher resolution will yield a smoother look close-up, but also requires more resources to render. #' @param radius in metres. Default 1000 +#' @param angle disk rotation, counter-clockwise, in degrees #' @param coverage radius multiplier, in range [0,1]. The radius of the disk is calcualted #' by coverage * radius #' @param elevation_scale value to scale the elevations of the columns Default 1 diff --git a/inst/htmlwidgets/lib/column/column.js b/inst/htmlwidgets/lib/column/column.js index 36140cc7..d5022777 100644 --- a/inst/htmlwidgets/lib/column/column.js +++ b/inst/htmlwidgets/lib/column/column.js @@ -81,49 +81,3 @@ function add_column_polyline( map_id, map_type, column_data, layer_id, auto_high md_layer_view( map_id, map_type, layer_id, focus_layer, bbox, update_view ); } -function md_column_elevation(d, use_weight, use_polyline, elevation_function ) { - - if( !use_weight ) { - return d.length; - } - - var i, total = 0; - - if( use_polyline ) { - for( i = 0; i < d.length; i++ ) { - total = total + d[i].elevation; - } - } else { - for( i = 0; i < d.length; i++ ) { - total = total + d[i].properties.elevation; - } - } - if ( elevation_function === "average" ) { - total = total / d.length; - } - return total; -} - -function md_column_colour(d, use_colour, use_polyline, colour_function ) { - - //console.log( d ); - if( !use_colour ) { - return d.length; - } - - var i, total = 0; - - if( use_polyline ) { - for( i = 0; i < d.length; i++ ) { - total = total + d[i].colour; - } - } else { - for( i = 0; i < d.length; i++ ) { - total = total + d[i].properties.colour; - } - } - if ( colour_function === "average" ) { - total = total / d.length; - } - return total; -} diff --git a/man/add_column.Rd b/man/add_column.Rd index 6e6f99cf..28d716fc 100644 --- a/man/add_column.Rd +++ b/man/add_column.Rd @@ -49,6 +49,8 @@ colour, this argument is ignored and you should include the alpha on the hex str \item{coverage}{radius multiplier, in range [0,1]. The radius of the disk is calcualted by coverage * radius} +\item{angle}{disk rotation, counter-clockwise, in degrees} + \item{disk_resolution}{The number of sides to render the disk as. The disk is a regular polygon that fits inside the given radius. A higher resolution will yield a smoother look close-up, but also requires more resources to render.} From 39aa0d6cf5a79b0e0b36caa3206f871e5832e0a3 Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 14 Sep 2019 20:11:49 +1000 Subject: [PATCH 21/24] readme --- README.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.Rmd b/README.Rmd index f4924e1c..941eb333 100644 --- a/README.Rmd +++ b/README.Rmd @@ -23,7 +23,7 @@ knitr::opts_chunk$set( ## What is mapdeck? -An R library which lets you plot interactive maps using Mapbox GL and Deck.gl +An R library which lets you plot large data sets (as much as your GPU & browser can handle), on interactive maps using Mapbox GL and Deck.gl ## What is mapbox? From a042413eea1e00ec3e6f6592dbb66ad5d953df5f Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 14 Sep 2019 20:12:13 +1000 Subject: [PATCH 22/24] news --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index dd3cc354..bc25e416 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # mapdeck 0.3 +* `update_stype()` function * `add_path()` accepts dashed lines * mapbox tokens are searched for in environement variables if one isn't provided [issue209](https://github.com/SymbolixAU/mapdeck/issues/209) * z-fighting [issue 199](https://github.com/SymbolixAU/mapdeck/issues/199) From 60072889d666028f035cc1530b1a34d6d0c3ccb9 Mon Sep 17 00:00:00 2001 From: tospig Date: Sat, 14 Sep 2019 20:13:55 +1000 Subject: [PATCH 23/24] readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8488c77e..28574a0c 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ Status](https://codecov.io/github/SymbolixAU/mapdeck/coverage.svg?branch=master) ## What is mapdeck? -An R library which lets you plot interactive maps using Mapbox GL and -Deck.gl +An R library which lets you plot large data sets (as much as your GPU & +browser can handle), on interactive maps using Mapbox GL and Deck.gl ## What is mapbox? From cb85aafb7a5f9fcf15b230ccd76e7001ac56ec7f Mon Sep 17 00:00:00 2001 From: tospig Date: Sun, 15 Sep 2019 10:39:15 +1000 Subject: [PATCH 24/24] close #209 --- R/mapdeck_tokens.R | 11 +++++++---- tests/testthat/test-layer_path.R | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/R/mapdeck_tokens.R b/R/mapdeck_tokens.R index 60438bfb..09b5bbbd 100644 --- a/R/mapdeck_tokens.R +++ b/R/mapdeck_tokens.R @@ -78,10 +78,13 @@ get_access_token <- function(api = "mapbox") { api <- getOption("mapdeck")[['mapdeck']][[api]] if( is.null( api ) || is.na( api ) ) { - api <- Sys.getenv( - c("MAPBOX_TOKEN","MAPBOX_KEY","MAPBOX_API_TOKEN", "MAPBOX_API_KEY", "MAPBOX", "MAPDECK") - ) - api <- unname( api[which(nzchar(api))] ) + e <- Sys.getenv() + e <- e[ grep( "mapbox|mapdeck", names( e ), ignore.case = TRUE ) ] + + api <- unique( as.character( e ) ) + if( length( api ) > 1 ) { + warning("Multiple MAPBOX API tokens found in Sys.getenv(), using the firt one") + } } if(length(api) == 0) api <- NULL return(api[1L]) diff --git a/tests/testthat/test-layer_path.R b/tests/testthat/test-layer_path.R index bf8fb925..46f8da2b 100644 --- a/tests/testthat/test-layer_path.R +++ b/tests/testthat/test-layer_path.R @@ -5,8 +5,8 @@ test_that("add_path accepts multiple objects", { testthat::skip_on_cran() testthat::skip_on_travis() - geo <- '[{"type":"Feature","properties":{"stroke_colour":"#440154FF","stroke_width":1.0},"geometry":{"geometry":{"type":"LineString","coordinates":[[145.014291,-37.830458],[145.014345,-37.830574],[145.01449,-37.830703],[145.01599,-37.831484],[145.016479,-37.831699],[145.016813,-37.83175],[145.01712,-37.831742],[145.0175,-37.831667],[145.017843,-37.831559],[145.018349,-37.83138],[145.018603,-37.83133],[145.018901,-37.831301],[145.019136,-37.831301],[145.01943,-37.831333],[145.019733,-37.831377],[145.020195,-37.831462],[145.020546,-37.831544],[145.020641,-37.83159],[145.020748,-37.83159],[145.020993,-37.831664]]}}},{"type":"Feature","properties":{"stroke_colour":"#440154FF","stroke_width":1.0},"geometry":{"geometry":{"type":"LineString","coordinates":[[145.015016,-37.830832],[145.015561,-37.831125],[145.016285,-37.831463],[145.016368,-37.8315],[145.016499,-37.831547],[145.016588,-37.831572],[145.01668,-37.831593],[145.01675,-37.831604],[145.016892,-37.83162],[145.016963,-37.831623],[145.017059,-37.831623],[145.017154,-37.831617],[145.017295,-37.831599],[145.017388,-37.831581],[145.017523,-37.831544],[145.018165,-37.831324],[145.018339,-37.831275],[145.018482,-37.831245],[145.018627,-37.831223],[145.01881,-37.831206],[145.018958,-37.831202],[145.019142,-37.831209],[145.019325,-37.831227],[145.019505,-37.831259],[145.020901,-37.831554],[145.020956,-37.83157]]}}}]' - poly <- '[{"stroke_colour":"#440154FF","stroke_width":1.0,"polyline":"hw{eFibbtZVIX]zCiHh@aBJcAA}@OkAUcAa@cBIs@E{@?m@D{@F{@P{ANeAHS?SLq@"},{"stroke_colour":"#440154FF","stroke_width":1.0,"polyline":"ty{eFyfbtZx@mBbAoCFOFYDQBS@MB[?M?QASC[AQG[k@_CIa@E]C[Ce@?[?e@Bc@Dc@z@wGBI"}]' + geo <- '[{"type":"Feature","properties":{"stroke_colour":"#440154FF","stroke_width":1.0,"dash_size":0.0,"dash_gap":0.0},"geometry":{"geometry":{"type":"LineString","coordinates":[[145.014291,-37.830458],[145.014345,-37.830574],[145.01449,-37.830703],[145.01599,-37.831484],[145.016479,-37.831699],[145.016813,-37.83175],[145.01712,-37.831742],[145.0175,-37.831667],[145.017843,-37.831559],[145.018349,-37.83138],[145.018603,-37.83133],[145.018901,-37.831301],[145.019136,-37.831301],[145.01943,-37.831333],[145.019733,-37.831377],[145.020195,-37.831462],[145.020546,-37.831544],[145.020641,-37.83159],[145.020748,-37.83159],[145.020993,-37.831664]]}}},{"type":"Feature","properties":{"stroke_colour":"#440154FF","stroke_width":1.0,"dash_size":0.0,"dash_gap":0.0},"geometry":{"geometry":{"type":"LineString","coordinates":[[145.015016,-37.830832],[145.015561,-37.831125],[145.016285,-37.831463],[145.016368,-37.8315],[145.016499,-37.831547],[145.016588,-37.831572],[145.01668,-37.831593],[145.01675,-37.831604],[145.016892,-37.83162],[145.016963,-37.831623],[145.017059,-37.831623],[145.017154,-37.831617],[145.017295,-37.831599],[145.017388,-37.831581],[145.017523,-37.831544],[145.018165,-37.831324],[145.018339,-37.831275],[145.018482,-37.831245],[145.018627,-37.831223],[145.01881,-37.831206],[145.018958,-37.831202],[145.019142,-37.831209],[145.019325,-37.831227],[145.019505,-37.831259],[145.020901,-37.831554],[145.020956,-37.83157]]}}}]' + poly <- '[{"stroke_colour":"#440154FF","stroke_width":1.0,"dash_size":0.0,"dash_gap":0.0,"polyline":"hw{eFibbtZVIX]zCiHh@aBJcAA}@OkAUcAa@cBIs@E{@?m@D{@F{@P{ANeAHS?SLq@"},{"stroke_colour":"#440154FF","stroke_width":1.0,"dash_size":0.0,"dash_gap":0.0,"polyline":"ty{eFyfbtZx@mBbAoCFOFYDQBS@MB[?M?QASC[AQG[k@_CIa@E]C[Ce@?[?e@Bc@Dc@z@wGBI"}]' ## sf set_token("abc")